This is a small CircleCI CLI that allows you to interact with the CircleCI API v2
Project description
CircleCI CLI
Development • Documentation • Contribute • Support
🛠 WIP This is a small CircleCI CLI that allows you to interact with the CircleCI API v2.
Use it!
docker pull lightspeedhq-ls-container-dev.jfrog.io/circleci-cli
docker run -it --rm --volume=$HOME/.config/circleci-cli:/root/.config/circleci-cli lightspeedhq-ls-container-dev.jfrog.io/circleci-cli
bash-5.0# cci --help
Usage: cci [OPTIONS] COMMAND [ARGS]...
Options:
--install-completion [bash|zsh|fish|powershell|pwsh]
Install completion for the specified shell.
--show-completion [bash|zsh|fish|powershell|pwsh]
Show completion for the specified shell, to
copy it or customize the installation.
--help Show this message and exit.
Commands:
config
pipelines
Create an alias
You can also create an alias for cci
in your zsh or bash config:
alias cci='docker pull lightspeedhq-ls-container-dev.jfrog.io/circleci-cli && docker run -it --rm --volume=$HOME/.config/circleci-cli:/root/.config/circleci-cli lightspeedhq-ls-container-dev.jfrog.io/circleci-cli'
Commands
- Display your config:
cci config show
- Create your config file:
# with prompts:
cci config setup
# using flags:
cci config setup --vcs {gh,bb} --org <your-org> --token <circle-ci-api-token>
Note: To create your config you will need to have a Personal CircleCI API Token, that can be created here.
- List the last 20 pipelines for
cci pipelines list <project-name>
- Trigger a build for
<project-name>
using<branch>
cci pipelines trigger <project-name> --branch <branch> [--wait-for-result] [--timeout <min>] [--params key=value,...]
Development
Setup
For development, best create a virtual environment and install all dependencies:
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
Build
You can create a docker image on your local machine by:
docker build . -t circleci-cli
Run
In order to run the build you created on your local machine, run:
docker run -it --rm --volume=$HOME/.config/circleci-cli:/root/.config/circleci-cli circleci-cli
How to Contribute
In order to contribute you just have to have Python installed on your machine. In case you do not have it installed get it from python.org.
Linting Tool
This project is using pre-commit to enable linting and auto-formatting as a pre-commit hook. The hooks are configured in .pre-commit-config.yaml.
To install the hooks you have to run the following command (only once):
. venv/bin/activate
pre-commit install
Then you can trigger all the hooks manually by running:
. venv/bin/activate
pre-commit run --all-files
Additionally on every git commit
the hooks will be triggered and have to pass.
How to run tests
You can run all the tests, by simply running:
. venv/bin/activate
python -m pytest
Support & Feedback
Your contribution is very much appreciated. Feel free to create a PR or an Issue with your suggestions for improvements.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.