Skip to content
/ cci Public

Show status and output from CircleCI

License

Notifications You must be signed in to change notification settings

tmessi/cci

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CCI

CircleCI test lint

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

To see multiple pipeline runs used the --limit|-l flag:

cci --limit 5
cci -l 5
cci --limit 5 status
cci -l 5 status
cci --limit 5 s
cci -l 5 s

See output of a job

cci output <job number>
cci o <job 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 workflow

If a job fails for transient reasons, like a network error while installing dependencies, it can be retried:

cci retry <workflow name>
cci r <workflow 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.

Releases

No releases published

Packages

No packages published