Help CenterHow to use the Papermark CLI?

How to use the Papermark CLI?

The Papermark CLI is a single binary that runs every API operation from your terminal. Use it to log in once, upload entire folders into a data room, mint links from a script, or wire Papermark into a CI pipeline. Every command supports --json output for clean machine parsing.

The Papermark CLI is available on the Business plan and above. Self-hosted Papermark instances can use the CLI on any plan.

Step 1: Install the CLI

The CLI is published to npm. You need Node.js 18 or newer.

npm install -g papermark

Verify the install:

papermark --version

Step 2: Log in

The CLI supports two login flows.

papermark login

The CLI prints a URL and a short code. Open the URL, paste the code, and approve the login in the browser. The token is stored at ~/.config/papermark/auth.json.

Long-lived token

If you're scripting Papermark in CI or want a long-lived credential, generate a token in Settings, API Tokens and pass it directly:

papermark login --token pm_live_AbCdEfGhIjKlMnOpQrStUvWxYz

Or set it as an environment variable:

export PAPERMARK_TOKEN=pm_live_...

Check who you're signed in as

papermark whoami

Returns your email, team, and active token scopes.

Common commands

List data rooms and documents

papermark datarooms list --json
papermark documents list --json
papermark documents list --dataroom dr_3qpL

Upload a single file

papermark documents upload ./pitch.pdf

Output:

▸ uploading pitch.pdf (2.1 MB) ok
✓ doc_pitch_v5 created

Upload a whole folder into a data room

papermark documents upload ./diligence/ \
--dataroom dr_3qpL --recursive

The CLI scans the folder, queues every supported file type, and shows progress per file. Folder hierarchy is preserved inside the data room.

Create a data room

papermark datarooms create --name "Series B" --json
papermark links create --dataroom dr_8K2m \
--password series-b-2026 \
--expires-at 2026-06-10T00:00:00Z \
--json

Pull view analytics

papermark views list --link lk_8K2m --json
papermark views get vw_3m9k --json

JSON output for pipelines

Every command supports --json. Pipe to jq for further processing:

papermark documents list --json | jq '.[] | select(.name | test("Pitch"))'

Or feed the output into another script:

DR_ID=$(papermark datarooms create --name "Q4 Update" --json | jq -r '.id')
papermark documents upload ./reports/q4/ --dataroom $DR_ID --recursive
papermark links create --dataroom $DR_ID --json | jq -r '.url'

CI-friendly by design

The CLI:

  • Returns non-zero exit codes on failure
  • Emits machine-readable error codes in JSON mode
  • Works with PAPERMARK_TOKEN from environment so you can store the token in your CI secrets manager
  • Streams progress to stderr and JSON results to stdout, so you can capture results without losing logs

Example GitHub Actions step

- name: Upload board pack to Papermark
env:
PAPERMARK_TOKEN: ${{ secrets.PAPERMARK_TOKEN }}
run: |
papermark documents upload ./board-pack/ \
--dataroom ${{ vars.BOARD_DATAROOM_ID }} \
--recursive --json

Use cases

  • Board pack publishing: a CI job uploads a folder to a board data room every Monday morning.
  • Investor outreach: a script iterates a list of investors, creates a link per investor, and writes the URLs into a CSV.
  • Local backups: a nightly cron pulls a list of documents and view analytics into your data warehouse.
  • Data room provisioning: spin up a templated data room for every new deal with one command.

Frequently asked questions

Need help? Contact support@papermark.com or use the in-app chat.

More helpful articles