22
33A command-line tool to interact with [ Codacy Cloud] ( https://app.codacy.com ) directly from your terminal. Built with Node.js and TypeScript.
44
5- ## Setup
5+ ## Installation
6+
7+ ### From npm
8+
9+ ``` bash
10+ npm install -g codacy-cloud-cli
11+ ```
12+
13+ ### From source
614
715``` bash
16+ git clone https://github.com/alerizzo/codacy-cloud-cli.git
17+ cd codacy-cloud-cli
818npm install
19+ npm run build
20+ npm link
921```
1022
23+ ## Authentication
24+
1125Set your Codacy API token as an environment variable:
1226
1327``` bash
@@ -19,12 +33,7 @@ You can get a token from **Codacy > My Account > Access Management > Account API
1933## Usage
2034
2135``` bash
22- # Run in development mode
23- npx ts-node src/index.ts < command>
24-
25- # Or build and run
26- npm run build
27- npm start -- < command>
36+ codacy-cloud-cli < command> [options]
2837```
2938
3039### Global Options
@@ -106,19 +115,24 @@ codacy-cloud-cli pull-request gh my-org my-repo 42 --output json
106115Displays:
107116- ** About** -- PR title, status, author, branches, head commit
108117- ** Analysis** -- up-to-standards status, issues, coverage, complexity, duplication with gate pass/fail details
109- - ** New Issues** -- issues introduced by the PR, sorted by severity, with file path, line content, and detection tool
110- - ** New Potential Issues** -- potential issues that may need review
118+ - ** Issues** -- issues introduced by the PR, sorted by severity, with file path and line content
111119- ** Files** -- changed files with metric deltas (issues, coverage, complexity, duplication)
112120
113121## Development
114122
115123``` bash
124+ # Run in development mode
125+ npx ts-node src/index.ts < command>
126+
116127# Run tests
117128npm test
118129
119130# Type-check without emitting
120131npx tsc --noEmit
121132
133+ # Build for production
134+ npm run build
135+
122136# Update the auto-generated API client
123137npm run update-api
124138```
@@ -129,10 +143,22 @@ npm run update-api
129143src/
130144 index.ts # CLI entry point (Commander.js)
131145 commands/ # One file per command
132- utils/ # Shared utilities (auth, error handling, output formatting)
146+ utils/ # Shared utilities (auth, error handling, output, formatting)
133147 api/client/ # Auto-generated API client (do not edit)
134148```
135149
150+ ### CI/CD
151+
152+ - ** CI** : Runs on every push to ` main ` and on PRs. Builds and tests across Node.js 18, 20, and 22.
153+ - ** Publish** : Triggered on GitHub release creation. Builds, tests, and publishes to npm with provenance.
154+
155+ To publish a new version:
156+ 1 . Update the version in ` package.json `
157+ 2 . Create a GitHub release with a tag matching the version (e.g. ` v1.1.0 ` )
158+ 3 . The publish workflow will automatically build and push to npm
159+
160+ ** Prerequisite** : Add an ` NPM_TOKEN ` secret to your GitHub repository settings.
161+
136162## License
137163
138164ISC
0 commit comments