Skip to content

Commit b322138

Browse files
claudiacodacyclaudegemini-code-assist[bot]
authored
feat: add Codacy Cloud CLI documentation (#2674)
* feat: add Codacy Cloud CLI documentation Adds a dedicated page for the Codacy Cloud CLI under a new top-level "Codacy Cloud CLI" nav section. Covers installation, authentication, the Codacy Skills integration (Claude Code, Claude.ai, and other AI assistants), a capability reference with grouped command examples, and example workflows. Cross-references added to: Codacy API, API tokens, Issues, and Pull Requests pages. Adds "unignore" to the vale vocabulary. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Update docs/codacy-cloud-cli/index.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * docs: recommend CODACY_API_TOKEN env var for non-interactive auth Remove --token flag suggestion for CI/CD in favour of the environment variable, which is the standard approach for secrets in pipelines. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: add marketplace add step before plugin install for Codacy Skills Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent a8f591b commit b322138

7 files changed

Lines changed: 239 additions & 1 deletion

File tree

.github/styles/config/vocabularies/Codacy/accept.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ TSLint
9393
TSQLLint
9494
unassigns
9595
unfollow
96+
unignore
9697
vacuumdb
9798
Visualforce
9899
VSCode

docs/codacy-api/api-tokens.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Codacy provides **account** and **repository**-level API tokens that allow you t
99
- [Upload coverage data](../coverage-reporter/index.md) to Codacy
1010
- Upload to Codacy the results of [running client-side analysis tools](../repositories-configure/local-analysis/client-side-tools.md)
1111
- [Authenticate when using the Codacy API](using-the-codacy-api.md#authenticating-requests)
12+
- [Authenticate with the Codacy Cloud CLI](../codacy-cloud-cli/index.md#authentication)
1213

1314
The sections below provide details about the two types of API tokens and instructions on how to generate and revoke them.
1415

docs/codacy-api/using-the-codacy-api.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
The Codacy API allows you to programmatically retrieve and analyze data from Codacy and perform a few configuration changes.
44

5+
!!! tip
6+
Looking for a higher-level interface? The [Codacy Cloud CLI](../codacy-cloud-cli/index.md) wraps the Codacy API with ready-to-use commands for managing repositories, issues, security findings, and pull requests from your terminal.
7+
58
Codacy supports two API versions but we strongly recommend using the new API v3 when possible since it's the version being actively developed. Import the OpenAPI 2.0 definition provided below into your development tools to help bootstrap your integration with Codacy.
69

710
<table>

docs/codacy-cloud-cli/index.md

Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
---
2+
description: Install and use the Codacy Cloud CLI to manage your repositories, issues, security findings, pull requests, and tool configurations directly from your terminal.
3+
---
4+
5+
# Codacy Cloud CLI
6+
7+
The Codacy Cloud CLI gives you a fast terminal interface to your Codacy data. Add repositories, review issues, investigate security findings, inspect pull requests, and configure tools—all without opening a browser.
8+
9+
Pair it with [Codacy Skills](#install-the-codacy-skills) to interact with your Codacy data in plain language directly from your AI assistant.
10+
11+
<div style="position: relative; padding-bottom: 61.224489795918366%; height: 0;"><iframe src="https://www.loom.com/embed/1960b3f07f2c419682a1e22e2b2928d1" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;"></iframe></div>
12+
13+
## Installation
14+
15+
Install the CLI using npm:
16+
17+
```bash
18+
npm install -g @codacy/codacy-cloud-cli
19+
```
20+
21+
Alternatively, you can build from source. See the [GitHub repository](https://github.com/codacy/codacy-cloud-cli) for instructions.
22+
23+
## Authentication {: id="authentication"}
24+
25+
Run `codacy login` and enter your API token when prompted. Codacy stores your credentials encrypted at `~/.codacy/credentials`.
26+
27+
```bash
28+
codacy login
29+
```
30+
31+
For non-interactive environments such as CI/CD pipelines, set the `CODACY_API_TOKEN` environment variable instead. This takes precedence over stored credentials.
32+
33+
Get your API token under **My Account > Access Management > API Tokens** in Codacy. See [API tokens](../codacy-api/api-tokens.md) for details.
34+
35+
To remove your stored credentials, run `codacy logout`.
36+
37+
## Install the Codacy Skills {: id="install-the-codacy-skills"}
38+
39+
The [Codacy Skills](https://github.com/codacy/codacy-skills) let your AI assistant interact with your Codacy data in plain language, without needing to remember command syntax:
40+
41+
- "Show me the critical security findings in my org"
42+
- "What issues were introduced in PR #42?"
43+
- "Ignore all false positives in the last pull request"
44+
45+
**Claude Code** (recommended):
46+
47+
```bash
48+
claude plugin marketplace add codacy/codacy-skills
49+
claude plugin install codacy-skills@codacy
50+
```
51+
52+
**Claude.ai**: download the skill folder, zip it, and upload it under **Settings > Capabilities > Skills**.
53+
54+
If you use a different AI assistant, visit the [Codacy Skills repository](https://github.com/codacy/codacy-skills) to install the skills directly.
55+
56+
## What you can do
57+
58+
All commands follow the same pattern:
59+
60+
```bash
61+
codacy <command> <provider> <organization> [repository] [options]
62+
```
63+
64+
Where `<provider>` is `gh` (GitHub), `gl` (GitLab), or `bb` (Bitbucket).
65+
66+
Use `--output json` on any command to get machine-readable output for scripting.
67+
68+
### Manage your repositories
69+
70+
```bash
71+
# List repositories in an organization
72+
codacy repositories gh my-org
73+
74+
# Get a full overview of a specific repository
75+
codacy repository gh my-org my-repo
76+
```
77+
78+
You can also add or remove repositories, follow/unfollow them, link coding standards, and request reanalysis. Use flags like `--add`, `--remove`, and `--reanalyze` on the same command.
79+
80+
### Review code issues
81+
82+
List and filter issues by severity, category, tool, author, or branch:
83+
84+
```bash
85+
# List all issues
86+
codacy issues gh my-org my-repo
87+
88+
# Filter by severity and category
89+
codacy issues gh my-org my-repo --severities Critical,High --categories Security
90+
91+
# Filter by branch or author
92+
codacy issues gh my-org my-repo --branch feature/my-feature --authors dev@example.com
93+
94+
# Show counts only
95+
codacy issues gh my-org my-repo --overview
96+
```
97+
98+
Ignore all issues matching your current filters in one step:
99+
100+
```bash
101+
codacy issues gh my-org my-repo --severities Critical --ignore --ignore-reason FalsePositive
102+
```
103+
104+
Inspect a single issue and ignore or remove the ignore flag:
105+
106+
```bash
107+
codacy issue gh my-org my-repo <issueId> --ignore --ignore-reason AcceptedUse
108+
```
109+
110+
### Investigate security findings
111+
112+
List findings for an organization or a specific repository, with optional filters:
113+
114+
```bash
115+
# Organization-wide findings
116+
codacy findings gh my-org
117+
118+
# Per-repository, filtered by severity
119+
codacy findings gh my-org my-repo --severities Critical,High
120+
121+
# Filter by scan type
122+
codacy findings gh my-org --scan-types SAST,Secrets
123+
codacy findings gh my-org --scan-types SCA,IaC --severities High
124+
```
125+
126+
Findings are tracked with statuses like `Overdue`, `OnTrack`, and `DueSoon`. Use `--statuses` to filter accordingly:
127+
128+
```bash
129+
codacy findings gh my-org --statuses Overdue,DueSoon
130+
```
131+
132+
### Inspect pull requests
133+
134+
```bash
135+
# Get the full analysis summary
136+
codacy pull-request gh my-org my-repo 42
137+
138+
# View an annotated diff with new issues and coverage changes
139+
codacy pull-request gh my-org my-repo 42 --diff
140+
141+
# Ignore all false positives in bulk
142+
codacy pull-request gh my-org my-repo 42 --ignore-all-false-positives
143+
144+
# Trigger reanalysis of the HEAD commit
145+
codacy pull-request gh my-org my-repo 42 --reanalyze
146+
```
147+
148+
### Configure tools and patterns
149+
150+
```bash
151+
# List all tools and see which are enabled
152+
codacy tools gh my-org my-repo
153+
154+
# Enable or disable a tool
155+
codacy tool gh my-org my-repo eslint --enable
156+
codacy tool gh my-org my-repo pylint --disable
157+
158+
# Import tool configuration from .codacy/codacy.config.json
159+
codacy tools gh my-org my-repo --import
160+
```
161+
162+
Bulk-enable or bulk-disable patterns, or set a parameter on a specific pattern:
163+
164+
```bash
165+
# Bulk-enable or bulk-disable by category or severity
166+
codacy patterns gh my-org my-repo eslint --categories Security --enable-all
167+
codacy patterns gh my-org my-repo eslint --severities Minor --disable-all
168+
169+
# Set a parameter on a specific pattern
170+
codacy pattern gh my-org my-repo eslint max-len --enable --parameter max=120
171+
```
172+
173+
!!! note
174+
Tool and pattern changes take effect after the next analysis. Use `--reanalyze` on the repository or pull request command to trigger one immediately.
175+
176+
## Example workflows
177+
178+
### Terminal-first PR review
179+
180+
Before merging, check the full analysis of a pull request (issues, coverage delta, and security findings) without leaving the terminal:
181+
182+
```bash
183+
# See the PR summary
184+
codacy pull-request gh my-org my-repo 42
185+
186+
# See an annotated diff with new issues inline
187+
codacy pull-request gh my-org my-repo 42 --diff
188+
```
189+
190+
### Combine with the GitHub CLI and AI Reviewer
191+
192+
Use the [GitHub CLI](https://cli.github.com/) alongside the Codacy CLI to incorporate feedback from the [AI Reviewer](../repositories-configure/integrations/github-integration.md#ai-reviewer), which posts analysis summaries as PR comments:
193+
194+
```bash
195+
# Read AI Reviewer comments on the PR
196+
gh pr view 42 --comments
197+
198+
# Cross-reference with the Codacy annotated diff
199+
codacy pull-request gh my-org my-repo 42 --diff
200+
```
201+
202+
Feed both outputs to Claude Code (with the Codacy skill installed) to decide what to fix and apply it directly.
203+
204+
### Use the CLI in CI
205+
206+
The CLI works in any CI environment. Set `CODACY_API_TOKEN` as a secret and install the CLI as a step:
207+
208+
{% raw %}
209+
```yaml
210+
- name: Install Codacy Cloud CLI
211+
run: npm install -g @codacy/codacy-cloud-cli
212+
213+
- name: Run Codacy CLI
214+
env:
215+
CODACY_API_TOKEN: ${{ secrets.CODACY_API_TOKEN }}
216+
run: codacy issues gh ${{ github.repository_owner }} my-repo --output json
217+
```
218+
{% endraw %}
219+
220+
From there, pipe the JSON output to `jq`, post results as PR comments with the [GitHub CLI](https://cli.github.com/), open issues, send Slack notifications — whatever fits your workflow.
221+
222+
## See also
223+
224+
- [Codacy Cloud CLI on GitHub](https://github.com/codacy/codacy-cloud-cli)
225+
- [Codacy Skills on GitHub](https://github.com/codacy/codacy-skills)
226+
- [API tokens](../codacy-api/api-tokens.md)
227+
- [Using the Codacy API](../codacy-api/using-the-codacy-api.md)
228+
- [GitHub integration and AI Reviewer](../repositories-configure/integrations/github-integration.md#ai-reviewer)

docs/repositories/issues.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The **Issues page** lists all the issues that Codacy detected in your repository
55
By default, the page lists the issues on the main branch of your repository but if you have [more than one branch enabled](../repositories-configure/managing-branches.md) you can use the drop-down list at the top of the page to display issues on other branches.
66

77
!!! note
8-
[You can use the Codacy API](../codacy-api/examples/obtaining-current-issues-in-repositories.md) to generate reports or obtain information about the current issues in your repositories in a more flexible way.
8+
[You can use the Codacy API](../codacy-api/examples/obtaining-current-issues-in-repositories.md) to generate reports or obtain information about the current issues in your repositories in a more flexible way. You can also list, filter, and manage issues directly from your terminal with the [Codacy Cloud CLI](../codacy-cloud-cli/index.md).
99

1010
![Issues page](images/issues.png)
1111

docs/repositories/pull-requests.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ By default, the page lists open pull requests, but you can click the **Closed**
1313

1414
Click a specific pull request to see detailed information about the code quality changes introduced by that pull request.
1515

16+
!!! tip
17+
You can also inspect pull request analysis, view an annotated diff, and manage issues directly from your terminal using the [Codacy Cloud CLI](../codacy-cloud-cli/index.md).
18+
1619
![Pull request detail](images/pull-requests-detail.png)
1720

1821
The next sections describe each area of the pull request detail page.

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,8 @@ nav:
574574
- codacy-guardrails/codacy-guardrails-limitations.md
575575
- codacy-guardrails/codacy-guardrails-troubleshooting.md
576576
- codacy-guardrails/codacy-guardrails-faq.md
577+
- Codacy Cloud CLI:
578+
- codacy-cloud-cli/index.md
577579
- Codacy AI:
578580
- codacy-ai/codacy-ai.md
579581
- Repositories on Codacy:

0 commit comments

Comments
 (0)