Build and test your Chargebee integration from the terminal.
With the Chargebee CLI, you can:
- Work with Chargebee API resources such as customers, subscriptions, invoices, items, and more.
- Stream webhook events directly to your local application.
- Generate runnable SDK code from API commands using
--code-sample.
The Chargebee CLI is available for macOS, Linux, and Windows.
macOS / Linux
curl -fsSL https://raw.githubusercontent.com/chargebee/cli/main/install.sh | bashOn musl-based Linux distributions, install the libstdc++ and libgcc runtime libraries with your package manager first. On Alpine, run apk add --no-cache libstdc++ libgcc. The installer selects the musl build automatically; glibc-based distributions use the standard Linux build.
The installer can also add the Chargebee skill for detected coding agents. To choose agents manually, decline the prompt and run:
chargebee skills add --global --agent cursorRepeat --agent for each agent.
Windows (PowerShell)
irm https://raw.githubusercontent.com/chargebee/cli/main/install.ps1 | iexnpm (requires Node.js 22+)
npm install -g @chargebee/cliVerify the installation:
chargebee --versionUpgrade to the latest version:
chargebee updatePrebuilt binaries are available on the Releases page.
Connect the CLI to your Chargebee site:
chargebee auth addThe CLI prompts for your site name and API key, verifies them, and saves the profile locally.
API keys are stored in macOS Keychain, Linux Secret Service, or Windows Credential Manager when available. Otherwise, they are saved in the local profile file. auth add reports the storage used.
You can also pass credentials directly:
chargebee auth add --site acme-test --api-key test_xxxxxxxxxxxxOr use environment variables:
export CHARGEBEE_SITE=acme-test
export CHARGEBEE_API_KEY=test_xxxxxxxxxxxxCreate API keys from Settings → Configure Chargebee → API Keys in the Chargebee Dashboard.
Write operations are blocked on live sites. Use a test site when building or testing integrations.
Create a customer:
chargebee customer create \
-d email=ada@example.com \
-d first_name=Ada \
-d last_name=Lovelace \
-d auto_collection=offPass request parameters as JSON on stdin with -:
echo '{"email":"ada@example.com","first_name":"Ada","billing_address":{"city":"San Francisco"}}' \
| chargebee customer create -
echo '{"id":{"is":"cbdemo_alex"}}' | chargebee customer list -
echo '{"status":{"in":["active","paused"]}}' | chargebee subscription list -Retrieve the customer:
chargebee customer retrieve <customer-id>API responses are JSON, so standard tools work as expected:
chargebee customer list | jq '.list[].customer.email'API commands print readable JSON by default. Use --json when you need compact output for scripts:
chargebee customer list --json | jq '.list[].customer.id'
chargebee auth status --jsonIn JSON mode, successful commands write JSON to stdout. Failures write a JSON error to stderr.
| Command | Description |
|---|---|
auth |
Add API-key credentials and manage saved profiles. |
whoami |
Show the active site and configuration. |
resources |
List available API resources. |
<resource> <operation> |
Call a Chargebee API. |
docs |
Browse API documentation from the terminal. |
listen |
Forward webhook events to a local URL. |
skills |
Install the Chargebee skill for supported AI coding agents. |
open |
Open Chargebee Dashboard pages. |
feedback |
Share feedback about the CLI. |
alias |
Configure a shell alias for chargebee. |
update |
Update the CLI. |
telemetry |
Manage CLI telemetry. |
Explore commands with:
chargebee --help
chargebee <resource> --help
chargebee <resource> <operation> --helpFor API parameters and operations:
chargebee docs <resource> <operation>Use --code-sample <language> to generate runnable SDK code instead of making the API request:
chargebee customer create \
-d email=ada@example.com \
--code-sample pythonSupported languages include curl, python, nodejs, go, java, php, ruby, and dotnet.
To see all supported languages:
chargebee customer create --code-sample listListen for webhook events and forward them to your local application:
chargebee listen --forward-to http://localhost:3000/webhooksUse --json for machine-readable listener output:
chargebee listen --forward-to http://localhost:3000/webhooks --jsonPress Ctrl+C to stop listening.
Install Chargebee skills for your coding agent:
chargebee skills add --list
chargebee skills add --agent claude-codeUse --global for user-wide installation. See chargebee skills --help and chargebee skills add --help for options.
Remove the CLI using the same installation method you used.
npm
npm uninstall -g @chargebee/climacOS / Linux installer
rm "$(command -v chargebee)"Windows
Remove-Item (Get-Command chargebee).SourceRemove CLI configuration and local state:
rm -rf ~/.chargebee/cliThe Chargebee CLI collects limited usage telemetry to improve the CLI. Opt out with:
chargebee telemetry disableSee TELEMETRY.md for details.
Browse API documentation from the CLI:
chargebee docsFound a bug or have a feature request?
chargebee feedback "what happened"See CONTRIBUTING.md for details on contributing to the Chargebee CLI.