Command line toolkit for operations teams
Project description
chatops
A command line toolkit for operations teams built with Typer.
Installation
Install from PyPI:
pip install chatops
For local development from a cloned repository:
pip install -e .
Run tests with:
./test.sh
Developer setup
git clone https://github.com/example/chatops.git
cd chatops
python -m venv .venv
source .venv/bin/activate
pip install -e .
Docker usage
Build and run the CLI in a container:
docker build -t chatops .
docker run --rm -v $PWD:/app chatops support --help
Usage
Invoke the CLI with the installed entry point:
chatops --help
The command was previously named chatops-toolkit. That legacy name remains
available as an alias, but the recommended entry point is simply chatops.
You can also run the package directly:
python -m chatops --help
Both forms expose the same set of subcommands. Each command is invoked with the
chatops prefix:
chatops deploy– deployment actionschatops logs– view recent logschatops cost– cost management reportschatops incident– incident managementchatops security– security utilitieschatops cve– vulnerability informationchatops iam– IAM utilitieschatops suggest– AI helperschatops explain– AI helperschatops monitor– monitoring checkschatops support– interactive assistantchatops doctor– environment checkschatops env– environment managementchatops cloud– cloud platform helperschatops git– git workflow utilitieschatops docker– Docker commandschatops version– show CLI version
Environment configuration
A sample configuration file is bundled with the project at config.yaml.
Copy or symlink this file to ~/.chatops/config.yaml to get started. If the
home directory file is missing, the CLI automatically falls back to the
repo-local sample. Then define environments in that file:
environments:
local:
provider: local
aws-prod:
provider: aws
gcp-prod:
provider: gcp
Activate one with chatops env use NAME. Each activation creates a sandbox
directory under ~/.chatops/sandboxes/NAME used by commands that interact
with the chosen provider. Commands read the active environment unless
overridden with --env NAME.
Command reference
deploy
chatops deploy deploy APP ENV– trigger a GitHub Actions deployment workflowchatops deploy status– print deploy historychatops deploy rollback APP ENV– rollback to last release
logs
chatops logs SERVICE– show recent log lines for a servicechatops logs live SERVICE– stream live log lineschatops logs grep PATTERN– search log entrieschatops logs tail SERVICE [--lines N]– tail logs (default 50 lines)
cost
chatops cost azure --subscription-id ID– show Azure cost by servicechatops cost forecast– show forecasted monthly spendchatops cost top-spenders– top 5 services by spendchatops cost export [--format csv|json]– export cost data
iam
chatops iam list-admins– list IAM adminschatops iam check-expired– find expired credentialschatops iam audit– show IAM misconfigurations
incident
chatops incident ack INCIDENT_ID– acknowledge an incidentchatops incident who– show on-call rotationchatops incident runbook TOPIC– print SOP for a topicchatops incident report create– generate postmortem template
security
chatops security scan PATH– scan for secretschatops security port-scan HOST– scan open portschatops security whoami– show cloud identity
cve
chatops cve latest– fetch recent CVEschatops cve search --keyword TEXT– search CVEs
suggest
-
chatops suggest PROMPT– suggest best CLI command -
chatops suggest explain TEXT– explain an error message
explain
chatops explain explain TEXT– explain a stack tracechatops explain autofix FILE– suggest code improvements
monitor
chatops monitor uptime URL– check service uptimechatops monitor latency [--threshold MS]– simulate latency alert
support
chatops support– launch interactive assistant (prompts forOPENAI_API_KEYif needed)
doctor
chatops doctor– verify required tools are installed
env
chatops env use NAME– activate NAMEchatops env current– show the active environmentchatops env list– list configured environmentschatops env status– check auth for active environmentchatops env exit– deactivate the active environment
generate
chatops generate terraform RESOURCE– create Terraform configchatops generate dockerfile– produce a Dockerfilechatops generate github-actions– create CI workflow
agent
chatops agent run "if CPU > 80% -> scale"– autonomous actions
test
chatops test write --file app.py– generate testschatops test run– run all tests
compliance
chatops compliance scan --profile cmmc– simulate compliance checks
metrics
chatops metrics latency --service api– show latency metrics
insight
chatops insight top-errors --window 1h– recent log errors
feedback
chatops feedback --last up– rate previous response
version
chatops version– show CLI version
Example commands
Deploy an application (requires GITHUB_TOKEN and GITHUB_REPOSITORY):
chatops deploy deploy myapp prod
Tail logs for a service:
chatops logs myservice
Generate an Azure cost report for a subscription:
chatops cost azure --subscription-id <SUBSCRIPTION_ID>
Show on-call rotation:
chatops incident who
Run a security scan:
chatops security scan .
Show recent pull requests for a repo:
chatops pr status owner/repo
Display command history:
chatops history show
Display high or critical CVEs published in the last week:
chatops cve latest
Suggest a CLI Command
suggest_command maps natural language requests to a CLI command and requires OPENAI_API_KEY:
from chatops import suggest_command
cmd = suggest_command("restart app on prod")
print(cmd)
Plugins
Custom commands can be added by dropping *.py files in ~/.chatops/plugins
or .chatops/plugins within a project. Each plugin should expose a Typer
app object. The CLI loads them automatically at startup and reports any
errors encountered during loading.
Contributing
See CONTRIBUTING.md for the full contributor guide.
- Fork the repository and create a virtual environment.
- Install in editable mode with
pip install -e .. - Run
./test.shbefore submitting a pull request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chatops-0.9.2.tar.gz.
File metadata
- Download URL: chatops-0.9.2.tar.gz
- Upload date:
- Size: 29.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e7e868d7cb31a23799479e01aba41e224eeab13a8ce5f7c10391144e7f6e6d0
|
|
| MD5 |
6fa39bb12627e4a0cea73118f2ce9734
|
|
| BLAKE2b-256 |
6a25dafad8844bd4fca360d0e794c4d31672bc4f7408b33852dcc3b4ee052346
|
Provenance
The following attestation bundles were made for chatops-0.9.2.tar.gz:
Publisher:
publish.yml on cloudcwfranck/chatops
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chatops-0.9.2.tar.gz -
Subject digest:
7e7e868d7cb31a23799479e01aba41e224eeab13a8ce5f7c10391144e7f6e6d0 - Sigstore transparency entry: 247581195
- Sigstore integration time:
-
Permalink:
cloudcwfranck/chatops@423472aff062d30cbbcf84b78ebded6479edf6aa -
Branch / Tag:
refs/heads/main - Owner: https://github.com/cloudcwfranck
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@423472aff062d30cbbcf84b78ebded6479edf6aa -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file chatops-0.9.2-py3-none-any.whl.
File metadata
- Download URL: chatops-0.9.2-py3-none-any.whl
- Upload date:
- Size: 46.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e7a2943e7f88d08bf0f7b5a5b567373e9ea076b73db83fe3cdc95497d326ebc
|
|
| MD5 |
04b305efcc7edd0d75cd372c11698f8d
|
|
| BLAKE2b-256 |
18428138f0dc0d3fe79bb44a5b8541b138e6d794afd4f1e48fe6008f4fab6838
|
Provenance
The following attestation bundles were made for chatops-0.9.2-py3-none-any.whl:
Publisher:
publish.yml on cloudcwfranck/chatops
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chatops-0.9.2-py3-none-any.whl -
Subject digest:
8e7a2943e7f88d08bf0f7b5a5b567373e9ea076b73db83fe3cdc95497d326ebc - Sigstore transparency entry: 247581205
- Sigstore integration time:
-
Permalink:
cloudcwfranck/chatops@423472aff062d30cbbcf84b78ebded6479edf6aa -
Branch / Tag:
refs/heads/main - Owner: https://github.com/cloudcwfranck
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@423472aff062d30cbbcf84b78ebded6479edf6aa -
Trigger Event:
workflow_dispatch
-
Statement type: