Documentation

Tovriq CLI

Sync a vault with a folder from the terminal on macOS, Windows or Linux, push from CI, and search the vault.

The Tovriq CLI syncs a vault with a folder on any computer, from the terminal: the same two-way sync as linking a folder in the browser, without keeping a tab open. It also searches the vault and works in CI. It is open source (Apache-2.0) and needs Node.js 22 or later.

Install and log in

npm install -g @tovriq/cli
tovriq login

Open a vault, go to Agents & MCP and click Create CLI key, then paste the key when tovriq login asks for it. Keys start with tvq_, are shown once, and work for one vault. The CLI stores the key in ~/.config/tovriq/credentials.json, a file only your user account can read; it never prints a key in full. On a self-hosted server, add --server https://your-server to tovriq login.

Sync a folder

cd ~/notes
tovriq link
tovriq sync

tovriq link links the folder to the vault and shows what the first sync would do. The first tovriq sync shows the same plan (files to download, upload, keep as conflict copies or leave on disk) and waits for your OK; --yes skips the question. After that, run tovriq sync whenever you want both sides up to date.

  • tovriq pull only brings the vault's changes to the folder; tovriq push only sends the folder's changes to the vault.
  • --dry-run shows the plan without changing anything.
  • A file changed on both sides is never overwritten: sync and pull write the vault's version and keep yours next to it as Name (conflict YYYY-MM-DD).md; push leaves it unpushed and tells you to run tovriq sync.
  • The browser and the CLI can take turns on the same folder. They share the folder's sync state, so neither re-uploads what the other synced, and two syncs never run at once.
  • A folder you already linked in the browser: open the vault page once before the first tovriq sync, so the browser writes the folder's sync state for the CLI.

Pulling and searching work on every plan. Pushing needs an owner or admin key with full access on a plan that lets agents write (Pro, an active Import Pack month, or Team); with another key, tovriq sync only pulls and says why.

Search and status

tovriq search "pricing decisions"
tovriq status

tovriq search ranks the vault's files like the MCP search tool and prints the best-matching section of each. tovriq status shows the vault, the key's role and access, whether it can push, the folder's last sync and what a sync would change now. It names the key it used even when the server refuses it: a key you revoked in the Agents & MCP tab shows as stored — refused by server. Add --json to any command for machine-readable output.

In CI

Store the key as the TOVRIQ_TOKEN secret (it replaces tovriq login), then run tovriq link and tovriq push --yes --json in your workflow. Cache the folder's .tovriq directory between runs: without it, every run is a first sync and files that differ from the vault are left unpushed.

What stays on your computer

  • Secrets. The CLI runs the same secret scrubber as the browser before anything is uploaded: API keys, passwords, card numbers and government ID numbers stay in your files and the vault stores placeholders. The .tovriq-key file in the folder makes each secret get the same placeholder everywhere; keep it, and never commit it.
  • Sync state. The .tovriq folder holds which version of each file was last synced, a short-lived lock and a .gitignore that keeps it out of git. It is never uploaded.
  • Your key stays in the credentials file. tovriq logout removes it from this computer; revoke it in the Agents & MCP tab to stop it everywhere.

Every call the CLI makes appears in the vault's Activity log as "Command line".

Exit codes and errors

CodeMeaning
0Done
1Failed (the message says why)
2Wrong command or option
3Finished, but some files were kept as conflict copies or left unpushed
4Not logged in, folder not linked, or the key was refused

A passphrase-locked vault refuses the CLI until you unlock it on the vault page. "Another sync of this folder is running" means the browser or another CLI is syncing it; try again when it is done.

Still stuck? Contact support and we will help.