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, 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

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

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 commands, works for everything
  • Integration API Key (cp_key_...) — for boards and channels only
Get a token at Authentication.

Commands

copera auth login              # Interactive auth setup
copera auth status             # Show current token and source
copera auth logout             # Remove stored credential
copera boards list             # List all accessible boards
copera boards list --json      # JSON output (for scripting)
copera boards get <id>         # Get board details
copera bases list              # Alias for boards list
copera tables list                        # List tables (uses default board)
copera tables list --board <board-id>     # List tables in specific board
copera tables get <table-id>              # Get table schema and columns
copera tables get <id> --board <board-id>
copera rows list                                      # List rows (uses defaults)
copera rows list --board <id> --table <id>            # Explicit IDs
copera rows get <row-id>                              # Get row with resolved labels
copera rows create --data '{"columns":[...]}'         # Create a row
echo '{"columns":[...]}' | copera rows create        # Create from stdin
Docs commands require a Personal Access Token (cp_pat_...).
copera docs tree                          # Tree view of workspace docs
copera docs tree --parent <id>            # Subtree under a specific doc
copera docs search "keyword"              # Full-text search
copera docs get <id>                      # Get doc metadata
copera docs content <id>                  # Get markdown content (cached)
copera docs content <id> --no-cache       # Bypass cache
copera docs create --title "New Doc"      # Create a doc
copera docs update <id> --content "..."   # Update content
copera docs update <id> --operation append # Append content
cat content.md | copera docs update <id>  # Update from stdin
copera docs delete <id> --force           # Delete a doc
copera cache status            # Show cache location and size
copera cache clean             # Remove all cached data
copera version                 # Show version
copera version --json          # Version as JSON

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
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