Skip to content

CLI Reference

These flags can be used with any command:

Terminal window
kod [global options] <command> [options]
-t, --token <token> API token for authentication
-s, --server <url> Server URL (default: http://localhost:3000)
-h, --help Show help
-v, --version Show version

Configure the CLI client interactively. Saves settings to ~/.kod/config.json.

Terminal window
kod init

When prompted for the API token, enter the same token used with --admin-token when starting the server.

If git-credential-kod is available on your PATH (installed automatically with npm install -g kod), kod init also configures Git to use it as a credential helper for the server host. This means plain git clone, git push, and git pull will authenticate automatically.

A Git credential helper that reads your Kod token from ~/.kod/config.json and provides it to Git automatically. Installed alongside the kod binary.

You normally don’t need to invoke this directly — kod init configures Git to use it. To set it up manually:

Terminal window
git config --global credential.http://localhost:3000.helper kod

Start the Kod server.

Terminal window
kod serve [options]
Options:
--port, -p <port> Port to listen on (default: 3000)
--data-dir <path> Data directory for database
--repos-dir <path> Directory for Git repositories
--token <token> API token for authentication
--admin-token <token> Admin token for first-time setup
--encryption-key <key> Encryption key for secrets

Environment variables:

VariableDescription
KOD_PORTPort to listen on
KOD_DATA_DIRData directory
KOD_REPOS_DIRRepos directory
KOD_API_TOKENAPI token
KOD_ADMIN_TOKENAdmin token for first-time setup
KOD_ENCRYPTION_KEYEncryption key for secrets

Clone a repository using your configured token.

Terminal window
kod clone <repo-name>
kod clone <url>
kod clone my-app --credentials kod_other_token

Manage repositories.

Terminal window
kod repo list # List all repositories
kod repo create <name> # Create a new repository
kod repo <name> info # Show repository details
kod repo update <name> name <new> # Rename a repository
kod repo delete <name> # Delete a repository
Terminal window
kod repo <name> collaborator list # List collaborators
kod repo <name> collaborator add <username> # Add collaborator
kod repo <name> collaborator remove <username> # Remove collaborator

Manage API tokens (requires admin permission).

Terminal window
kod token list # List all tokens
kod token create <name> [options] # Create a new token
kod token delete <id> # Delete a token

Create options:

Terminal window
--permissions <perms> Comma-separated permissions (default: repo:read,repo:write,workflow:read)
--expires <days> Token expiration in days (1-365)
--username <user> Link token to a collaborator (for Git access)

Examples:

Terminal window
kod token create ci-deploy --permissions repo:read,workflow:trigger
kod token create alice --username alice --permissions repo:read,repo:write
kod token create temp --expires 30
kod token create full-admin --permissions admin

Run workflows locally or check status.

Terminal window
kod workflow <file.toml> [file2.toml...] # Run workflow(s) locally
kod workflow status [repo] # Check workflow status

Examples:

Terminal window
kod workflow build.toml
kod workflow build.toml deploy.toml
BRANCH=main kod workflow build.toml
kod workflow status
kod workflow status my-repo

Upgrade Kod to the latest version.

Terminal window
kod upgrade

Remove Kod from your system. Deletes the binary (~/.local/bin/kod) and data directory (~/.kod). Prompts for confirmation before proceeding.

Terminal window
kod uninstall
PermissionDescription
repo:readClone and fetch repositories
repo:writePush to repositories
repo:deleteDelete repositories
collaborator:readList collaborators
collaborator:writeAdd/remove collaborators
workflow:readView workflow status and history
workflow:triggerTrigger workflows via API
secrets:readList secret names (no values)
secrets:writeCreate, update, and delete secrets
adminFull access to all operations