CLI Reference
Global Options
Section titled “Global Options”These flags can be used with any command:
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 versionkod init
Section titled “kod init”Configure the CLI client interactively. Saves settings to ~/.kod/config.json.
kod initWhen 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.
git-credential-kod
Section titled “git-credential-kod”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:
git config --global credential.http://localhost:3000.helper kodkod serve
Section titled “kod serve”Start the Kod server.
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 secretsEnvironment variables:
| Variable | Description |
|---|---|
KOD_PORT | Port to listen on |
KOD_DATA_DIR | Data directory |
KOD_REPOS_DIR | Repos directory |
KOD_API_TOKEN | API token |
KOD_ADMIN_TOKEN | Admin token for first-time setup |
KOD_ENCRYPTION_KEY | Encryption key for secrets |
kod clone
Section titled “kod clone”Clone a repository using your configured token.
kod clone <repo-name>kod clone <url>kod clone my-app --credentials kod_other_tokenkod repo
Section titled “kod repo”Manage repositories.
kod repo list # List all repositorieskod repo create <name> # Create a new repositorykod repo <name> info # Show repository detailskod repo update <name> name <new> # Rename a repositorykod repo delete <name> # Delete a repositoryCollaborators
Section titled “Collaborators”kod repo <name> collaborator list # List collaboratorskod repo <name> collaborator add <username> # Add collaboratorkod repo <name> collaborator remove <username> # Remove collaboratorkod token
Section titled “kod token”Manage API tokens (requires admin permission).
kod token list # List all tokenskod token create <name> [options] # Create a new tokenkod token delete <id> # Delete a tokenCreate options:
--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:
kod token create ci-deploy --permissions repo:read,workflow:triggerkod token create alice --username alice --permissions repo:read,repo:writekod token create temp --expires 30kod token create full-admin --permissions adminkod workflow
Section titled “kod workflow”Run workflows locally or check status.
kod workflow <file.toml> [file2.toml...] # Run workflow(s) locallykod workflow status [repo] # Check workflow statusExamples:
kod workflow build.tomlkod workflow build.toml deploy.tomlBRANCH=main kod workflow build.tomlkod workflow statuskod workflow status my-repokod upgrade
Section titled “kod upgrade”Upgrade Kod to the latest version.
kod upgradekod uninstall
Section titled “kod uninstall”Remove Kod from your system. Deletes the binary (~/.local/bin/kod) and data directory (~/.kod). Prompts for confirmation before proceeding.
kod uninstallPermissions
Section titled “Permissions”| Permission | Description |
|---|---|
repo:read | Clone and fetch repositories |
repo:write | Push to repositories |
repo:delete | Delete repositories |
collaborator:read | List collaborators |
collaborator:write | Add/remove collaborators |
workflow:read | View workflow status and history |
workflow:trigger | Trigger workflows via API |
secrets:read | List secret names (no values) |
secrets:write | Create, update, and delete secrets |
admin | Full access to all operations |