Skip to main content
If you’re running Kodus on your own infrastructure, the CLI works the same way — you just need to point it to your API.

Connect to Your Instance

1

Set the API URL

Tell the CLI where your Kodus API lives. Pick one method:
HTTPS is required. The CLI rejects non-HTTPS URLs for security. The only exception is localhost and 127.0.0.1 for local development.
Priority order: KODUS_API_URL env var > ~/.kodus/config.json apiUrl > default (https://api.kodus.io).
2

Authenticate

3

Verify the Connection

You should see your authentication mode, organization name, and that the token is valid. If using verbose mode, the API URL being used is logged:

Cloudflare Access (Zero Trust)

If your self-hosted API is behind Cloudflare Access, the CLI supports service token authentication.
The CLI sends CF-Access-Client-Id and CF-Access-Client-Secret headers on every API request when configured. Priority: env vars > config file.

Config File Reference

The CLI stores configuration in ~/.kodus/config.json:
The config file is created with 0600 permissions (owner read/write only). The directory ~/.kodus/ is created with 0700 permissions.

Environment Variables Summary

CI/CD Integration

For self-hosted instances in CI/CD pipelines, set the API URL and authentication as environment variables:
Use --fail-on error or --fail-on critical to fail the pipeline when issues above a severity threshold are found.

Distributing to Your Team

To onboard your team in one command, combine the API URL with the skill installer:
This installs the CLI, configures the team key, and deploys review skills to detected AI agents (Claude Code, Cursor, Windsurf) — all pointing to your self-hosted instance.

Troubleshooting

The CLI requires HTTPS for all non-localhost URLs. Make sure your self-hosted instance has a valid TLS certificate. If you’re testing locally, use http://localhost:<port> instead.
  • Verify the URL is reachable: curl -I https://kodus-api.yourcompany.com
  • Check if a firewall or VPN is blocking the connection
  • If behind Cloudflare Access, ensure CF_ACCESS_CLIENT_ID and CF_ACCESS_CLIENT_SECRET are set
  • Use --verbose to see the exact URL being used
  • Run kodus auth status to check your current auth state
  • If using a team key, verify it’s valid on your self-hosted dashboard
  • If using personal login, tokens expire after 1 hour — the CLI auto-refreshes, but you may need to re-login if the refresh token is also expired
  • Make sure KODUS_API_URL points to the correct instance
This usually means the URL is hitting a reverse proxy, load balancer, or Cloudflare Access page instead of the actual API. Check:
  • The URL path is correct (no trailing /api or similar)
  • Cloudflare Access credentials are configured if applicable
  • The reverse proxy is forwarding requests correctly
Your self-hosted instance may enforce device limits per organization. Contact your admin to increase the limit or remove old devices from the dashboard.