CarbonCue CLI
Terminal interface for carbon-aware development.
Installation
pip install carboncue-cli
Commands
Check Carbon Intensity
Get current carbon intensity for a cloud region:
# AWS US West 2
carboncue check --region us-west-2 --provider aws
# Azure West Europe
carboncue check --region westeurope --provider azure
# Short form
carboncue check -r us-east-1 -p aws
Calculate SCI Score
Calculate Software Carbon Intensity (SCI) score:
carboncue sci \
--operations 100 \
--materials 50 \
--functional-unit 1000 \
--unit-type requests \
--region us-west-2
# Short form
carboncue sci -o 100 -m 50 -r 1000 -t requests
Parameters:
--operations, -o: Operational emissions in gCO2eq (energy usage)--materials, -m: Embodied emissions in gCO2eq (hardware)--functional-unit, -r: Number of functional units--unit-type, -t: Type of functional unit (requests, users, transactions, etc.)--region: Cloud region (default: us-west-2)--provider, -p: Cloud provider (aws, azure, gcp, etc.)
View Configuration
carboncue config
Configuration
Set environment variables:
export CARBONCUE_ELECTRICITY_MAPS_API_KEY=your_api_key
export CARBONCUE_DEFAULT_REGION=us-west-2
export CARBONCUE_DEFAULT_CLOUD_PROVIDER=aws
Or create a .env file in your project:
CARBONCUE_ELECTRICITY_MAPS_API_KEY=your_api_key
CARBONCUE_DEFAULT_REGION=us-west-2
Examples
CI/CD Integration
# Check if carbon intensity is low before running expensive tests
INTENSITY=$(carboncue check -r us-west-2 -p aws --json | jq '.carbon_intensity')
if [ $INTENSITY -lt 200 ]; then
echo "Low carbon intensity - running full test suite"
pytest
else
echo "High carbon intensity - deferring non-critical tests"
pytest -m critical
fi
Monitoring Scripts
#!/bin/bash
# monitor-carbon.sh - Check carbon intensity every hour
while true; do
carboncue check -r us-west-2 -p aws
sleep 3600
done
Output Formats
All commands support rich terminal output with colors and tables for better readability.
License
MIT License - see LICENSE file for details.
Metadata
Release files for carboncue-cli 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| carboncue_cli-1.1.0.tar.gz | 4.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| carboncue_cli-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.8 kB
Release files / carboncue_cli-1.1.0.tar.gz
| Download URL | carboncue_cli-1.1.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f6e9de40b2893107cb2b85e402b5082468957d7530ad6e3b3f235b5f026d20ee
|
|
BLAKE2b-256 checksum How to use checksums |
7ec959bd12a5ce0736ede692cf23820ebb2be9cf7f004ad30f754818a58dd381
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / carboncue_cli-1.1.0-py3-none-any.whl
| Download URL | carboncue_cli-1.1.0-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2de3665a7c144455e22d7ec0c460f26e4e1b2a66072d92fb98a073874015ffda
|
|
BLAKE2b-256 checksum How to use checksums |
5fa581955e8220d3302e7c263b50576c8c3d320f427967c6999e737ac6ea754b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|