Skip to content

CLI Documentation

The Papra CLI is a command-line interface tool that helps you interact with the Papra platform from your terminal.

For the moment, the CLI is only available as an NPM package.

Terminal window
# using pnpm
pnpm i -g @papra/cli
# or using npm
npm i -g @papra/cli
# or using yarn
yarn add -g @papra/cli

The CLI will be installed globally, so you can use it from anywhere in your system with the papra command.

Before using the CLI, you need to configure it with your API credentials.

To initialize the configuration, run:

Terminal window
papra config init

This command will prompt you for:

  • Instance URL: Your Papra instance URL (e.g., https://api.papra.app)
  • API Key: Your personal API key (can be created in your User Settings)

You can manage your configuration using the following commands:

  • papra config list: View your current configuration
  • papra config set api-key: Set or update your API key
  • papra config set api-url: Set or update your instance URL
  • papra config set default-org-id: Set a default organization ID

Since Papra supports multiple organizations, you may need to specify the organization ID when importing documents for example. If want, you can set a default organization ID in your configuration.

Terminal window
papra config set default-org-id <organization-id>
papra documents import <file-path>
# or
papra documents import -o <organization-id> <file-path>

The import command allows you to import a document into your Papra organization.

Terminal window
papra documents import -o <organization-id> <file-path>

For more information about any command, you can use the --help flag:

Terminal window
papra --help
papra config --help
papra documents --help

The CLI is built using the citty framework and the Papra TS SDK.