Viewert CLI
Sign in, sync Vellums to and from plain Markdown, read and write them from a script, and connect Claude, Cursor, VS Code and other AI tools to your Viewert with one command.
The Viewert CLI is a standalone command-line tool for working with your Vellums outside the browser. Pull a Vellum down as a Markdown file, edit it in your favorite editor, push it back — or keep a whole folder in sync automatically. It also runs an MCP server, so any MCP-compatible AI tool can read your Librams and read and write your Vellums, authenticated as you, and viewert mcp install connects your AI tools for you. Every command can answer in JSON, so scripts and AI agents can use it too.
viewert sync keeps a folder of plain Markdown files that match your Vellums, in a folder you can put under git. Give an AI your knowledge: viewert mcp install connects Claude, Cursor, VS Code, Windsurf, Gemini CLI and Codex, and --read-only lets them read everything and change nothing. Script it: every command can answer in JSON with stable exit statuses, so a shell script, a CI job or an AI agent can list, create, search and update Vellums without a person at the keyboard.The easiest path on macOS or Linux is Homebrew. Installing gives you two identical binaries — viewert and the shorter v — so every command below works with either name.
brew tap viewert/viewert
brew install viewertAlready have Node.js? Install from npm on macOS, Linux or Windows, or try it once with npx and nothing stays installed. The package carries no install scripts: npm downloads the prebuilt program for your computer from the npm registry and checks it against its published integrity hash, the same as any package.
npm install -g @viewert/cli
# or run it once, without installing
npx @viewert/cli loginOne line for macOS and Linux without Homebrew. The script downloads the release for your computer, checks it against the published SHA-256 checksums, and refuses to install if they do not match. It installs into ~/.local/bin (or the folder you give it) and never needs sudo. Read it first if you like: it is the file at the address below.
curl -fsSL https://viewert.com/install.sh | sh
# or into a folder of your choice, or a specific version
curl -fsSL https://viewert.com/install.sh | VIEWERT_INSTALL_DIR=/usr/local/bin VIEWERT_VERSION=0.2.0 shbrew trust viewert/viewert
brew install viewertbrew uninstall viewert first so the old copy does not stay ahead of the new one on your PATH.Prefer your distro's package manager over Homebrew? Every release also publishes .deb and .rpm packages for amd64 and arm64. Grab the one matching your distro from the GitHub Releases page and install it directly.
# Debian/Ubuntu
sudo dpkg -i viewert_<version>_linux_amd64.deb
# Fedora/RHEL
sudo rpm -i viewert_<version>_linux_amd64.rpmnpm install -g @viewert/cli is the easiest way and puts viewert (and v) on your PATH. There's no winget/Chocolatey/Scoop manifest yet. Without Node.js, download the Windows .zip from the GitHub Releases page, extract it, and either run the binary with its full path or add the extracted folder to your PATH so viewert (and v) work from any terminal.Log in once per machine. No password ever touches the CLI — it uses the same OAuth device flow as connecting a third-party AI client.
Run the login command
v login A short code and a URL are printed to your terminal.
Approve in your browser
Open the URL, enter the code if prompted, and approve the request with your Viewert account.
You're in
The CLI keeps your session in your OS keyring — macOS Keychain, Linux libsecret, or Windows Credential Manager. On a computer with no keyring (a server, a container) it tells you so and keeps it in a file only you can read, and refuses to use that file if other users could read it. It renews itself, so you will not need to log in again on this machine.
v me (aliases v user and v whoami) is your identity check — analogous to gh auth status. It shows who you're logged in as, where the login is kept, and what it is allowed to do. v doctor goes further and checks the whole setup: the CLI version, whether the API answers, your login, and which AI tools are connected, with the fix for anything that is wrong.
v me
Shows the logged-in username, where the login is kept, its permissions and when the session ends. v user and v whoami are identical aliases.
v login --read-only
Asks only for permission to read: a login that can look at everything and change nothing. The right one for an AI agent that only needs to know things. Add --no-browser over SSH to get the link to open on another machine.
v doctor
Checks the setup and says what to do about anything wrong. It exits with status 1 if a check fails, so a script can use it.
v logout
Removes your stored credentials from this machine's keyring.
v status is the git-status equivalent for a folder of Vellum Markdown files — purely local, no network call, so it's always fast and works offline. It recursively scans a folder (current directory by default) for *.md files and buckets each one into untracked, modified locally since the last push/sync, or up to date, based only on the file itself plus the local .viewert-sync.json state.
v status
v status ~/my-vellumsviewert sync --dry-run when you need that: it checks both sides, at the cost of a round-trip to the API. Reach for status for a fast, offline sanity check; reach for sync --dry-run when you need the full picture.Browse your library and bring individual Vellums down to disk as Markdown, with a YAML frontmatter block carrying the tracking ID and title.
v ls
Lists your Vellums with their ID, title, and last-updated date. Add --libram <id> to filter to a single Libram, or --tag <tag> (repeatable) to filter by tag.
v pull <vellum-id>
Downloads a single Vellum as a Markdown file named after its title (or pass --output/-o to choose the path). The file's frontmatter v_id is what push and sync use to know which Vellum a file corresponds to.
v pull <filename>
The argument can also be a local file you already pulled — pass it back in and pull re-reads that file's own v_id and refreshes it in place from the server, overwriting the same path (unless --output says otherwise). No need to remember the ID once you have the file.
Rather than pulling one Vellum at a time, pull every Vellum matching a tag straight into a folder — handy for bringing a whole tagged collection onto disk at once.
viewert pull --tag project:skills -o ~/my-vellums
# require ALL tags, not just any
viewert pull --tag skills --tag adam --match-all -o ~/my-vellums
# preview first, write nothing
viewert pull --tag skills --dry-runPush a single Markdown file, or point push at a whole folder to recursively push every *.md file found in it — --tag is always required. Most files in an existing notes/skills repo won't have Viewert's own frontmatter (or will carry foreign frontmatter from another tool entirely), so the tag is the explicit signal that a file belongs in Viewert rather than push guessing from its shape.
viewert push notes.md --tag project:skills
viewert push . --tag project:skills
viewert push ~/repos/my-skills --tag skills --tag adamThe argument can also be a bare v_id instead of a path — push resolves it by recursively searching the current directory (or --dir/-C, if you're not standing in the right folder) for the one local *.md file whose frontmatter v_id matches, then pushes that file. Useful when you know which Vellum you want to update but don't remember which file tracks it. Fails clearly if zero or more than one local file matches, rather than guessing.
viewert push 01JABCXYZ... --tag project:skills
viewert push 01JABCXYZ... --tag project:skills --dir ~/repos/my-skillsA file with a v_id already in its frontmatter is updated in place; everything else is created as a new Vellum, with v_id written back into the file afterward. Title comes from frontmatter if present, otherwise the first "# Heading" line in the file, otherwise the filename. Tags are merged with whatever a Vellum already has (up to the account limit of 4) — pushing never silently drops existing tags. Directories named .git, node_modules, vendor, or starting with a dot are skipped during a folder push.
Files from other tools — Obsidian aliases/tags, Jekyll layout/date, anything else — keep their existing frontmatter fields when Viewert writes v_id, slug, title, tagline, and updated_at into the file. A bare id: field from before this change is still honored as the tracking ID, but only when it's shaped like a real Viewert ID; a foreign id: field from another tool is left alone untouched.
---
v_id: 01JABCXYZ...
title: Backend Architecture Notes
tags: [architecture, backend]
aliases: [DB Notes]
---
## Database schema
Everything lives in Postgres...A Vellum's real content is TipTap/ProseMirror JSON — Markdown can't represent everything in it (video embeds, custom image sizing, math, underline). Because push always sends plain Markdown, overwriting an existing Vellum that has any of that risks losing it permanently. Before that happens, push and sync fetch a fidelity report for the Vellum you're about to overwrite and, if anything would be lost, print exactly what and ask before proceeding.
$ viewert push notes.md --tag project:skills
⚠ notes.md would lose:
- 1 video embed (becomes a plain link)
Overwrite anyway? [y/N] n
Skipped notes.md (fidelity check declined)viewert push notes.md --tag project:skills --force
viewert sync ~/my-vellums --forceFor a whole folder of Vellums, sync keeps everything up to date in both directions — pulling remote changes down and pushing local edits up, matched by each file's frontmatter v_id. The folder argument is optional and defaults to the current directory, same as v status.
v sync # sync the current directory, both directions
v sync ~/my-vellums # sync once, both directions
v sync ~/my-vellums --watch # keep syncing as you edit locally
v sync ~/my-vellums --direction pull # pull only
v sync ~/my-vellums --dry-run # preview without writing anythingOne command adds Viewert to the settings of the AI tools on your computer — Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, Gemini CLI and Codex — so they can start the Viewert server themselves. It writes only the command that starts the server, never a token: the server uses the login you made with v login. Every file it changes is backed up first, a settings file it cannot fully understand is left alone (the lines to add by hand are printed), and running it twice changes nothing.
viewert mcp install # every supported tool found on this computer
viewert mcp install cursor vscode # only these
viewert mcp install --dry-run # show what would change, change nothing
viewert mcp install --print codex # the settings to add by hand
viewert mcp status # what is connected
viewert mcp uninstallviewert mcp install --read-onlyOnce connected, your AI has these tools. The Libram and Graph tools are Viewert’s own, so whatever Viewert adds appears without updating the CLI.
list_librams, get_libram_context
See your Librams and read the context an AI should know. Also search_context, get_context_budget and the compaction tools.
search_vellums, list_vellums
Find notes by title, tag or text, newest first, with paging.
get_vellum
Read a Vellum as Markdown, with its version. The text comes back between markers that say it is your data, not instructions for the AI.
create_vellum
Create a Vellum. It is always private: publishing is something only you do, in Viewert.
update_vellum
Replace a Vellum’s text. It needs the version the AI read, so a newer edit of yours is never overwritten; and it refuses, until you agree, to save Markdown over formatting Markdown cannot keep.
list_graphs, validate_graph, create_graph
Draw your systems as a Graph. Graphs are always created private and a document that looks like it contains credentials is refused.
{
"mcpServers": {
"viewert": {
"command": "/opt/homebrew/bin/viewert",
"args": ["mcp"]
}
}
}Add --json to any command and its answer is exactly one JSON document on standard output; everything said about it (progress, warnings) goes to standard error, so a pipe never gets mixed text. Errors become a JSON document too, with a stable code, a hint and the request ID. --quiet prints only the answer, --yes answers confirmations, --no-input never asks, and when there is no terminal nothing is ever asked: a command that needs a yes stops with exit status 8 instead of guessing. v agents prints a short guide you can add to AGENTS.md or CLAUDE.md so your coding agent knows all this.
viewert ls --json --search roadmap
echo "Meeting notes…" | viewert new "Standup" --tag work --json
viewert agents >> AGENTS.mdA script can tell what went wrong from the exit status alone.
0
It worked.
2
A wrong flag or argument.
3
Not logged in, or the session ended: run v login.
4
Logged in but not allowed: a missing permission or a plan limit.
5
Not found (or not yours: Viewert does not say which).
6
A conflict: it changed meanwhile.
7
Unavailable or rate limited, after retrying.
8
It needed a confirmation and could not ask: add --yes.
Beyond ls, pull, push and sync, a handful of commands cover everyday work without opening a browser:
v cat <id>
Prints a Vellum as Markdown and nothing else, to pipe anywhere. --json adds its title, tags and version.
v new [title]
Creates a private Vellum from --content, --file or a pipe, with up to four --tag.
v edit <id>
Opens the Vellum in $EDITOR and saves it back. If it changed while you edited, nothing is overwritten and your text is kept in a file.
v search <words>
Searches titles and tags (yours and public ones); --mine for your own.
v rm <id>… / v restore <id>…
Moves Vellums to the trash and brings them back. Nothing is ever deleted for good from the command line.
v tag <id> --add x --remove y
Shows or changes tags without dropping the others. v tags lists the most used.
v history <id> / v revert <id> <version>
Lists saved versions and puts one back (the current text is kept as a version too). Version history is part of some plans.
v libram ls / show / context / add / remove
Your Librams, and the exact Markdown an AI would receive from one.
v graph ls / show / export
Your Graphs; export saves the VGF JSON.
v open <id>
Opens a Vellum (or libram, graph) in your browser.
v api /api/…
Calls any endpoint with your login. It only ever talks to the API host, and asks before anything that changes data.
v login needs a browser and a human to approve the device-flow prompt — not something a CI runner can do. For scripts, GitHub Actions, cron jobs, or any other non-interactive context, set VIEWERT_TOKEN to an API key instead. When it's set, every command uses it directly and skips login/keyring entirely — no browser, no human, no session to refresh.
export VIEWERT_TOKEN=vwt_your_api_key_here
viewert ls --tag project:skillsStore the key as a repository secret, then reference it as an environment variable in the workflow step that runs the CLI:
- name: Sync Vellums
env:
VIEWERT_TOKEN: ${{ secrets.VIEWERT_TOKEN }}
run: |
viewert push ./docs --tag ci-syncedThis isn't just convenience — v login normally stores credentials in an OS keyring (macOS Keychain, Windows Credential Manager, or libsecret on Linux), and most headless CI containers don't run a libsecret daemon at all. Where there is none, v login falls back to a file only you can read — fine on a server you log in to, but a CI job should not need a human to approve a browser prompt. VIEWERT_TOKEN sidesteps all of it, so it works the same in every container regardless of what's installed.
viewert graph map aws --region us-east-1 --dry-run # see every command first
viewert graph map aws --region us-east-1 --open
viewert graph map gcp --project my-project-id --open
viewert graph map azure --open
viewert graph export 01JABC… --format inventoryv upgrade checks for a newer release and prints the command that upgrades the way you installed (brew upgrade viewert, npm install -g @viewert/cli@latest, or the install script again). Once a day, at a terminal, the CLI also tells you when a newer version is out (never in scripts, with --json, or with --quiet; turn it off with VIEWERT_NO_UPDATE_CHECK=1). Tab completion for bash, zsh, fish and PowerShell comes from v completion <shell>. Every release on GitHub comes with SHA-256 checksums and a software bill of materials for each download.
viewert upgrade
viewert completion zsh > "${fpath[1]}/_viewert"Settings live at ~/.config/viewert/config.json (created automatically on first login). To point the CLI at a different backend — a self-hosted or staging instance — override the API base for a single command with --api, or persistently with the VIEWERT_API environment variable. For authentication, VIEWERT_TOKEN (an API key) always takes priority over any keyring-stored login, on every command, for as long as it's set in the shell.
v and viewert are installed and are identical binaries — use whichever you prefer, every command works with either. v is faster to type; viewert reads more clearly in scripts.