CodeDD CLI Guide
Install, authenticate, configure scope, run audits, and understand exactly what the CLI executes locally vs on CodeDD.
CodeDD CLI Guide
What the CLI Is
CodeDD CLI is the terminal interface for running CodeDD audits with local execution. It is designed for teams that want source-code analysis to run on their own machine while still using the CodeDD platform for consolidation, risk scoring, recommendations, and reporting.
What Runs Where
| Stage | Runs Locally (CLI) | Runs on CodeDD |
|---|---|---|
| Scope scanning | Directory scan, file discovery, line counting | Scope registration and sync status |
| File-level audit | LLM-based analysis on your machine | Result ingestion, audit consolidation |
| Complexity | Radon/Lizard metric extraction | Storage and portfolio aggregation |
| Dependency analysis | Manifest/import scanning | Vulnerability/license enrichment and scoring |
| Git statistics | Commit, author, merge, branch, release, churn, collaboration extraction | Storage and analytics use |
| Architecture | Local component and relationship extraction | Persistence and higher-level synthesis |
| Recommendations | - | Risk analysis, recommendations, dashboard output |
Prerequisites
- Python 3.11 or higher
- A CodeDD account
- At least one local Git repository for the selected audit scope
- A CLI token generated from your CodeDD account (Account → CLI Access)
- At least one LLM API key — Anthropic or OpenAI — for local file auditing
1) Generate a CLI Token
From the web app:
- Sign in to CodeDD.
- Open Account.
- Go to CLI Access.
- Click Generate Token.
- Copy the token and store it securely.
Token status in the UI should show as active when valid.
2) Install the CLI
PyPI install
pip install codedd-cli
Source install (development)
git clone https://gitlab.com/codedd1/codedd-cli cd codedd-cli pip install -e .
Verify
codedd --version
3) Authenticate
codedd auth login --token <your_cli_token>
Or run codedd auth login and paste the token when prompted.
Check auth state:
codedd auth status
4) Select the Active Audit
codedd audits list codedd audits select
The selected audit becomes the active context for scope and audit commands.
5) Define and Confirm Scope
Add one or more local repository roots:
codedd scope add /path/to/repo-a /path/to/repo-b codedd scope list codedd scope confirm
Scope confirm performs local scanning and registers scope on CodeDD. If files change later, codedd audit start performs auto-sync and asks for re-confirmation if needed.
6) Configure LLM Provider Key(s)
Set at least one key:
codedd config set-key anthropic # or codedd config set-key openai
Optional provider preference:
codedd config provider both
Useful configuration commands:
codedd config show codedd config show-keys codedd config concurrency 6
7) Run the Audit
codedd audit start
Frequently used options:
--skip-syncskip automatic scope sync check--yesauto-confirm prompts--showprint one-shot transparency summary--show-interactiveinteractive request/payload visibility--show-force-interactiveforce interactive display on larger audits--debug-llmprint LLM debug output
End-to-End Execution Flow
When codedd audit start runs, the CLI executes this sequence:
- Validate active audit and local scope
- Auto-sync scope vs remote (unless skipped)
- Pre-flight on CodeDD (readiness, payment/budget checks)
- Register audit start
- Execute local analysis:
- File-level LLM audit
- Complexity metrics
- Dependency scanning
- Git statistics
- Architecture analysis
- Submit structured outputs to CodeDD
- Trigger server-side consolidation and recommendations
Git Data Captured by CLI
The CLI submits git statistics aligned with CodeDD storage fields:
commit_historyauthor_statsmerge_statsbranch_statsmeta_infotime_based_statsrelease_statscode_churn_statscollaboration_stats
Security and Credential Storage
- CLI token and LLM API keys are stored in the OS credential manager (not plaintext config).
- CLI configuration is stored in
~/.codedd/config.toml. - TLS verification is enabled for API traffic.
Core Command Reference
Authentication
codedd auth logincodedd auth logoutcodedd auth status
Audits
codedd audits listcodedd audits select [audit_uuid]
Scope
codedd scope add <path> [path ...]codedd scope listcodedd scope statuscodedd scope synccodedd scope confirmcodedd scope remove <index>codedd scope clear
Audit execution
codedd audit start
Configuration
codedd config showcodedd config set <key> <value>codedd config provider [anthropic|openai|both]codedd config set-key [anthropic|openai]codedd config remove-key <anthropic|openai>codedd config show-keyscodedd config concurrency <n>
Common Issues
"No active audit"
Run:
codedd audits select
"No LLM API keys configured"
Run:
codedd config set-key anthropic
or
codedd config set-key openai
Scope drift detected
If local files changed after scope confirm, rerun:
codedd scope confirm codedd audit start
Recommended Daily Workflow
codedd auth status codedd audits select codedd scope status codedd audit start

