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:

Bash
1npm install -g @corebill/cli

Verify the installation:

bashBash
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:

bashBash
1corebill login
2# Paste your API key when prompted

2. Config Command

Set your API key directly:

bashBash
1corebill config set api_key sk_your_api_key_here

3. Environment Variable

Set the COREBILL_API_KEY environment variable:

bashBash
1export COREBILL_API_KEY=sk_your_api_key_here
2corebill companies

Get your API key from the Developers > API Keys section in the Corebill dashboard.

Getting Started

After authentication, select your active company:

bashBash
1# List your companies
2corebill companies
3
4# Select a company
5corebill use <company-id>

You're now ready to manage your billing from the terminal!

Commands

Companies

CommandDescription
corebill companiesList all companies in your organization
corebill use Select active company (by ID or name)

Customers

CommandDescription
corebill customers listList all customers
corebill customers createCreate a new customer (interactive)
corebill customers get Get customer details

Example:

bashBash
1# List customers with search
2corebill customers list --search "acme"
3
4# Create a customer
5corebill customers create
6# Follow the interactive prompts

Invoices

CommandDescription
corebill invoices listList all invoices
corebill invoices createCreate a new invoice (interactive)
corebill invoices get Get invoice details with line items

Example:

bashBash
1# List unpaid invoices
2corebill invoices list --status unpaid
3
4# Get invoice details
5corebill invoices get INV-2026-00001

Quotes

CommandDescription
corebill quotes listList all quotes
corebill quotes createCreate 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.

bashBash
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

bashBash
1# List overdue invoices
2corebill ask "list my overdue invoices"
3
4# Create a quote
5corebill ask "create a quote for Acme Corp for $5000 web development"
6
7# Get analytics
8corebill ask "show me revenue for last month"
9
10# Search customers
11corebill ask "find customers in California"
12
13# Manage Stripe
14corebill ask "list all active Stripe subscriptions"

Conversations

The AI Agent supports multi-turn conversations. Use the --conversation-id flag to continue a previous conversation:

bashBash
1# Start a conversation (save the ID from the output)
2corebill ask "list my customers"
3
4# Continue the conversation
5corebill 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):

jsonJSON
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

FieldDescriptionDefault
api_keyYour Corebill API keyNone (required)
company_idActive company IDNone (set via use command)
api_urlCorebill API base URLhttps://app.corebill.io

Environment Variables

Environment variables override config file values:

VariableOverrides
COREBILL_API_KEYapi_key in config
COREBILL_COMPANY_IDcompany_id in config
COREBILL_API_URLapi_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:

  1. Use the CLI for quick lookups: corebill customers list
  2. Use MCP in Claude Desktop for complex operations: "Create a quote with 3 items for this customer"
  3. Use the CLI AI Agent for conversational queries: corebill ask "what's my top customer this month?"