
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
@code-pushup/cli
Advanced tools
šš¬ Quality metrics for your software project. šš
The Code PushUp CLI serves to collect audit results, and optionally upload the report to the Code PushUp portal.
It can be used locally in your repository, or integrated in your CI environment.
If you're looking for programmatic usage, then refer to the underlying @code-pushup/core package instead.
Install as a dev dependency with your package manager:
npm install --save-dev @code-pushup/cli
yarn add --dev @code-pushup/cli
pnpm add --save-dev @code-pushup/cli
Create a code-pushup.config.js configuration file (.ts or .mjs extensions are also supported).
export default {
persist: {
outputDir: '.code-pushup',
format: ['json', 'md'],
},
plugins: [
// ...
],
categories: [
// ...
],
};
Add plugins as per your project needs (e.g. @code-pushup/eslint-plugin).
npm install --save-dev @code-pushup/eslint-plugin
import eslintPlugin from '@code-pushup/eslint-plugin';
export default {
// ...
plugins: [
// ...
await eslintPlugin({ eslintrc: '.eslintrc.js', patterns: ['src/**/*.js'] }),
],
};
Define your custom categories.
export default {
// ...
categories: [
{
slug: 'performance',
title: 'Performance',
refs: [
{
type: 'audit',
plugin: 'eslint',
slug: 'react-jsx-key',
weight: 1,
},
// ...
],
},
// ...
],
};
Run the CLI with npx code-pushup (see --help for list of commands and arguments).
View report file(s) in output directory (specified by persist.outputDir configuration).
If you have access to the Code PushUp portal, provide credentials in order to upload reports.
export default {
// ...
upload: {
server: 'https://ip-or-domain/path/to/portal/api/graphql',
apiKey: process.env.PORTAL_API_KEY,
organization: 'my-org',
project: 'my-project',
},
};
Example for GitHub Actions:
name: Code PushUp
on: push
jobs:
collect-and-upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npm ci
- run: npx code-pushup autorun --upload.apiKey=${{ secrets.PORTAL_API_KEY }}
| Option | Type | Default | Description |
|---|---|---|---|
--progress | boolean | true | Show progress bar in stdout. |
--verbose | boolean | false | When true creates more verbose output. This is helpful when debugging. |
--config | string | code-pushup.config.js | Path to the config file, e.g. code-pushup.config.js |
| Option | Type | Default | Description |
|---|---|---|---|
--persist.outputDir | string | n/a | Directory for the produced reports. |
--persist.filename | string | report | Filename for the produced reports without extension. |
--persist.format | ('json' | 'md')[] | json | Format(s) of the report file. |
--upload.organization | string | n/a | Organization slug from portal. |
--upload.project | string | n/a | Project slug from portal. |
--upload.server | string | n/a | URL to your portal server. |
--upload.apiKey | string | n/a | API key for the portal server. |
--onlyPlugins | string[] | [] | Only run the specified plugins. Applicable to all commands except upload. |
[!NOTE]
All common options, expect--onlyPlugins, can be specified in the configuration file as well. CLI arguments take precedence over configuration file options.
[!NOTE] The
--upload.*group of options is applicable to all commands exceptcollect.
collect commandUsage:
code-pushup collect [options]
Description: The command initializes the necessary plugins, runs them, and then collects the results. After collecting the results, it generates a comprehensive report.
Refer to the Common Command Options for the list of available options.
upload commandUsage:
code-pushup upload [options]
Description: Upload reports to the Code PushUp portal.
Refer to the Common Command Options for the list of available options.
autorun commandUsage:
code-pushup autorun [options]
Description: Run plugins, collect results and upload report to the Code PushUp portal.
Refer to the Common Command Options for the list of available options.
print-config commandUsage:
code-pushup print-config [options]
Description: Print the resolved configuration.
Refer to the Common Command Options for the list of available options.
FAQs
A CLI to run all kinds of code quality measurements to align your team with company goals
The npm package @code-pushup/cli receives a total of 4,412 weekly downloads. As such, @code-pushup/cli popularity was classified as popular.
We found that @code-pushup/cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Ā It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.