You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 16, 2025. It is now read-only.
CodecovCLI is a new way for users to interact with Codecov directly from the user’s terminal or CI platform. Many Codecov features that require the user’s interference can be done via the codecovCLI. It saves commits, creates reports, uploads coverage and has many more amazing features.
5
+
CodecovCLI is a new way for users to interact with Codecov directly from the user’s terminal or CI platform. Many Codecov features that require the user’s interference can be done via the codecovCLI. It saves commits, creates reports, uploads coverage and has many more features.
6
6
7
7
-[Installing](#installing)
8
+
-[Using PIP](#using-pip)
9
+
-[As a Binary](#as-a-binary)
8
10
-[Usage](#usage)
9
11
-[Codecov-cli Commands](#codecov-cli-commands)
10
12
-[create-commit](#create-commit)
@@ -14,28 +16,33 @@ CodecovCLI is a new way for users to interact with Codecov directly from the use
14
16
-[get-report-results](#get-report-results)
15
17
-[pr-base-picking](#pr-base-picking)
16
18
-[How to upload to Codecov](#how-to-upload-to-codecov)
17
-
-[How to Local upload](#how-to-local-upload)
18
-
-[Plugin System](#plugin-system)
19
+
-[How to Use Local Upload](#how-to-use-local-upload)
20
+
-[Work in Progress Features](#work-in-progress-features)
21
+
-[Plugin System](#plugin-system)
22
+
-[Static Analysis](#static-analysis)
19
23
-[Contributions](#contributions)
20
24
-[Requirements](#requirements)
21
25
-[Guidelines](#guidelines)
22
26
-[Releases](#releases)
23
27
24
28
# Installing
25
29
26
-
To use codecov-cli in your local machine, or your CI workflows, you need to install it
30
+
## Using PIP
31
+
To use codecov-cli in your local machine, or your CI workflows, you need to install it:
27
32
28
33
`pip install codecov-cli`
29
34
30
-
The above command will download the latest version of Codecov-cli. If you wish to use a specific version, releases can be viewed [here]().
31
-
You can also find Codecovcli [here](https://cli.codecov.io/) or in the [Github releases](https://github.com/codecov/codecov-cli/releases) where you can download the binary distributable files.
35
+
The above command will download the latest version of Codecov-cli. If you wish to use a specific version, releases can be viewed [here](https://pypi.org/project/codecov-cli/#history).
36
+
37
+
## As a Binary
38
+
If you would like to use the CLI in an environment that does not have access to Python / PIP, you can install the CLI as a compiled binary. Linux and macOS releases can be found [here](https://cli.codecov.io/), along with SHASUMs and signatures for each released version. Binary releases are also available via [Github releases](https://github.com/codecov/codecov-cli/releases) on this repository.
32
39
33
40
# Usage
34
41
If the installation is successful, running `codecovcli --help` will output the available commands along with the different general options that can be used with them.
35
42
```
36
43
Usage: codecovcli [OPTIONS] COMMAND [ARGS]...
37
44
```
38
-
Codecov-cli supports inputs from the user. These inputs, along with their descriptions and usage contexts, are listed in the table below:
45
+
Codecov-cli supports user input. These inputs, along with their descriptions and usage contexts, are listed in the table below:
39
46
40
47
| Input | Description | Usage |
41
48
| :---: | :---: | :---: |
@@ -48,7 +55,7 @@ Codecov-cli supports inputs from the user. These inputs, along with their descri
48
55
# Codecov-cli Commands
49
56
| Command | Description |
50
57
| :---: | :---: |
51
-
| `create-commit` | Saves the commit's metadata in codecov, only need to do it once for a commit
58
+
| `create-commit` | Saves the commit's metadata in codecov, it's only necessry to run this once per commit
52
59
| `create-report` | Creates an empty report in codecov with initial data e.g. report name, report's commit
53
60
| `do-upload` | Searches for and uploads coverage data to codecov
54
61
| `create-report-results` | Used for local upload. It tells codecov that you finished local uploading and want it to calculate the results for you to get them locally.
@@ -150,8 +157,9 @@ Codecov-cli supports inputs from the user. These inputs, along with their descri
In your CI workflow, you need to add these commands:
160
+
# How to Upload to Codecov
161
+
If desired, the CLI can be used as a replacement for our [NodeJS Binary Uploader](https://github.com/codecov/uploader). To use the CLI to upload from your CI workflow, you need to add these commands:
162
+
155
163
```
156
164
pip install codecovcli
157
165
codecovcli create-commit
@@ -160,8 +168,12 @@ codecovcli do-upload
160
168
```
161
169
You can customize the commands with the options aligned with each command.
162
170
163
-
# How to Local upload:
164
-
If you CI workflow takes too much time to run, and you have to wait for it to finish to know the coverage results, you can make your changes locally, make a PR and then run these commands:
171
+
# How to Use Local Upload
172
+
173
+
The CLI also supports "dry run" local uploading. This is useful if you prefer to see Codecov status checks and coverage reporting locally, in your terminal, as opposed to opening a PR and waiting for your full CI to run. Local uploads do not interfere with regular uploads made from your CI for any given commit / Pull Request.
Codecov will calculate the coverage results, and return them in your terminal, telling you whether your PR will fail or pass the coverage check.
175
187
188
+
Note: In order for Local Upload to work, it must be used against a commit on the origin repository. Local Upload does not work for arbitrary diffs or uncommitted changes on your local machine.
189
+
190
+
# Work in Progress Features
191
+
192
+
The following features are somewhat implemented in code, but are not yet meant for use. These features will be documented once they are fully implemented in the CLI.
176
193
177
-
# Plugin System
194
+
##Plugin System
178
195
179
-
In some of the commands, there is a plugin system. For most cases, one might find that changing them is not really needed. But in some cases, have some custom logic run would be beneficial
196
+
To provide extensibility to some of its commands, the CLI makes use of a plugin system. For most cases, the default commands are sufficient. But in some cases, having some custom logic specific to your use case can be beneficial. Note that full documentation of the plugin system is pending, as the feature is still heavily a work in progress.
180
197
198
+
## Static Analysis
181
199
182
-
WIP
200
+
The CLI can perform basic static analysis on Python code today. This static analysis is meant to power more future looking Codecov features and, as such, is not required or in active use today. As more functionality dependent on static analysis becomes available for use, we will document static analysis in detail here.
183
201
184
202
# Contributions
185
203
186
204
## Requirements
187
205
188
-
To start, most of this package is a normal Python package. The main different thing is the static analysis tool that uses both git submodules and c code
206
+
Most of this package is a very conventional Python package. The main difference is the static the CLI's analysis module uses both git submodules and C code
189
207
190
-
Before installing, one should pull the submodules with
208
+
Before installing, one should pull the submodules with:
The c code shouldn't require anything in most places, but it might ask you to install compilers and stuff. Most of the times you can find the instructions online given the error message
219
+
The C code shouldn't require anything additional setup to get running, but depending on your enviroment, you may be prompted to install compilers and supporting tools. If errors are generating during installation, it is likely due to missing dependencies / tools required of the C code. In many cases, resulting error messages should be clear enough to determine what is missing and how to install it, but common errors will be collected here as they are encountered.
202
220
203
221
## Guidelines
204
222
205
-
There are a few guidelines when developing in this systems. We have a few notable folders:
223
+
There are a few guidelines when developing in this systems. Some notable folders:
206
224
207
-
1.`commands` - It's the folder that interacts with the caller. This is where the commands themselves should live. They are not meant to do heavy lifting. They only do wiring, which is mostly parsing the input parameters
208
-
2.`services` - It's where the heavy logic lives. It's mostly organizaed by which command needs them.
209
-
3.`helpers` - This is meant for logic that is probably useful accross different commands. For example, logging helpers, or the logic the searches folders
225
+
1.`commands` - It's the folder that interacts with the caller. This is where the commands themselves should reside. These commands are not meant to do heavy lifting. They only do wiring, which is mostly parsing the input parameters.
226
+
2.`services` - It's where the heavy logic resides. It's mostly organizaed by which command needs them. Commands should generally be thin wrappers around these services.
227
+
3.`helpers` - This is meant for logic that is useful accross different commands. For example, logging helpers, or the logic the searches folders.
210
228
211
229
# Releases
212
230
213
231
The standard way to making a new release is the following:
214
-
1) Open a PR that increases the version number in setup.py. As a rule of thumb, just add one to the micro version (number most to the right).
232
+
1) Open a PR that increases the version number in setup.py. As a rule of thumb, just add one to the micro/patch version (e.g., v0.1.6 -> v0.1.7).
215
233
216
234
2) Get the up-to-date master branch locally and run the `tag.release` command from the Makefile.
217
235
@@ -221,4 +239,4 @@ The version tag must match the regex defined on the Makefile (`tag_regex := ^v([
221
239
222
240
>**Note**: \
223
241
>Releases with `test` word in them are created as `draft`. \
224
-
>Releases with `beta`work in them are created as `pre-release`.
242
+
>Releases with `beta`word in them are created as `pre-release`.
0 commit comments