diff --git a/docs/reference-command-line.md b/docs/reference-command-line.md new file mode 100644 index 00000000..075d2272 --- /dev/null +++ b/docs/reference-command-line.md @@ -0,0 +1,131 @@ +# Command Line Reference + +## Synopsis +``` +usage: jrnl [--debug] [--help] [--version] [--list] [--encrypt] [--decrypt] + [--import] [-on DATE] [-today-in-history] [-month DATE] + [-day DATE] [-year DATE] [-from DATE] [-to DATE] [-contains TEXT] + [-and] [-starred] [-n [NUMBER]] [-not [TAG]] [--edit] [--delete] + [--format TYPE] [--tags] [--short] + [--config-override CONFIG_KV_PAIR CONFIG_KV_PAIR] + [[...]] +``` + +## Standalone Commands + +These commands will exit after they complete. You may only run one at a time. + +### --help +Show a help message. + +### --version +Print version and license information. + +### --list +List the config file location, all configured journals, and their locations. + +### ---encrypt +Encrypt a journal. See [encryption](encryption.md) for more information. + +### --decrypt +Decrypt a journal. See [encryption](encryption.md) for more information. + + +### --import +Import entries from another journal. If any entries have the exact same content +and timestamp, they will be deduplicated. + +Optional parameters: +``` +--file FILENAME +``` +Specify a file to import. If not provided, `jrnl` will use STDIN as the data source. + +``` +--format [jrnl] +``` + +Specify the format of the file that is being imported. Defaults to the same data +storage method that jrnl uses. See [formats](formats.md) for more information. + +## Writing new entries +See [Basic Usage](usage.md). + +## Searching + +To find entries from your journal, use any combination of the below filters. +Only entries that match all the filters will be displayed. + +When specifying dates, you can use the same kinds of dates you use for new +entries, such as `yesterday`, `today`, `Tuesday`, or `2021-08-01`. + +| Search Argument | Description | +| --- | --- | +| -on DATE | Show entries on this date | +| -today-in-history | Show entries of today over the years | +| -month DATE | Show entries on this month of any year | +| -day DATE | Show entries on this day of any month | +| -year DATE | Show entries of a specific year | +| -from DATE | Show entries after, or on, this date | +| -to DATE | Show entries before, or on, this date (alias: -until) | +| -contains TEXT | Show entries containing specific text (put quotes around text with spaces) | +| -and | Show only entries that match all conditions, like saying "x AND y" (default: OR) | +| -starred | Show only starred entries (marked with *) | +| -n [NUMBER] | Show a maximum of NUMBER entries (note: '-n 3' and '-3' have the same effect) | +| -not [TAG] | Exclude entries with this tag | + +## Searching Options +These help you do various tasks with the selected entries from your search. +If used on their own (with no search), they will act on your entire journal. + +### --edit +Opens the selected entries in your configured editor. It will fail if the +`editor` key is not set in your config file. + +Once you begin editing, you can add multiple entries and delete entries +by modifying the text in your editor. When your editor closes, jrnl reads +the temporary file you were editing and makes the changes to your journal. + +### --delete +Interactively deletes selected entries. You'll be asked to confirm deletion of +each entry. + +### --format TYPE +Display selected entries in an alternate format. See [formats](formats.md). + +#### Optional parameters +``` +--file FILENAME +``` +Write output to file instead of STDOUT. In most shells, the +same effect can be achieved using `>`. + +### --tags + +Alias for '--format tags'. Returns a list of all tags and the number of times +they occur within the searched entries. If there are no tags found, `jrnl` will output a message saying so. + +### --short +Only shows the date and titles of the searched entries. + +## Configuration arguments + +### --config-override CONFIG_KV_PAIR CONFIG_KV_PAIR + +Override configured key-value pair with CONFIG_KV_PAIR for this command invocation only. + +Examples: + +Use a different editor for this jrnl entry: +``` +jrnl --config-override editor "nano" +``` +Override color selections: +``` +jrnl --config-override colors.body blue --config-override colors.title green +``` + +## Other Arguments + +### --debug +Prints information useful for troubleshooting. diff --git a/docs/reference-config-file.md b/docs/reference-config-file.md new file mode 100644 index 00000000..49c868f5 --- /dev/null +++ b/docs/reference-config-file.md @@ -0,0 +1,2 @@ +# Configuration File Reference + diff --git a/mkdocs.yml b/mkdocs.yml index 65a515da..1a3e68d4 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -25,3 +25,6 @@ nav: - Formats: formats.md - Advanced Usage: advanced.md - Recipes: recipes.md + - Command Line Reference: reference-command-line.md + - Configuration File Reference: reference-config-file.md +