1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-11 18:24:43 +02:00

Doc: Update CLI doc

This commit is contained in:
Laurent Cozic 2020-03-08 09:17:10 +00:00
parent b44a2075a8
commit 52d9807648
3 changed files with 227 additions and 126 deletions

View File

@ -15,6 +15,10 @@ class Command extends BaseCommand {
return 'Build the API doc';
}
enabled() {
return false;
}
createPropertiesTable(tableFields) {
const headers = [
{ name: 'name', label: 'Name' },

View File

@ -19,11 +19,18 @@ class Command extends BaseCommand {
}
enabled() {
return false;
return true;
}
options() {
return [['-n, --limit <num>', _('Displays only the first top <num> notes.')], ['-s, --sort <field>', _('Sorts the item by <field> (eg. title, updated_time, created_time).')], ['-r, --reverse', _('Reverses the sorting order.')], ['-t, --type <type>', _('Displays only the items of the specific type(s). Can be `n` for notes, `t` for to-dos, or `nt` for notes and to-dos (eg. `-tt` would display only the to-dos, while `-ttd` would display notes and to-dos.')], ['-f, --format <format>', _('Either "text" or "json"')], ['-l, --long', _('Use long list format. Format is ID, NOTE_COUNT (for notebook), DATE, TODO_CHECKED (for to-dos), TITLE')]];
return [
['-n, --limit <num>', _('Displays only the first top <num> notes.')],
['-s, --sort <field>', _('Sorts the item by <field> (eg. title, updated_time, created_time).')],
['-r, --reverse', _('Reverses the sorting order.')],
['-t, --type <type>', _('Displays only the items of the specific type(s). Can be `n` for notes, `t` for to-dos, or `nt` for notes and to-dos (eg. `-tt` would display only the to-dos, while `-ttd` would display notes and to-dos.')],
['-f, --format <format>', _('Either "text" or "json"')],
['-l, --long', _('Use long list format. Format is ID, NOTE_COUNT (for notebook), DATE, TODO_CHECKED (for to-dos), TITLE')],
];
}
async action(args) {

View File

@ -257,126 +257,185 @@ The following commands are available in [command-line mode](#command-line-mode):
value of [name]. If neither [name] nor [value] is provided, it will list
the current configuration.
-v, --verbose Also displays unset and hidden config variables.
-v, --verbose Also displays unset and hidden config variables.
--export Writes all settings to STDOUT as JSON including
secure variables.
--import Reads in JSON formatted settings from STDIN.
--import-file <file> Reads in settings from <file>. <file> must contain
valid JSON.
Possible keys/values:
locale Language.
Type: Enum.
Possible values: eu (Basque), ca (Catalan), hr_HR
(Croatian), cs_CZ (Czech), da_DK (Dansk), de_DE
(Deutsch), en_GB (English), es_ES (Español),
fr_FR (Français), gl_ES (Galician), it_IT
(Italiano), nl_NL (Nederlands), nl_BE
(Nederlands), nb_NO (Norwegian), pt_BR (Português
(Brasil)), ro (Română), sl_SI (Slovenian), sv
(Svenska), ru_RU (Русский), zh_CN (中文 (简体)),
zh_TW (中文 (繁體)), ja_JP (日本語), ko (한국말).
Default: "en_GB"
dateFormat Date format.
Type: Enum.
Possible values: DD/MM/YYYY (30/01/2017),
DD/MM/YY (30/01/17), MM/DD/YYYY (01/30/2017),
MM/DD/YY (01/30/17), YYYY-MM-DD (2017-01-30),
DD.MM.YYYY (30.01.2017), YYYY.MM.DD (2017.01.30).
Default: "DD/MM/YYYY"
timeFormat Time format.
Type: Enum.
Possible values: HH:mm (20:30), h:mm A (8:30 PM).
Default: "HH:mm"
uncompletedTodosOnTop Uncompleted to-dos on top.
Type: bool.
Default: true
showCompletedTodos Show completed to-dos.
Type: bool.
Default: true
notes.sortOrder.field Sort notes by.
Type: Enum.
Possible values: user_updated_time (Updated
date), user_created_time (Created date), title
(Title).
Default: "user_updated_time"
notes.sortOrder.reverse Reverse sort order.
Type: bool.
Default: true
trackLocation Save geo-location with notes.
Type: bool.
Default: true
sync.interval Synchronisation interval.
Type: Enum.
Possible values: 0 (Disabled), 300 (5 minutes),
600 (10 minutes), 1800 (30 minutes), 3600 (1
hour), 43200 (12 hours), 86400 (24 hours).
Default: 300
editor Text editor command.
The editor command (may include arguments) that
will be used to open a note. If none is provided
it will try to auto-detect the default editor.
Type: string.
sync.target Synchronisation target.
The target to synchronise to. Each sync target may
have additional parameters which are named as
`sync.NUM.NAME` (all documented below).
Type: Enum.
Possible values: 2 (File system), 3 (OneDrive), 4
(OneDrive Dev (For testing only)), 5 (Nextcloud),
6 (WebDAV), 7 (Dropbox).
Default: 7
sync.2.path Directory to synchronise with (absolute path).
The path to synchronise with when file system
synchronisation is enabled. See `sync.target`.
Type: string.
sync.5.path Nextcloud WebDAV URL.
Attention: If you change this location, make sure
you copy all your content to it before syncing,
otherwise all files will be removed! See the FAQ
for more details: https://joplinapp.org/faq/
Type: string.
sync.5.username Nextcloud username.
Type: string.
sync.5.password Nextcloud password.
Type: string.
sync.6.path WebDAV URL.
Attention: If you change this location, make sure
you copy all your content to it before syncing,
otherwise all files will be removed! See the FAQ
for more details: https://joplinapp.org/faq/
Type: string.
sync.6.username WebDAV username.
Type: string.
sync.6.password WebDAV password.
Type: string.
net.customCertificates Custom TLS certificates.
Comma-separated list of paths to directories to
load the certificates from, or path to individual
cert files. For example: /my/cert_dir,
/other/custom.pem. Note that if you make changes
to the TLS settings, you must save your changes
before clicking on "Check synchronisation
configuration".
Type: string.
net.ignoreTlsErrors Ignore TLS certificate errors.
Type: bool.
Default: false
sync.target Synchronisation target.
The target to synchonise to. Each sync
target may have additional parameters which
are named as `sync.NUM.NAME` (all
documented below).
Type: Enum.
Possible values: 2 (File system), 3
(OneDrive), 4 (OneDrive Dev (For testing
only)), 5 (Nextcloud), 6 (WebDAV), 7
(Dropbox).
Default: 7
sync.2.path Directory to synchronise with (absolute
path).
Attention: If you change this location,
make sure you copy all your content to it
before syncing, otherwise all files will be
removed! See the FAQ for more details:
https://joplinapp.org/faq/
Type: string.
sync.5.path Nextcloud WebDAV URL.
Attention: If you change this location,
make sure you copy all your content to it
before syncing, otherwise all files will be
removed! See the FAQ for more details:
https://joplinapp.org/faq/
Type: string.
sync.5.username Nextcloud username.
Type: string.
sync.5.password Nextcloud password.
Type: string.
sync.6.path WebDAV URL.
Attention: If you change this location,
make sure you copy all your content to it
before syncing, otherwise all files will be
removed! See the FAQ for more details:
https://joplinapp.org/faq/
Type: string.
sync.6.username WebDAV username.
Type: string.
sync.6.password WebDAV password.
Type: string.
sync.maxConcurrentConnections Max concurrent connections.
Type: int.
Default: 5
locale Language.
Type: Enum.
Possible values: ar (Arabic (92%)), eu
(Basque (39%)), bs_BA (Bosnian (85%)),
bg_BG (Bulgarian (77%)), ca (Catalan
(61%)), hr_HR (Croatian (32%)), cs_CZ
(Czech (94%)), da_DK (Dansk (85%)), de_DE
(Deutsch (100%)), et_EE (Eesti Keel (76%)),
en_GB (English (UK) (100%)), en_US (English
(US) (100%)), es_ES (Español (95%)), eo
(Esperanto (44%)), fr_FR (Français (95%)),
gl_ES (Galician (50%)), it_IT (Italiano
(97%)), nl_BE (Nederlands (39%)), nl_NL
(Nederlands (97%)), nb_NO (Norwegian
(89%)), fa (Persian (38%)), pl_PL (Polski
(75%)), pt_PT (Português (91%)), pt_BR
(Português (Brasil) (88%)), ro (Română
(39%)), sl_SI (Slovenian (49%)), sv
(Svenska (68%)), tr_TR (Türkçe (92%)),
el_GR (Ελληνικά (93%)), ru_RU (Русский
(95%)), sr_RS (српски језик (75%)), zh_CN
(中文 (简体) (97%)), zh_TW (中文 (繁體) (91%)),
ja_JP (日本語 (97%)), ko (한국말 (97%)).
Default: "en_GB"
dateFormat Date format.
Type: Enum.
Possible values: DD/MM/YYYY (30/01/2017),
DD/MM/YY (30/01/17), MM/DD/YYYY
(01/30/2017), MM/DD/YY (01/30/17),
YYYY-MM-DD (2017-01-30), DD.MM.YYYY
(30.01.2017), YYYY.MM.DD (2017.01.30).
Default: "DD/MM/YYYY"
timeFormat Time format.
Type: Enum.
Possible values: HH:mm (20:30), h:mm A
(8:30 PM).
Default: "HH:mm"
uncompletedTodosOnTop Uncompleted to-dos on top.
Type: bool.
Default: true
showCompletedTodos Show completed to-dos.
Type: bool.
Default: true
notes.sortOrder.field Sort notes by.
Type: Enum.
Possible values: user_updated_time (Updated
date), user_created_time (Created date),
title (Title).
Default: "user_updated_time"
notes.sortOrder.reverse Reverse sort order.
Type: bool.
Default: true
folders.sortOrder.field Sort notebooks by.
Type: Enum.
Possible values: title (Title),
last_note_user_updated_time (Updated date).
Default: "title"
folders.sortOrder.reverse Reverse sort order.
Type: bool.
Default: false
trackLocation Save geo-location with notes.
Type: bool.
Default: true
sync.interval Synchronisation interval.
Type: Enum.
Possible values: 0 (Disabled), 300 (5
minutes), 600 (10 minutes), 1800 (30
minutes), 3600 (1 hour), 43200 (12 hours),
86400 (24 hours).
Default: 300
editor Text editor command.
The editor command (may include arguments)
that will be used to open a note. If none
is provided it will try to auto-detect the
default editor.
Type: string.
net.customCertificates Custom TLS certificates.
Comma-separated list of paths to
directories to load the certificates from,
or path to individual cert files. For
example: /my/cert_dir, /other/custom.pem.
Note that if you make changes to the TLS
settings, you must save your changes before
clicking on "Check synchronisation
configuration".
Type: string.
net.ignoreTlsErrors Ignore TLS certificate errors.
Type: bool.
Default: false
sync.wipeOutFailSafe Fail-safe: Do not wipe out local data when
sync target is empty (often the result of a
misconfiguration or bug).
Type: bool.
Default: true
revisionService.enabled Enable note history.
Type: bool.
Default: true
revisionService.ttlDays Keep note history for.
Type: int.
Default: 90
cp <note> [notebook]
@ -390,13 +449,14 @@ The following commands are available in [command-line mode](#command-line-mode):
e2ee <command> [path]
Manages E2EE configuration. Commands are `enable`, `disable`, `decrypt`,
`status` and `target-status`.
`status`, `decrypt-file` and `target-status`.
-p, --password <password> Use this password as master password (For
security reasons, it is not recommended to use
this option).
-v, --verbose More verbose output for the `target-status`
command
-o, --output <directory> Output directory
edit <note>
@ -408,7 +468,9 @@ The following commands are available in [command-line mode](#command-line-mode):
complete database including notebooks, notes, tags and resources.
--format <format> Destination format: jex (Joplin Export File), raw
(Joplin Export Directory), md (Markdown)
(Joplin Export Directory), json (Json Export
Directory), md (Markdown), html (HTML File), html
(HTML Directory)
--note <note> Exports only the given note.
--notebook <notebook> Exports only the given notebook.
@ -424,9 +486,27 @@ The following commands are available in [command-line mode](#command-line-mode):
Imports data into Joplin.
--format <format> Source format: auto, jex, md, raw, enex
--format <format> Source format: auto, jex, md, raw, enex, enex
-f, --force Do not ask for confirmation.
ls [note-pattern]
Displays the notes in the current notebook. Use `ls /` to display the list
of notebooks.
-n, --limit <num> Displays only the first top <num> notes.
-s, --sort <field> Sorts the item by <field> (eg. title, updated_time,
created_time).
-r, --reverse Reverses the sorting order.
-t, --type <type> Displays only the items of the specific type(s).
Can be `n` for notes, `t` for to-dos, or `nt` for
notes and to-dos (eg. `-tt` would display only the
to-dos, while `-ttd` would display notes and
to-dos.
-f, --format <format> Either "text" or "json"
-l, --long Use long list format. Format is ID, NOTE_COUNT (for
notebook), DATE, TODO_CHECKED (for to-dos), TITLE
mkbook <new-notebook>
Creates a new notebook.
@ -459,6 +539,15 @@ The following commands are available in [command-line mode](#command-line-mode):
-f, --force Deletes the notes without asking for confirmation.
server <command>
Start, stop or check the API server. To specify on which port it should
run, set the api.port config variable. Commands are (start|stop|status).
This is an experimental feature - use at your own risks! It is recommended
that the server runs off its own separate profile so that no two CLI
instances access that profile at the same time. Use --profile to specify
the profile path.
set <note> <name> [value]
Sets the property <name> of the given <note> to the given [value].
@ -470,7 +559,7 @@ The following commands are available in [command-line mode](#command-line-mode):
(int), todo_due (int), todo_completed (int), source (text),
source_application (text), application_data (text), order (int),
user_created_time (int), user_updated_time (int), encryption_cipher_text
(text), encryption_applied (int)
(text), encryption_applied (int), markup_language (int), is_shared (int)
status
@ -485,9 +574,10 @@ The following commands are available in [command-line mode](#command-line-mode):
tag <tag-command> [tag] [note]
<tag-command> can be "add", "remove" or "list" to assign or remove [tag]
from [note], or to list the notes associated with [tag]. The command `tag
list` can be used to list all the tags (use -l for long option).
<tag-command> can be "add", "remove", "list", or "notetags" to assign or
remove [tag] from [note], to list notes associated with [tag], or to list
tags associated with [note]. The command `tag list` can be used to list
all the tags (use -l for long option).
-l, --long Use long list format. Format is ID, NOTE_COUNT (for notebook),
DATE, TODO_CHECKED (for to-dos), TITLE