chartbrew is an agent-first CLI for the Chartbrew API. It is built for scripts and AI agents that need structured, non-interactive access to teams, dashboards, connections, datasets, data requests, and charts.
make build # Builds bin/chartbrew
make test # Runs go test -v ./...
make vet # Runs go vet ./...
make fmt # Formats Go source
make tidy # Updates module metadataGitHub Actions runs go test and go vet on every push and pull request. Pushing a version tag matching v* (for example v0.1.0) runs GoReleaser, which creates a GitHub release with archives and updates the Homebrew tap repository.
One-time setup:
- Create an empty GitHub repository named
homebrew-tapunder the same owner as this project (for examplehttps://github.com/ba0f3/homebrew-tap), default branchmain. - In this repository’s GitHub Settings → Secrets and variables → Actions, add
HOMEBREW_TAP_GITHUB_TOKEN: a personal access token with Contents: Read and write on that tap repository (the defaultGITHUB_TOKENcannot push to another repo).
Then tag and push:
git tag v0.1.0
git push origin v0.1.0Install from the tap. GoReleaser publishes prebuilt binaries via Homebrew’s cask mechanism (replacing the old brews path); the CLI is still command-line only:
brew tap ba0f3/tap
brew install --cask chartbrewTo dry-run a release locally:
goreleaser release --snapshot --cleanConfiguration resolves in this priority order:
- CLI flags
- Environment variables
.envin the current working directory~/.config/chartbrew/config.json
Supported environment variables:
export CHARTBREW_API_URL="https://api.chartbrew.com"
export CHARTBREW_TOKEN="your-api-token"Config file example:
{
"base_url": "https://api.chartbrew.com",
"token": "your-api-token",
"output": "json",
"allow_delete": false
}Global flags:
chartbrew --base-url https://api.chartbrew.com --token "$CHARTBREW_TOKEN" --output json teams list
chartbrew --config ./chartbrew.json teams listPrefer CHARTBREW_TOKEN, .env, or the config file for tokens. The --token flag exists for automation override, but command-line secrets can be stored in shell history.
All commands write structured JSON by default. Use --output markdown for a fenced JSON block or --output raw for compact JSON.
Teams:
chartbrew teams list
chartbrew teams get --team-id 123
chartbrew teams create --data '{"name":"Demo"}'
chartbrew teams update --team-id 123 --data-file team.jsonDashboards use Chartbrew project API endpoints:
chartbrew dashboards list --team-id 123
chartbrew dashboards get --dashboard-id 456
chartbrew dashboards create --data-file dashboard.json
chartbrew dashboards update --dashboard-id 456 --data-file dashboard.json
chartbrew dashboards delete --dashboard-id 456Connections:
chartbrew connections list --team-id 123
chartbrew connections get --team-id 123 --connection-id 456
chartbrew connections create --team-id 123 --data-file connection.json
chartbrew connections update --team-id 123 --connection-id 456 --data-file connection.jsonDatasets:
chartbrew datasets list --team-id 123
chartbrew datasets get --team-id 123 --dataset-id 456
chartbrew datasets create --team-id 123 --data-file dataset.json
chartbrew datasets update --team-id 123 --dataset-id 456 --data-file dataset.json
chartbrew datasets delete --team-id 123 --dataset-id 456Data requests:
chartbrew data-requests list --team-id 123 --dataset-id 456
chartbrew data-requests get --team-id 123 --dataset-id 456 --request-id 789
chartbrew data-requests create --team-id 123 --dataset-id 456 --data-file request.json
chartbrew data-requests update --team-id 123 --dataset-id 456 --request-id 789 --data-file request.jsonCharts:
chartbrew charts list --dashboard-id 456
chartbrew charts get --dashboard-id 456 --chart-id 789
chartbrew charts create --dashboard-id 456 --data-file chart.json
chartbrew charts update --dashboard-id 456 --chart-id 789 --data-file chart.json
chartbrew charts delete --dashboard-id 456 --chart-id 789Create and update commands accept exactly one body source:
chartbrew teams create --data '{"name":"Demo"}'
chartbrew datasets create --team-id 123 --data-file dataset.json
printf '%s' '{"name":"Demo"}' | chartbrew teams create --data-file -The CLI validates JSON before sending the request.
Delete commands are available only for Chartbrew endpoints documented as deletable: dashboards, datasets, and charts.
Delete execution is disabled by default. To allow deletes, set allow_delete to true in the JSON config file:
{
"base_url": "https://api.chartbrew.com",
"token": "your-api-token",
"output": "json",
"allow_delete": true
}The delete opt-in is config-file-only. CLI flags, environment variables, and .env cannot enable delete execution.