Skip to content

Repository files navigation

Max CLI

npmLicense: MIT

Lead intelligence CLI for developers and AI agents -- Discover leads, manage subscriptions, and automate workflows from the terminal.

The Max CLI provides a command-line interface to the Max API, enabling developers and AI agents to monitor sources (LinkedIn, funding databases, etc.) and discover new leads programmatically.


Installation

npm install -g sortlist-max-cli

For AI Agents

Install the Max skill for your AI agent (Cursor, Claude Code, OpenClaw, etc.):

npx skills add sortlist/max-cli

This installs the SKILL.md which gives your agent full knowledge of the CLI commands, patterns, and workflows.


Authentication

The recommended way to authenticate is the interactive login command:

max login

This prompts for your API key (get it from Settings > API Keys in your dashboard), validates it, and saves it to ~/.max/config.json.

Alternatively, set the MAX_API_KEY environment variable (takes priority over saved config):

export MAX_API_KEY=your_api_key

To remove saved credentials:

max logout

API keys are scoped to your team. Use --business (-b) to specify which business to operate on for leads, subscriptions, and webhooks.


Commands

Signals (catalog)

The signal catalog lists all available monitoring types. This is read-only and public.

# List all signal types
max signals:list
# Get details for a specific signal
max signals:get linkedin-company-engagers

Businesses

Each team can have multiple businesses. All leads, subscriptions, and webhooks are scoped to a business.

# List all businesses in your team
max businesses:list
# Get a business with its Ideal Customer Profile
max businesses:get 1
# Create a business from a website (auto-analyzes name, description, and ICP)
max businesses:create --website https://acme.com
# Create a business manually
max businesses:create --name "Acme Corp" --website https://acme.com
# Create with ICP attributes
max businesses:create --name "Acme Corp" \
--icp '{"target_job_titles":["CTO","VP of Engineering"],"target_locations":["North America"]}'

businesses:create options:

OptionRequiredDescription
--websiteConditionalWebsite URL. If passed alone, auto-analyzes name/description/ICP
--nameConditionalBusiness name (required when not using website-only mode)
--descriptionNoShort description
--icpNoIdeal Customer Profile attributes as JSON string
# Update a business name
max businesses:update 1 --name "New Name"# Update the ICP (include the ICP id from businesses:get response)
max businesses:update 1 --icp '{"id":1,"target_job_titles":["CTO","VP Engineering"]}'

businesses:update options:

OptionDescription
--nameBusiness name
--websiteWebsite URL
--descriptionShort description
--icpICP attributes as JSON string (include id to update existing ICP)

Subscriptions

A subscription is a signal you've activated with a specific configuration (e.g. "Track engagers on Apple's LinkedIn page"). All subscription commands require --business (-b).

# List all subscriptions
max subscriptions:list --business 1
# Get a subscription with stats
max subscriptions:get 42 --business 1
# Create a subscription
max subscriptions:create --business 1 \
--signal linkedin-company-engagers \
--name "Apple Engagers" \
--config '{"linkedin_url":"https://www.linkedin.com/company/apple/"}'# Update a subscription
max subscriptions:update 42 --business 1 --name "Renamed Subscription"# Pause (stops scanning for new leads)
max subscriptions:pause 42 --business 1
# Resume
max subscriptions:resume 42 --business 1
# Delete
max subscriptions:delete 42 --business 1

subscriptions:create options:

OptionRequiredDescription
--businessYesBusiness ID
--signalYesSignal slug from the catalog
--nameYesName for this subscription
--configNoSignal-specific config as JSON string

subscriptions:update options:

OptionDescription
--nameUpdated name
--activeSet active state (true/false)
--configUpdated config as JSON string

Leads

Leads are enriched profiles discovered by your active subscriptions. Each lead includes name, company, LinkedIn URL, email, phone, and more. All lead commands require --business (-b).

# List leads (paginated)
max leads:list --business 1
max leads:list --business 1 --page 2 --per-page 50
# Get a single lead with full details and delivery history
max leads:get 1234 --business 1
# Delete a lead (soft-delete)
max leads:delete 1234 --business 1

leads:list options:

OptionDefaultDescription
--businessBusiness ID (required)
--page1Page number
--per-page25Results per page (max 100)

Webhooks

Register URLs to receive an HTTP POST in real-time whenever a new lead is discovered. All webhook commands require --business (-b).

# List webhooks
max webhooks:list --business 1
# Create a webhook with HMAC signature verification
max webhooks:create --business 1 --url https://example.com/webhook --secret whsec_abc123
# Delete a webhook
max webhooks:delete 10 --business 1

webhooks:create options:

OptionRequiredDescription
--businessYesBusiness ID
--urlYesURL to receive POST requests
--secretNoSecret for HMAC-SHA256 signature verification

All Output is JSON

Every command outputs JSON for easy parsing with jq or consumption by AI agents:

# Get all lead emails
max leads:list --business 1 --per-page 100 | jq '.leads[] | .payload.email'# Get subscription IDs that are active
max subscriptions:list --business 1 | jq '.subscriptions[] | select(.active) | .id'# Count total leads
max leads:list --business 1 | jq '.meta.total_count'# List business names
max businesses:list | jq '.businesses[] | .name'

Common Workflows

Set up a new business and start monitoring

# 1. Create a business from a website (auto-generates ICP)
max businesses:create --website https://acme.com
# 2. Note the business ID from the response, then browse signals
max signals:list
# 3. Create a subscription
max subscriptions:create --business 1 \
--signal linkedin-company-engagers \
--name "Acme Engagers" \
--config '{"linkedin_url":"https://www.linkedin.com/company/acme/"}'# 4. Check for leads
max leads:list --business 1

Pause and resume scanning

max subscriptions:pause 42 --business 1 # Stop scanning
max subscriptions:resume 42 --business 1 # Start scanning again

Set up real-time notifications

# Register a webhook
max webhooks:create --business 1 --url https://my-app.com/signals --secret my_secret
# Verify
max webhooks:list --business 1

Environment Variables

VariableRequiredDescription
MAX_API_KEYNoYour Max API key (overrides saved config from max login)

Error Handling

Exit CodeMeaning
0Success
1Error (message on stderr)
HTTP StatusMeaning
401Missing or invalid API key
404Resource not found
422Validation error
429Rate limited (60 req/min)

Development

git clone https://github.com/sortlist/max-cli.git
cd max-cli
npm install
npm run dev # Watch mode
npm run build # Production build

Project Structure

src/
index.ts # CLI entry point (yargs)
api.ts # ApiClient client class
config.ts # Config management (~/.max/config.json)
commands/
login.ts # login, logout
signals.ts # signals:list, signals:get
businesses.ts # businesses:list, businesses:get, businesses:create, businesses:update
subscriptions.ts # Subscription management
leads.ts # Lead management
webhooks.ts # Webhook management

API Documentation

Full API docs: https://api.yourmax.ai/docs/api


License

MIT


Links

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages