papermark
v0.2.0
Published
Command-line interface for Papermark — share documents, create data rooms, generate access links, and read analytics.
Maintainers
Readme
papermark
Command-line interface for Papermark.
Upload documents, create share links, manage datarooms, and read analytics
from your terminal. Built to be scriptable and agent-friendly — every
command supports --json, and the output contract is pinned at
docs/CONTRACT_V1.md.
Install
npm install -g papermarkQuick start
papermark login # OAuth 2.1 device flow in your browser
papermark documents list
papermark documents upload ./deck.pdf --link
papermark links create --document <id> --name "Acme Pitch" --password <pw>
papermark views list --link <link-id>Authentication
Four ways to authenticate, highest precedence first:
PAPERMARK_TOKENenv varPAPERMARK_CREDENTIALS_FILE— path to a JSON file with{token, apiUrl}papermark auth set --stdin— pipe a token over stdin (CI-friendly; no tempfile, no shell-history leak)- Stored config (
papermark login, orpapermark login --token pm_live_...)
Scopes supported: documents.{read,write}, links.{read,write},
datarooms.{read,write}, analytics.read, visitors.read.
Tokens expire after 90 days (Stripe-CLI pattern); re-login when prompted.
Commands
papermark login Sign in via OAuth device flow
papermark logout Remove the stored token
papermark whoami Show the active token + API URL + source
papermark doctor Scriptable preflight health check
papermark auth export [--unmasked] Print credentials as JSON (for CI)
papermark auth set --stdin [--json] Read credentials from stdin
papermark documents list List documents
papermark documents get <id> Fetch a single document
papermark documents upload <file> Upload a local file
papermark documents delete <id> Delete a document
papermark documents search <query> Search documents by name
papermark links list List share links
papermark links create --document <id> Create a share link
papermark links delete <id> Revoke a share link
papermark views list --link <link-id> List views for a link
papermark config set <key> <value> Change stored settings (api-url, …)
papermark config get [key] Read stored settingsGlobal flags
--json— emit machine-readable JSON (auto-enabled when stdout is piped)--dry-run— print the HTTP request that would be sent and exit (token redacted)--no-color— disable ANSI color (same asNO_COLOR=1)
Configuration
PAPERMARK_API_URL— defaults tohttps://api.papermark.comPAPERMARK_TOKEN— if set, bypassespapermark loginPAPERMARK_CREDENTIALS_FILE— path to a{token, apiUrl}JSON filePAPERMARK_DEBUG=1— log every outbound HTTP request to stderr
Exit codes
0 success · 1 api error · 2 auth error · 3 validation error ·
4 network error · 5 internal CLI bug. Full contract in
docs/CONTRACT_V1.md.
License
MIT
