Enterprise CLI

How the Codeego command-line tool analyses a codebase on your own machine or CI runner without uploading it: installation, credentials, usage, outputs, exit codes, and exactly what leaves the machine.

The Codeego CLI (codeego) runs an assessment of a local folder and can stop a CI pipeline when scores fall below thresholds you set. The repository is never uploaded, cloned or stored by Codeego. The CLI requires an Enterprise organisation with API access enabled. Each run is an Expert-level assessment and counts against the organisation's monthly Expert quota.

What leaves your machine#

The CLI computes locally the list of files, size and complexity metrics, and the list of packages. It sends this summary, the facts bundle, to Codeego. The analysis then runs on Codeego's servers. When the analysis needs to read code, the server asks the CLI for one item at a time: an excerpt of a file, a directory listing, or the results of a search. The CLI answers over HTTPS, and only those answers travel. They are passed to the language model, held in memory for the run, and not written to storage.

  • Files are chosen with git ls-files, so untracked and ignored files are not visible.
  • A built-in denylist hides common secret files, matched case-insensitively on the file name: .env, .env.*, *.env, *.pem, *.key, id_rsa*, id_dsa*, id_ecdsa*, id_ed25519*, *.p12, *.pfx, *.keystore, *.jks, credentials, credentials*.json, service-account*.json, .git-credentials, .npmrc, .pypirc, .netrc, .dockercfg, kubeconfig, *.tfstate, *.tfstate.*, *.tfvars, *.ovpn.
  • Your own exclude patterns hide further paths. Excluded files are invisible both to the metrics and to the analysis.
  • --audit-log FILE records every request the CLI answered: time, tool, path or pattern, and byte count, without the content.
  • Unlike web assessments, no copy of the source is kept as an analysis workspace (see Data retention and deletion). The reports, the certificate and the structured results are stored as for any assessment.

Install#

The CLI is available as a standalone binary, as a Python wheel and as a Docker image. git must be installed. If semgrep is on the PATH, the CLI runs it locally and includes its signal; otherwise that signal is skipped.

# Python wheel
uv tool install ./codeego_cli-*.whl      # or: pipx install ./codeego_cli-*.whl

# Standalone binary, placed on your PATH
codeego version

# Docker, from the folder to analyse
docker run --rm -v "$PWD:/workspace" -e CODEEGO_CLIENT_ID -e CODEEGO_CLIENT_SECRET codeego-cli analyze

Credentials#

Create an API key in Settings, API Keys (see External API) and provide it through the environment variables CODEEGO_CLIENT_ID and CODEEGO_CLIENT_SECRET. codeego auth check prints the organisation, whether it is Enterprise, whether API access is active, and the Expert quota used.

The API address defaults to https://backend.codeego.com and can be changed with --api-url or CODEEGO_API_URL. It cannot be set in the configuration file, so that a committed file cannot redirect the data to another server. Plain HTTP is accepted only for localhost.

Run an analysis#

codeego analyze [PATH] [options]     # PATH defaults to the current folder
codeego auth check
codeego version
OptionMeaning
--config FILEConfiguration file. Defaults to .codeego.yml in the analysed folder, if present.
--min-score NMinimum overall score.
--min TOPIC=NMinimum score for one topic. Repeatable. Topics: overall, quality, tests, security, docs, dependencies, errors, observability.
--work-mode, --team-location, --ai-adoptionThe team scenario for the economic estimates.
--no-economicSkip the economic report.
--exclude GLOBHide matching files. Repeatable.
--output-dir DIRWhere to write the outputs. Default codeego-report.
--audit-log FILEWrite the audit log described above.
--title TEXTAssessment title.
--quiet, --jsonNo progress output; print summary.json to standard output.

The same settings can be kept in .codeego.yml (thresholds, work_mode, team_location, ai_adoption, include_economic_valuation, exclude, title, output_dir). Command-line flags override the file, and unknown keys are rejected. In the file, output_dir must stay inside the analysed folder.

Keep the process running and connected until it finishes: the server needs the CLI to answer its requests. A run takes from minutes to under an hour. If the CLI is unreachable for more than about five minutes, the run fails.

Outputs#

The output folder contains technical_report.pdf, and when produced economic_report.pdf, certificate.pdf and Markdown versions of the reports; kpis.json with the structured scores and findings; and summary.json with the assessment ID, the dashboard link, the scores, the threshold results and the overall pass or fail. Files from an earlier run that this run did not produce are removed. The assessment also appears on the organisation's dashboard. To re-analyse it or request a review, run the CLI again.

Exit codes#

CodeMeaning
0Completed and all thresholds met.
1Completed, but at least one threshold was missed.
2Usage or configuration error: bad flags, invalid configuration, empty folder, facts bundle too large.
3Authentication or entitlement error: bad credentials, not Enterprise, API access not active, quota exhausted.
4The analysis failed, timed out, or the CLI was disconnected for too long.
130Interrupted with Ctrl-C. The run fails on the server after about five minutes.

A run that fails on Codeego's side, or because the CLI disconnected or was interrupted, does not consume quota.

Use in CI#

- run: codeego analyze --min-score 70 --min security=80 --audit-log codeego-audit.log
  env:
    CODEEGO_CLIENT_ID: ${{ secrets.CODEEGO_CLIENT_ID }}
    CODEEGO_CLIENT_SECRET: ${{ secrets.CODEEGO_CLIENT_SECRET }}
GitHub Actions

Store the credentials as masked CI secrets and do not expose them to builds from untrusted forks. Keep the report folder and the audit log as build artefacts if you need them later.