CCI
A cli for fetching the status and full output of CircleCI jobs.
Install
go install github.com/tmessi/cci/cci@latest
Usage
cci
is designed to have sane defaults if run from within cloned git repository. It will examine the current branch, and origin remote to determine which project and branch to use for queries to CircleCI. Thus to check the status of the current branch, just run:
cci
However, it does require a CircleCI Token to authenticate the requests. It is recommended to use the environment variable, CIRCLE_CI_TOKEN
, along with something like direnv.
First create a Personal Access Token and add it to your environment:
export CIRCLE_CI_TOKEN=<personal access token>
Subcommands
Report status
# no subcommand defaults to status
cci
# If you like typing
cci status
# If you like typing, but not too much
cci s
See output of a build
cci output <build number>
cci o <build number>
cci o <workflow name> <job name>
You can then easily pipe the output to other tools:
cci o test build | grep 'FAIL:'
Retry a build
If a build fails for transient reasons, like a network error while installing dependencies, it can be retried:
cci retry <build number>
cci r <build number>
cci r <workflow name> <job name>
For more usage information and flags, see the help:
cci --help
Autocompletion
For bash
copy the .bash_completion
file to /etc/bash_completion.d/
or to a location that is sourced from ~/.bashrc
or ~/.bash_profile
. Or add the contents directly to ~/.bashrc
or ~/.bash_profile
.
For other shells, see the urfave/cli docs. For example for zsh
follow the description here.