CLI
Manage your billing platform from the terminal with the Corebill command-line interface.
Overview
The Corebill CLI (@corebill/cli) lets you manage your entire billing platform from the terminal. Create customers, invoices, quotes, and interact with the AI Agent using simple commands.
Perfect for developers who prefer the command line, automation workflows, or quick operations without opening the dashboard.
Installation
Install the CLI globally via npm:
1npm install -g @corebill/cli
Verify the installation:
1corebill --version
Authentication
The CLI requires an API key to authenticate. You can provide it in three ways:
1. Interactive Login
Run the login command and paste your API key:
1corebill login2# Paste your API key when prompted
2. Config Command
Set your API key directly:
1corebill config set api_key sk_your_api_key_here
3. Environment Variable
Set the COREBILL_API_KEY environment variable:
1export COREBILL_API_KEY=sk_your_api_key_here2corebill companies
Get your API key from the Developers > API Keys section in the Corebill dashboard.
Getting Started
After authentication, select your active company:
1# List your companies2corebill companies34# Select a company5corebill use <company-id>
You're now ready to manage your billing from the terminal!
Commands
Companies
| Command | Description |
|---|---|
corebill companies | List all companies in your organization |
corebill use | Select active company (by ID or name) |
Customers
| Command | Description |
|---|---|
corebill customers list | List all customers |
corebill customers create | Create a new customer (interactive) |
corebill customers get | Get customer details |
Example:
1# List customers with search2corebill customers list --search "acme"34# Create a customer5corebill customers create6# Follow the interactive prompts
Invoices
| Command | Description |
|---|---|
corebill invoices list | List all invoices |
corebill invoices create | Create a new invoice (interactive) |
corebill invoices get | Get invoice details with line items |
Example:
1# List unpaid invoices2corebill invoices list --status unpaid34# Get invoice details5corebill invoices get INV-2026-00001
Quotes
| Command | Description |
|---|---|
corebill quotes list | List all quotes |
corebill quotes create | Create a new quote (interactive) |
corebill quotes get | Get quote details with line items |
AI Chat
The most powerful command: interact with the Corebill AI Agent directly from your terminal.
1corebill ask "your question or command"
The AI Agent can do everything the dashboard agent does:
- Create and manage customers, invoices, quotes
- Search and analyze data
- Get analytics and reports
- Manage Stripe subscriptions
- Record payments
- Convert quotes to invoices
Examples
1# List overdue invoices2corebill ask "list my overdue invoices"34# Create a quote5corebill ask "create a quote for Acme Corp for $5000 web development"67# Get analytics8corebill ask "show me revenue for last month"910# Search customers11corebill ask "find customers in California"1213# Manage Stripe14corebill ask "list all active Stripe subscriptions"
Conversations
The AI Agent supports multi-turn conversations. Use the --conversation-id flag to continue a previous conversation:
1# Start a conversation (save the ID from the output)2corebill ask "list my customers"34# Continue the conversation5corebill ask "show me invoices for the first customer" --conversation-id aicv_abc123
The AI Agent has access to your entire catalog, customer data, and billing history. Ask complex questions in natural language!
Configuration
The CLI stores configuration in ~/.corebillrc (JSON format):
1{2 "api_key": "sk_your_api_key",3 "company_id": "com_your_company_id",4 "api_url": "https://app.corebill.io"5}
Configuration Fields
| Field | Description | Default |
|---|---|---|
api_key | Your Corebill API key | None (required) |
company_id | Active company ID | None (set via use command) |
api_url | Corebill API base URL | https://app.corebill.io |
Environment Variables
Environment variables override config file values:
| Variable | Overrides |
|---|---|
COREBILL_API_KEY | api_key in config |
COREBILL_COMPANY_ID | company_id in config |
COREBILL_API_URL | api_url in config |
CLI + MCP Integration
The CLI works great alongside the MCP server. Use the CLI for quick terminal operations and the MCP server for AI-assisted workflows in your IDE or AI client.
Workflow example:
- Use the CLI for quick lookups:
corebill customers list - Use MCP in Claude Desktop for complex operations: "Create a quote with 3 items for this customer"
- Use the CLI AI Agent for conversational queries:
corebill ask "what's my top customer this month?"