CoDuck Docs

#Commands reference

Every CoDuck CLI command, grouped by what it operates on. All commands honor --json (machine-readable output), --no-input (fail instead of prompting), and real exit codes (0 ok, 2 usage, 3 auth, 4 not found, 5 conflict, 6 network, 7 server — full table at the bottom).

For installation, see Install the CLI. For sign-in, see Authentication.

#Chat with the agent

Send a prompt to a project's AI agent, stream the response. Designed for AI agents calling CoDuck programmatically — JSON-first, NDJSON streaming, no interactive prompts.

bash
coduck chat "add a login page"                            # streams response, exits
coduck chat "add a login page" --json                     # NDJSON output for agents
coduck chat "add a login page" --project <id>             # override coduck.json
coduck chat --history                                     # print recent messages
coduck chat --history --json                              # same, as JSON
coduck chat "add a login page"                            # streams response, exits
coduck chat "add a login page" --json                     # NDJSON output for agents
coduck chat "add a login page" --project <id>             # override coduck.json
coduck chat --history                                     # print recent messages
coduck chat --history --json                              # same, as JSON

coduck ask "..." is an alias for coduck chat "...".

#NDJSON event types (what an agent sees with --json)

eventwhat it means
chunk (type=ttft)First token arrived; includes time-to-first-token in ms
chunk (type=text or response)Streaming response text
chunk (type=tool_call)Agent called a tool: tool, path, args
chunk (type=code)Wrote/edited a file: path, content
chunk (type=preview_url)Sandbox boot, ephemeral preview URL
chunk (type=usage)Tokens used in this round
chunk (type=complete)Generation finished server-side; cost, file list
completeFinal summary (mirror of last chunk)
doneCLI-side wrap-up event with totals
paywallInsufficient credits; includes plan + upgrade hint
errorFailure; includes message

#Projects

bash
coduck projects                    # list your projects
coduck project <id>                # show one project's details
coduck create --name <name>        # create a new AI-scaffolded project
coduck create-existing             # import the current directory as a project
coduck rename <id> <new>           # rename a project
coduck delete <id> --yes           # delete a project (irreversible)
coduck pause <id>                  # pause (stops billing, keeps state)
coduck resume <id>                 # resume a paused project
coduck projects                    # list your projects
coduck project <id>                # show one project's details
coduck create --name <name>        # create a new AI-scaffolded project
coduck create-existing             # import the current directory as a project
coduck rename <id> <new>           # rename a project
coduck delete <id> --yes           # delete a project (irreversible)
coduck pause <id>                  # pause (stops billing, keeps state)
coduck resume <id>                 # resume a paused project

#Files

bash
coduck push                        # upload local files (honors .gitignore + .coduckignore)
coduck push --dry-run              # show file count, total size, biggest dirs — no upload
coduck push --force                # push even if the server has newer files
coduck pull                        # download project files locally
coduck files ls                    # list remote files
coduck files cat <path>            # print a remote file
coduck push                        # upload local files (honors .gitignore + .coduckignore)
coduck push --dry-run              # show file count, total size, biggest dirs — no upload
coduck push --force                # push even if the server has newer files
coduck pull                        # download project files locally
coduck files ls                    # list remote files
coduck files cat <path>            # print a remote file

push uploads the source dir from your coduck.json and delivers the config file itself (even from a subdirectory). Transient network errors retry automatically; deploy warns if your last push failed or local files changed since.

#Deploy

bash
coduck deploy                      # build + ship the project
coduck deploy --size large         # deploy on a bigger instance (small|medium|large)
coduck stop                        # stop the running container
coduck restart                     # restart with no config change
coduck status                      # current deployment status
coduck teardown --yes              # destroy container + DB + vhost
coduck logs --follow               # tail container logs
coduck logs --since 30m --grep error   # filter by age + pattern
coduck logs-digest                 # summarized error/warn digest
coduck deploy                      # build + ship the project
coduck deploy --size large         # deploy on a bigger instance (small|medium|large)
coduck stop                        # stop the running container
coduck restart                     # restart with no config change
coduck status                      # current deployment status
coduck teardown --yes              # destroy container + DB + vhost
coduck logs --follow               # tail container logs
coduck logs --since 30m --grep error   # filter by age + pattern
coduck logs-digest                 # summarized error/warn digest

deploy uses the commands + instanceSize from your coduck.json; --size overrides the tier for one deploy. A failed deploy reports the specific cause (out of memory, build failed, wrong port, crashed after start).

#Generation (AI agent)

bash
coduck generate "add a login page" --wait    # send a prompt to the agent
coduck jobs status <jobId>                   # check a running generation
coduck jobs messages                         # conversation history
coduck generate "add a login page" --wait    # send a prompt to the agent
coduck jobs status <jobId>                   # check a running generation
coduck jobs messages                         # conversation history

#Environment variables

bash
coduck env list                    # list env vars (values masked)
coduck env list --reveal           # show full values
coduck env get <key>
coduck env set <key> <value>
coduck env unset <key>
coduck env import .env             # bulk import (skips reserved/invalid keys, imports the rest)
coduck env reserved                # list the keys CoDuck manages (can't be set)
coduck env list                    # list env vars (values masked)
coduck env list --reveal           # show full values
coduck env get <key>
coduck env set <key> <value>
coduck env unset <key>
coduck env import .env             # bulk import (skips reserved/invalid keys, imports the rest)
coduck env reserved                # list the keys CoDuck manages (can't be set)

A set of keys are reserved (CoDuck injects them and rejects them on write): DATABASE_URL, DIRECT_URL, PORT, NODE_ENV, and everything under CODUCK_* / NEXT_PUBLIC_CODUCK_*. coduck env reserved prints the authoritative list; see the coduck.json reference. coduck env import skips reserved/invalid keys with a warning instead of aborting.

#Custom domains

bash
coduck domains list
coduck domains add example.com
coduck domains verify example.com
coduck domains remove example.com
coduck domains transfer example.com <new-projectId>
coduck domains list
coduck domains add example.com
coduck domains verify example.com
coduck domains remove example.com
coduck domains transfer example.com <new-projectId>

#Database

bash
coduck db schema                   # full schema as JSON
coduck db tables                   # list tables
coduck db tables --table users     # read rows from a table
coduck db users                    # auth users (if using @coduckai/sdk/auth)
coduck db schema                   # full schema as JSON
coduck db tables                   # list tables
coduck db tables --table users     # read rows from a table
coduck db users                    # auth users (if using @coduckai/sdk/auth)

Read-only by design. No raw connection URL is exposed.

#Backups

bash
coduck backups list
coduck backups create
coduck backups download <id> --out backup.sql.gz
coduck backups restore <id> --yes
coduck backups delete <id>
coduck backups list
coduck backups create
coduck backups download <id> --out backup.sql.gz
coduck backups restore <id> --yes
coduck backups delete <id>

#Email

bash
coduck email status
coduck email domains list
coduck email domains add example.com
coduck email domains dns <id>      # reprint DNS records
coduck email domains verify <id>
coduck email send --from noreply@example.com --to user@example.com \
  --subject "Welcome" --text "Thanks." --html "<p>Thanks.</p>"
coduck email usage                 # quota
coduck email messages              # recent messages
coduck email suppressions list
coduck email suppressions remove <id>
coduck email unpause               # resume after auto-pause
coduck email status
coduck email domains list
coduck email domains add example.com
coduck email domains dns <id>      # reprint DNS records
coduck email domains verify <id>
coduck email send --from noreply@example.com --to user@example.com \
  --subject "Welcome" --text "Thanks." --html "<p>Thanks.</p>"
coduck email usage                 # quota
coduck email messages              # recent messages
coduck email suppressions list
coduck email suppressions remove <id>
coduck email unpause               # resume after auto-pause

#Storage

bash
coduck storage list
coduck storage upload <file>
coduck storage get <name> --out local.bin
coduck storage remove <name>
coduck storage list
coduck storage upload <file>
coduck storage get <name> --out local.bin
coduck storage remove <name>

#Stripe (BYOS payments)

bash
coduck stripe connect              # print OAuth URL
coduck stripe status
coduck stripe disconnect --yes
coduck stripe payments stats
coduck stripe payments transactions
coduck stripe payments revenue --days 30
coduck stripe payments health
coduck stripe connect              # print OAuth URL
coduck stripe status
coduck stripe disconnect --yes
coduck stripe payments stats
coduck stripe payments transactions
coduck stripe payments revenue --days 30
coduck stripe payments health

#Activity, analytics, forms

bash
coduck activity --limit 100
coduck analytics --days 30
coduck forms list
coduck forms read <id>
coduck forms delete <id>
coduck activity --limit 100
coduck analytics --days 30
coduck forms list
coduck forms read <id>
coduck forms delete <id>

#Account + tokens

bash
coduck whoami
coduck token status                # plan, credits
coduck token list                  # CLI tokens on your account
coduck token revoke <id>
coduck token show --confirm        # print the JWT (refuses without --confirm)
coduck whoami
coduck token status                # plan, credits
coduck token list                  # CLI tokens on your account
coduck token revoke <id>
coduck token show --confirm        # print the JWT (refuses without --confirm)

#Discovery

bash
coduck --help                      # human-friendly help
coduck --help --json               # machine-readable spec (use this to build an MCP wrapper)
coduck version
coduck doctor                      # diagnose auth + config + connectivity
coduck --help                      # human-friendly help
coduck --help --json               # machine-readable spec (use this to build an MCP wrapper)
coduck version
coduck doctor                      # diagnose auth + config + connectivity

#Global flags

FlagWhat it does
--jsonForce JSON output regardless of TTY
--no-inputFail with exit 2 instead of prompting
--quietSuppress non-essential output
--project <id>Override the coduck.json projectId for this command

#Exit codes

CodeMeaning
0Success
1Generic error
2Usage error (bad flag, missing input under --no-input)
3Authentication error
4Not found
5Conflict (e.g. payment required / state conflict)
6Network error
7Server error (5xx)

#Next