[Feature] Add additional CLI commands
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 61.6k
- Forks
- 4.6k
- Avg merge
- 23h 49m
- Merged PRs (30d)
- 89
Description
Summary
Add a few additional CLI commands for use from external apps, scripts and browsers
Problem it solves
This would facilitate communication between Marktext and other applications/scripts
Proposed solution
Additional commands
- --note PATH_TO_NOTE
- Open supplied note path/filename
- Create the note if it does not exist
- --text TEXT_STRING
- Text to add to the previous suggested --note command
- --clipboard
- Text from the clipboard to add to the previous suggested --note command
- --append_header HEADER_STRING
- Append supplied text to the bottom of text after supplied header
- --prepend_header HEADER_STRING
- Prepend supplied text to the top of text after supplied header
Other Possibilities
- --image FILE
- Image to add to the
Global image folder
- Image to add to the
- --attachment FILE
- This would be useful for other non image file types Eg. PDF, XML, CVS, etc.
- This would probably work best with an option for a
Global attachments folder:location in settings
Alternatives considered [optional]
A lot of this could be accomplished with bash scripts, but that would not always work as well from browsers and other apps
Additional context [optional]
Examples:
marktext --note /home/user/Documents/Marktext/Tasks.md --text "- [ ] Some important task" --append-header "Todo"
marktext --note /home/user/Documents/Marktext/Tasks.md --text "- [ ] Another important task" --prepend-header "Todo"
Result In Tasks.md
Todo
- Another important task
- Some important task
Another example using clipboard
marktext --note /home/user/Documents/Marktext/Research.md --clipboard --prepend-header "Project Research"
Result In Research.md
Project Research
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating MarkText's existing CLI argument entry point and any current command handling. Trace how a note path, text, clipboard content, and header operations would interact, then clarify behavior for missing files and the optional image or attachment proposals. Done means the agreed commands work with the documented examples and have coverage for their supported combinations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron, typescript
- Domain
- cli, desktop
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100