The CLI stopped working

Last updated

Most CLI problems are one of four things. What the command prints tells you which.

”CLI access is turned off for this account”

CLI access is a setting on your account and it is off by default. Open Notate, go to Settings, Features, CLI, and switch on Enable CLI access.

It applies to every machine at once, so switching it off is a quick way to stop a script you are unsure about.

A scheduled job silently stopped

Your CLI session lasts seven days from its last use, and each command resets the clock. A job that runs daily or weekly stays signed in indefinitely. One that runs monthly, or that paused for a fortnight, finds itself signed out.

Run notate login again to restore it. If the job runs less often than weekly, have it run something cheap like notate whoami on a schedule in between, so the session never lapses.

”Not logged in” straight after logging in

Usually a machine with no desktop keychain, such as a server or a container. The CLI stores your credentials in the operating system keychain and falls back to a permission-restricted file when there is not one, but on some headless systems the keychain looks available and then fails.

Force the file store:

export NOTATE_CLI_STORE=file
notate login

The file is written with owner-only permissions. Set the variable for the job as well as for your own shell, or the job will not find the session you created.

AI commands and search do not work

If your account has end-to-end encryption on, the server cannot read your notes, so anything that needs to read them on the server is unavailable: AI commands and search.

Everything else works normally. The CLI encrypts and decrypts on your own machine, so creating, reading, editing, and organizing notes are unaffected. See end-to-end encryption.

Nothing runs at all

The CLI needs Node.js 20 or newer. Check with node --version, and reinstall with npm install -g @notatemd/cli if you upgraded Node since installing it.