a command-line interface for Standard Notes.
- fix command completion and update instructions
- add
task
command for management of Checklists and Advanced Checklists
- bug fixes and sync speed increases
- various output improvements, including stats
- bug fixes and item schema tests
- stored sessions are now auto-renewed when expired, or nearing expiry
- various release packaging updates - thanks: @clayrosenthal
COMMANDS:
add add items
delete delete items
edit edit notes
tag tag items
task manage checklists and tasks
session store session to
register register an account
resync delete and repopulate cache
get get item data
stats show statistics
wipe deletes all tags and notes
test-data create test data (hidden option)
note: export and import currently disabled due to recent StandardNotes API changes
Download the latest release here: https://github.com/jonhadfield/sn-cli/releases
Install:
$ install <sn-cli binary> /usr/local/bin/sn
An installer is planned, but for now... Download the binary 'sncli_windows_amd64.exe' and rename to sn.exe
To see commands and options:
$ sn --help
By default, your credentials will be requested every time, but you can store them using either environment variables or, on MacOS and Linux, store your session using the native Keychain application.
Note: if using 2FA, the token value will be requested each time
export SN_EMAIL=<email address>
export SN_PASSWORD=<password>
export SN_SERVER=<https://myserver.example.com> # optional, if running personal server
Using a session is different from storing credentials as you no longer need to authenticate. As a result, if using 2FA (Two Factor Authentication), you won't need to enter your token value each time.
sn session --add # session will be stored after successful authentication
To encrypt your session when adding:
sn session --add --session-key # either enter key as part of command, or '.' to hide its input
Prefix any command with --use-session
to automatically retrieve and use the session.
If your session is encrypted, you will be prompted for the session key. To specify the key on the command line:
sn --use-session --session-key <key> <command>
To use your session automatically, set the environment variable SN_USE_SESSION
to true
- accounts registered via sn-cli are initialised without initial encryption key(s). The workaround is to log in via the offical web/desktop app, to create these keys, after initial registration.
the bash completion tool should be installed by default on most Linux installations.
To install on macOS (Homebrew)
$ brew install bash_completion
then add the following to ~/.bash_profile:
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion
installing completion script (found here)
$ cp bash_autocomplete /usr/local/etc/bash_completion.d/sn
$ echo "source /usr/local/etc/bash_completion.d/sn" | tee -a ~/.bashrc
$ cp bash_autocomplete /etc/bash_completion.d/sn
$ echo "source /etc/bash_completion.d/sn" | tee -a ~/.bashrc
$ sn <tab>