Skip to main content

copera-cli

Official CLI for the Copera Public API
copera is the official command-line interface for Copera. Manage boards, tables, rows, docs, drive files, and messaging from your terminal — or integrate it into LLM agent pipelines.

Installation

curl -fsSL https://cli.copera.ai/install.sh | bash
Or with a specific version:
VERSION=0.1.0 curl -fsSL https://cli.copera.ai/install.sh | bash

Update

copera update
copera update --version 1.2.0  # pin to a specific version
copera update --force           # skip confirmation

Quick Start

# First time: set up auth
copera auth login

# Or use an environment variable (recommended for CI/CD and agents)
export COPERA_CLI_AUTH_TOKEN="your_api_token"

# List your boards
copera boards list

# Browse your docs
copera docs tree

# Browse your drive
copera drive tree

Authentication

The CLI resolves your API token in this order (highest priority first):
SourceExample
Environment variableCOPERA_CLI_AUTH_TOKEN=cp_pat_xxx
--token flagcopera boards list --token cp_pat_xxx
.copera.local.toml (current dir, git-ignored)Project-local token
.copera.toml (current dir)Committed project config
~/.copera.tomlHome directory fallback
Token types:
  • Personal Access Token (cp_pat_...) — required for docs and drive commands, works for everything
  • Integration API Key (cp_key_...) — for boards and channels only
Get a token at Authentication.
copera auth login              # Interactive auth setup
copera auth status             # Show current token and source
copera auth logout             # Remove stored credential

Configuration

Profiles group a token and default resource IDs together. Create ~/.copera.toml:
# Set the default profile
default_profile = "work"

[profiles.default]
token      = "cp_pat_abc123..."
board_id   = "66abc123def456789012abcd"

[profiles.work]
token      = "cp_key_xyz789..."
board_id   = "66ghi789jkl012345678mnop"
table_id   = "66pqr012stu345678901vwxy"

[output]
format = "auto"   # auto | json | table | plain

[cache]
ttl = "1h"
Switch profiles with --profile or COPERA_PROFILE:
copera boards list                        # uses default_profile
copera boards list --profile work         # uses [profiles.work]
COPERA_PROFILE=work copera boards list    # same, via env var
For project-level shared defaults (no tokens — safe to commit), create a .copera.toml in your project root. For project-local token overrides, use .copera.local.toml and add it to .gitignore.

Machine-Readable Output

The CLI is designed to work with LLM agents and scripts:
  • Auto-JSON when piped: When stdout is not a TTY, output defaults to JSON.
  • --json flag: Forces JSON output regardless of TTY.
  • --output flag: auto | json | table | plain
  • --quiet / -q: Suppress informational messages; only emit result data.
  • Stdin support: Pipe content directly for rows create and docs update.
  • No interactive prompts when --no-input is set or CI=true.

Exit Codes

CodeMeaning
0OK
1Error
2Usage error
3Not found
4Auth error
5Conflict
6Rate limited

Environment Variables

VariableDescription
COPERA_CLI_AUTH_TOKENAPI token (overrides all config)
COPERA_PROFILEActive config profile name (default: "default")
COPERA_NO_UPDATE_CHECKSet to 1 to disable background version checks
COPERA_SANDBOXSet to 1 to use the dev API (api-dev.copera.ai)
CIWhen true, disables interactive prompts and update checks
NO_COLORDisable ANSI color output

Shell Completion

# Bash
copera completion bash >> ~/.bashrc

# Zsh
copera completion zsh >> ~/.zshrc

# Fish
copera completion fish > ~/.config/fish/completions/copera.fish

Need Help?

GitHub Repository

Source code, releases, and changelog

Report an Issue

Report bugs or request features