codaio
v0.4.0
Published
CLI for the Coda API v1
Readme
codaio
A CLI for the Coda API v1, designed for use by AI agents (Claude Code, Cursor, etc.) and humans alike.
Installation
npm install -g codaio
# or
bunx codaioAuthentication
Generate an API token at https://coda.io/account, then:
codaio logincodaio login stores the token in ~/.config/codaio/config.json.
Or set the CODA_API_TOKEN environment variable (takes priority over the stored token). This is mainly useful when you want other tools like curl to reuse the same token; the CLI itself already reads the saved config.
Usage
codaio [options] [command]
Options:
--format <format> Output format: json (default) or table
Commands:
login Authenticate with an API token
logout Remove stored token
whoami Show current user
docs list List docs
docs get Get a doc by ID
docs create Create a new doc
docs delete Delete a doc
tables list List tables in a doc
tables get Get a table by ID or name
columns list List columns in a table
rows list List rows in a table
rows get Get a row by ID or name
rows upsert Insert or upsert rows
rows update Update a row
rows delete Delete rows
pages list List pages in a doc
pages get Get a page by ID or name
pages update Update a page's metadata
pages export Export a page to HTML or Markdown
formulas list List formulas in a doc
formulas get Get a formula by ID or name
controls list List controls in a doc
controls get Get a control by ID or nameOutput Formats
By default all commands output JSON — ideal for piping to jq or agent use.
codaio docs list | jq '.[].name'
# Human-readable table
codaio docs list --format tableExamples
# List all docs you own
codaio docs list --is-owner
# Get all rows from a table
codaio rows list <docId> <tableId> --all
# Upsert a row (by column name key)
codaio rows upsert <docId> <tableId> \
--cells '[{"column":"Name","value":"Alice"}]' \
--key-columns Name
# Export a page to Markdown
codaio pages export <docId> <pageId> --output-format markdownEnvironment Variables
| Variable | Description |
| ---------------- | --------------------------------------- |
| CODA_API_TOKEN | Coda API token (overrides stored token) |
Browser URLs vs API IDs
Coda browser URLs and API IDs are annoyingly close but not identical.
- Browser doc URLs use
_d..., while the API returns the doc ID without that leadingd. - Example:
https://coda.io/d/My-Doc_dAbCdEf123maps to API doc IDAbCdEf123. - If you already have the full browser URL, you can pass the URL directly anywhere the CLI asks for a
docId.
TODO: Future API coverage
- [ ] Permissions (ACL/sharing)
- [ ] Publishing
- [ ] Packs
- [ ] Analytics
- [ ] Automations
- [ ] Folders
- [ ] Workspaces
- [ ] Miscellaneous (resolveBrowserLink, mutationStatus, categories)
Development
bun install
bun run src/index.ts --help # dev
bun test # run tests
bun run build # build to dist/cli.js
bun run generate:types # regenerate OpenAPI typesReleasing
Create a changeset for any user-facing change:
bun run changesetWhen you're ready to publish, run the Release workflow in GitHub Actions from the branch you want to release. The workflow will:
- build the CLI
- version the package with Changesets
- update
CHANGELOG.md - publish to npm
- push the release commit and tag back to GitHub
The workflow requires a repository secret named NPM_TOKEN.
