Global Options
Authentication
login
Authenticate with CodeAnt AI via browser-based OAuth.logout
Sign out and remove stored credentials.set-token
Store an authentication token for an SCM platform.github, gitlab, bitbucket, azure
Examples:
Code Scanning
All scanning commands share a common set of options for controlling scan scope and file filtering.Common Scan Options
These options apply tosecrets:
| Option | Description |
|---|---|
--staged | Scan only staged files (default) |
--all | Scan all changed files compared to base branch |
--uncommitted | Scan all uncommitted changes (staged + unstaged + untracked) |
--last-commit | Scan files from the last commit |
--last-n-commits <n> | Scan files from the last n commits (max 5) |
--include <patterns> | Comma-separated glob patterns to include files |
--exclude <patterns> | Comma-separated glob patterns to exclude files |
*matches any characters except/**matches any characters including/*.{js,ts}matches multiple extensions (brace expansion is supported)- Multiple patterns:
--exclude 'test/**,dist/**'
secrets
Scan code for exposed secrets, API keys, and credentials.| Option | Description |
|---|---|
--fail-on <level> | Fail threshold: HIGH, MEDIUM, or all (default: HIGH) |
| Level | Description |
|---|---|
HIGH | High confidence — likely a real secret |
MEDIUM | Medium confidence — may require manual review |
FALSE_POSITIVE | Detected but likely not a real secret (always ignored) |
0— No blocking secrets found (or only false positives)1— Secrets detected that match the--fail-onthreshold
Configuration
set-base-url
Set a custom API base URL for self-hosted CodeAnt deployments.get-base-url
Display the current API base URL and where it’s configured.Configuration File
All configuration is stored in~/.codeant/config.json.
Configuration Keys:
| Key | Description |
|---|---|
apiKey | CodeAnt AI API token (set via codeant login) |
baseUrl | API base URL (set via codeant set-base-url) |
githubToken | GitHub token (set via codeant set-token github) |
gitlabToken | GitLab token (set via codeant set-token gitlab) |
bitbucketToken | Bitbucket token (set via codeant set-token bitbucket) |
azureDevOpsToken | Azure DevOps token (set via codeant set-token azure) |
githubBaseUrl | GitHub Enterprise API URL |
gitlabBaseUrl | Self-hosted GitLab URL |
bitbucketBaseUrl | Bitbucket Server URL |
| Variable | Description |
|---|---|
CODEANT_API_URL | Override API base URL |
CODEANT_API_TOKEN | Override API authentication token |
GITHUB_TOKEN / GH_TOKEN | GitHub authentication |
GITHUB_API_URL / GH_ENTERPRISE_URL | GitHub Enterprise API URL |
GITLAB_TOKEN | GitLab authentication |
GITLAB_URL / GITLAB_HOST | Self-hosted GitLab URL |
BITBUCKET_TOKEN | Bitbucket authentication |
BITBUCKET_URL / BITBUCKET_SERVER_URL | Bitbucket Server URL |
AZURE_DEVOPS_TOKEN / AZURE_DEVOPS_PAT | Azure DevOps authentication |
- Environment variables (highest)
- Platform CLI tools (
gh,glab) - Config file (
~/.codeant/config.json) - Default values