| name | codacy-cloud-cli |
| description | Uses the Codacy Cloud CLI to query repositories, issues, security findings, pull requests, tools, and patterns on Codacy Cloud. Use whenever the user mentions Codacy, asks about code quality metrics, wants to check issues or findings in a repo, inspect a pull request analysis, browse security vulnerabilities, enable or disable tools, search patterns, trigger a reanalysis, or interact with any remote Codacy data — even if they don't say "Codacy CLI" explicitly. |
| license | MIT |
| metadata | {"author":"Codacy","version":"1.5.0"} |
Codacy Cloud CLI
Glossary: See glossary.md for shared definitions of Codacy concepts (issues, findings, severity, coverage, tools, patterns, etc.).
The Codacy Cloud CLI (codacy) is the command-line interface for Codacy Cloud. Use it whenever the user wants to interact with remote Codacy data. This is a different tool from the Codacy Analysis CLI (codacy-analysis), which runs static analysis locally.
Setup
npm install -g @codacy/codacy-cloud-cli
export CODACY_API_TOKEN=<token>
codacy login
codacy login --token <token>
codacy info
Shared session: The Cloud CLI and the Analysis CLI (codacy-analysis) share the same credentials at ~/.codacy/credentials. Logging in or out with either CLI applies to both — there is no need to authenticate separately.
Getting help
The CLI is the authoritative source of truth. Always use --help to discover available commands, options, and current behavior:
codacy --help
codacy <command> --help
Use --output json on any command for machine-readable output.
Provider values
See the Provider section in the glossary for the full table of CLI values (gh, gl, bb).
Auto-detection of repository parameters
The CLI auto-detects the provider, organization, and repository from the git remote origin URL when run inside a repository. This means most commands work without specifying these parameters explicitly:
codacy issues
codacy repository
codacy pull-request 42
codacy issues gh my-org my-repo
codacy repository gh my-org my-repo
codacy pull-request gh my-org my-repo 42
Auto-detection supports GitHub, GitLab, and Bitbucket remote URLs. If the remote cannot be parsed (e.g., non-standard hosting), pass the parameters explicitly. All examples in this document use the explicit form for clarity, but the short form is preferred when running inside a repo.
How Codacy data works
- Data reflects the HEAD commit — issue lists, coverage, and security findings always show the state of the latest analyzed commit on the branch or pull request. There is no per-file or per-line historical view.
- Configuration changes are not instant — enabling/disabling tools or patterns, changing parameters, and ignoring issues only take effect after the next analysis. That means either triggering a reanalysis via
--reanalyze or waiting for the next commit to be pushed.
- Organization standards are enforced and cannot be overridden at repository level — if a pattern is enforced by a Coding Standard at the organization level, its enabled/disabled state and parameters cannot be changed per-repository. To change it, the standard must be updated at the organization level.
Reanalysis
Use --reanalyze-and-wait (-w) on the repository or pull-request commands to trigger reanalysis and block until it completes. The CLI captures a baseline, triggers reanalysis, polls every 10 seconds (up to 20 minutes), and reports issue deltas by pattern, severity, and category with timing information. Supports --output json for machine-readable delta reports.
codacy repository gh my-org my-repo --reanalyze-and-wait
codacy repository gh my-org my-repo -w -o json
codacy repository gh my-org my-repo --reanalyze
When using --reanalyze without --and-wait, check progress manually by re-running the command without --reanalyze:
- Table output: look at the "Analysis" field —
"Reanalysis in progress..." means it is still running; "Finished X ago" means it is done
- JSON output: compare the
startedAnalysis and endedAnalysis timestamps — complete when startedAnalysis > trigger time AND endedAnalysis > startedAnalysis
Command reference
Account & repositories
codacy info
codacy repositories <provider> <org>
codacy repositories gh my-org --search my-repo
codacy repository gh my-org my-repo
codacy repository gh my-org my-repo --add
codacy repository gh my-org my-repo --remove
codacy repository gh my-org my-repo --follow
codacy repository gh my-org my-repo --unfollow
codacy repository gh my-org my-repo --reanalyze
codacy repository gh my-org my-repo --reanalyze-and-wait
codacy repository gh my-org my-repo --link-standard <id>
codacy repository gh my-org my-repo --unlink-standard <id>
Issues (code quality)
codacy issues gh my-org my-repo
codacy issues gh my-org my-repo --branch main --severities Critical,High
codacy issues gh my-org my-repo --categories Security
codacy issues gh my-org my-repo --tools eslint,semgrep
codacy issues gh my-org my-repo --limit 500
codacy issues gh my-org my-repo --overview
codacy issues gh my-org my-repo -O -o json
The --overview output includes:
- False positive counts per pattern — labeled as "Not a False Positive" / "Potential False Positive"
- Suggested actions to reduce noise — identifies patterns accounting for 10%+ of all issues or 3x the average per-pattern count, and generates ready-to-run
codacy pattern disable commands for each. If a pattern is enforced by a coding standard or uses a config file, the suggestion adapts accordingly (e.g., suggests editing the coding standard or the config file instead)
codacy issue gh my-org my-repo <issueId>
codacy issue gh my-org my-repo <issueId> --ignore
codacy issue gh my-org my-repo <issueId> --ignore --ignore-reason FalsePositive --ignore-comment "Not applicable here"
codacy issue gh my-org my-repo <issueId> --unignore
codacy issues gh my-org my-repo --severities Minor --categories CodeStyle --ignore
Filters: --branch, --patterns, --severities (Critical,High,Medium,Minor), --categories, --languages, --tools, --tags, --authors
Ignore reasons: AcceptedUse (default) | FalsePositive | NotExploitable | TestCode | ExternalCode
Security findings
codacy findings gh my-org my-repo
codacy findings gh my-org
codacy findings gh my-org my-repo --severities Critical,High
codacy findings gh my-org my-repo --statuses Overdue,DueSoon
codacy findings gh my-org my-repo --limit 500
codacy finding gh my-org my-repo <findingId>
codacy finding gh my-org my-repo <findingId> --ignore
codacy finding gh my-org my-repo <findingId> --ignore --ignore-reason FalsePositive --ignore-comment "Verified safe"
codacy finding gh my-org my-repo <findingId> --unignore
Filters: --search, --severities (Critical,High,Medium,Low), --statuses (Overdue,OnTrack,DueSoon,ClosedOnTime,ClosedLate,Ignored), --categories, --scan-types, --dast-targets
Ignore reasons: AcceptedUse (default) | FalsePositive | NotExploitable | TestCode | ExternalCode
Pull requests
codacy pull-request gh my-org my-repo <prNumber>
codacy pull-request gh my-org my-repo <prNumber> --diff
codacy pull-request gh my-org my-repo <prNumber> --issue <issueId>
codacy pull-request gh my-org my-repo <prNumber> --ignore-issue <issueId>
codacy pull-request gh my-org my-repo <prNumber> --ignore-issue <issueId> --ignore-reason FalsePositive
codacy pull-request gh my-org my-repo <prNumber> --unignore-issue <issueId>
codacy pull-request gh my-org my-repo <prNumber> --ignore-all-false-positives
codacy pull-request gh my-org my-repo <prNumber> --reanalyze
codacy pull-request gh my-org my-repo <prNumber> --reanalyze-and-wait
Tools & patterns
codacy tools gh my-org my-repo
codacy tool gh my-org my-repo eslint --enable
codacy tool gh my-org my-repo eslint --disable
codacy tool gh my-org my-repo eslint --configuration-file true
codacy patterns gh my-org my-repo eslint
codacy patterns gh my-org my-repo eslint --enabled --categories Security
codacy patterns gh my-org my-repo pylint --search W0123
codacy pattern gh my-org my-repo eslint no-unused-vars
codacy pattern gh my-org my-repo eslint no-unused-vars --enable
codacy pattern gh my-org my-repo eslint no-unused-vars --disable
codacy pattern gh my-org my-repo eslint max-len --parameter max=120
codacy patterns gh my-org my-repo eslint --categories Security --severities Critical,High --enable-all
codacy patterns gh my-org my-repo pylint --categories CodeStyle --severities Minor --disable-all
Configuration file and coding standard awareness:
- When a tool uses a local configuration file (
--configuration-file true), codacy patterns skips fetching managed patterns (they don't apply)
- When a pattern is enforced by a coding standard,
--enable/--disable will refuse the operation with a message indicating which standard enforces it. Update the coding standard at the organization level instead, or unlink the standard from the repository first (codacy repository ... --unlink-standard <id>)
Pattern search tip: Codacy pattern IDs combine tool prefix and original ID. Use --search with the original ID to find them:
codacy patterns gh my-org my-repo semgrep --search HttpGetHTTPRequest
codacy patterns gh my-org my-repo pylint --search W0123
Importing configuration
codacy tools gh my-org my-repo --import
codacy tools gh my-org my-repo --import ./custom-config.json
codacy tools gh my-org my-repo --import -y
codacy tools gh my-org my-repo --import --force -y
The --import flag reads a local .codacy/codacy.config.json (or a specified path) and applies the tool and pattern configuration to the Codacy Cloud repository. Use -y (--skip-approval) to skip the interactive confirmation. Use --force to unlink the repository from its Coding Standard before importing — this is required when org-level standards block pattern changes.
Import behavior:
- Preserves cloud-only tools during import — only tools supported locally are modified; cloud-only tools (e.g., SonarSharp, Codacy ScalaMeta Pro) keep their existing enabled/disabled state
- Handles config-file mode correctly — when a tool uses a local configuration file, the import skips resetting its managed patterns (they don't apply)
- Surfaces structured API error details on import failures, including which tools/patterns conflicted and why
Note: The .codacy/codacy.config.json file is for local analysis only. Committing it to the repository does NOT affect Codacy Cloud. The --import command is the only way to sync local config to Cloud.
Common workflows
Check critical security issues in a repo:
codacy findings gh my-org my-repo --severities Critical,High
Review what a PR introduced:
codacy pull-request gh my-org my-repo 42
codacy pull-request gh my-org my-repo 42 --diff
Understand a specific issue:
codacy issue gh my-org my-repo <issueId>
Trigger reanalysis and wait for results:
codacy repository gh my-org my-repo --reanalyze-and-wait
codacy repository gh my-org my-repo -w -o json
Identify and reduce noise:
codacy issues gh my-org my-repo --overview