Skip to content

Your research,
from the command line.

Find documents, revise drafts, and format references from your terminal. Bring the same work into your scripts with structured JSON results.

Find

A command away

Search your workspace and read a saved draft with its sources, right from your terminal.

Script

Built for your workflow

Use structured results in scripts, with clear errors and predictable exit codes.

Export

Take your work further

Export document text or a bibliography for the next step in your research.

Download CLISetup docs
npm install --global ./citation-cli-0.1.0.tgz
citation --help
citation --version

Use Node.js 22 or later and npm. Download version 0.1.0, then run Install from the package folder. Connect with a scoped token from MCP connections.

Agents that can run terminal commands can use the CLI, including Kimi, Codex, Claude Code, Cursor, GitHub Copilot. In Kimi, use Kimi Code or a Work environment with terminal access.

From your terminal
to your workspace.

  1. Choose your workspace

    Create a token for the workspace and permissions you need.

  2. Keep your token private

    Pass your token through a secret manager or private input.

  3. Check your connection

    Check your workspace and permissions before making changes.

Commands for
your saved work.

Find your work

Search documents and read saved drafts with their sources.

documents listdocuments readsources list

Write and revise

Create a draft or save an edit with version checks and request IDs.

documents createdocuments update

Format and check

Save source details, format references and inspect citation links.

sources addreferences formatcitations check

Take the result with you

Export saved text as TXT or references as BibTeX and RIS.

documents export
citation documents list --query "research" --all --json
citation documents read DOCUMENT_ID --content --all --json
citation sources list DOCUMENT_ID --all --json

Good questions.
Straight answers.

How do I preserve formatting when editing?

Read the current version before updating a document. Use editor JSON to preserve formatting and citation nodes. Plain text intentionally replaces rich content. Updates require the version you read.

What happens if a save is interrupted?

Every save returns its request ID, including errors after connection attempts. Retry an uncertain save with the same ID and input. The CLI does not retry writes automatically.

How does the CLI behave in scripts?

Results go to standard output. Errors go to standard error with a nonzero exit code. Exports check every chunk and refuse to overwrite an existing file.

How do I remove access?

Run citation auth logout to remove the saved token from this computer. Revoke the personal token in Citation settings to end server access, and separately clear any token still present in your environment.

What do I need to install the CLI?

Use Node.js 22 or later and npm. Download the Citation CLI package, then run the install command from the folder containing it.

Is the CLI published on npm?

The download is a local package. Install the downloaded archive using the command above. Installation also downloads its pinned MCP client dependency.

How does the CLI authenticate?

Create a scoped personal token in MCP connections. Provide it through CITATION_TOKEN or private standard input, then use citation auth login to save it locally.

Can I use credentials without saving them locally?

Yes. Set CITATION_ENDPOINT and CITATION_TOKEN for the process without running login. This is useful when your script receives credentials from a secret manager.

Can I use a different workspace?

Each token authorizes one workspace. Use a token for the workspace you need, then verify it with citation workspace use WORKSPACE_ID.

Which files can I export?

Export document text as TXT and bibliographies as BibTeX or RIS. The CLI writes the requested file only after checking all export chunks and does not overwrite an existing file.