A wrapper for getting insights data from the CircleCI insights api
This repository is still in the early stages, and will change significantly.
Please clone the the project by running the following command:
git clone https://github.com/ogii/circleci-insights-cli.git
Next you will need to either build the application with go build
or install it globally with go install
.
Lastly you will need to create a .env file in the following format in the directory ~/.goinsightscli/.env
:
CIRCLECI_TOKEN=
API_URL=https://circleci.com/api/v2
Alternatively, these values can also be set as environment variables.
To get a list of summary metrics for a project on the master branch in a list format:
project-workflow-summary --slug gh/ogii/circleci-insights-cli --format table
Output:
Options:
option | default | required | sample values |
---|---|---|---|
--slug | yes | gh/orgname/repositoryname | |
--branch | main | no | main |
--format | list | no | list table csv json |
--reportingWindow | last-90-days | no | last-7-days last-90-days last-24-hours last-30-days last-60-days |
--output | directory of binary | no (only for csv format) | ~/insightsoutput |
To get the summary metrics for jobs in a specific workflow:
circleci-insights-cli get workflow-job-summary --slug gh/ogii/sampleproject --workflow test-testworkflow --branch master --format list
option | default | required | sample values |
---|---|---|---|
--slug | yes | gh/orgname/repositoryname | |
--workflow | yes | workflow1 | |
--branch | main | no | main |
--format | list | no | list table csv json |
--reportingWindow | last-90-days | no | last-7-days last-90-days last-24-hours last-30-days last-60-days |
--output | directory of binary | no (only for csv format) | ~/insightsoutput |