A premium, feature-rich command-line interface (CLI) for interacting with the LeadDocket API. Built in Rust for maximum speed, security, and portability, it allows administrators, developers, and operators to manage leads, contacts, tasks, lookups, call records, and configurations directly from the terminal or shell scripts.
- Interactive Configuration: Easy-to-use guided setup for credentials.
- Lead & Contact Management: Full access to lead workflows, custom fields, status transitions, attachments, and notes.
- VoIP Integrations: Log call start/end events, retrieve call details, and download call recordings or transcripts.
- Forms & LeadForms: Create, update, and manage fields/invitations for LeadForms.
- Referrals & Expenses: Track operational expenses and incoming/outgoing referral partners.
- Automation Ready: Output structured table layouts for terminal viewing, or pass the global
--jsonflag to retrieve raw JSON payloads.
Ensure you have the Rust toolchain installed. If not, get it from rustup.rs.
To build and install the binary globally on your machine so it can be run from anywhere:
cargo install --path .This compiles the binary in release mode and installs it into ~/.cargo/bin. Make sure ~/.cargo/bin is in your system's PATH variable.
If you only want to compile the binary without installing it globally:
cargo build --releaseThe compiled binary will be available at ./target/release/leaddocket-cli. You can copy or link this binary into your path (e.g., /usr/local/bin).
The CLI needs a LeadDocket API Key and Base URL to communicate with your LeadDocket instance.
Run the following command to set up your configuration interactively:
leaddocket config initThis will prompt you for:
- Lead Docket Base URL (e.g.,
https://yourdomain.leaddocket.com) - API Key
Configuration files are saved securely under your user's standard configuration directory:
- macOS:
~/Library/Application Support/com.leaddocket.leaddocket/config.toml - Linux:
~/.config/leaddocket/config.toml - Windows:
%APPDATA%\leaddocket\config.toml
Alternatively, you can configure the CLI by setting environment variables in your shell or CI/CD pipelines:
export LEADDOCKET_BASE_URL="https://yourdomain.leaddocket.com"
export LEADDOCKET_API_KEY="your-api-key-here"To verify the current active configuration, run:
leaddocket config showRun leaddocket --help to see a full list of commands and global options.
leaddocket [OPTIONS] <COMMAND>-j, --json: Returns raw JSON payloads instead of formatted CLI tables. Perfect for automation scripts (e.g., usingjq).
leaddocket config init: Interactively initialize API credentials.leaddocket config show: Show current configuration status.
leaddocket leads list --status <ID> [options]: List leads.--status <ID>: (Required) Filter by lead status ID (required by API).--sub-status <IDs>: Comma-separated list of sub-status IDs.--page <num>: Page number to retrieve.--limit <num>: Records per page (default: 20).
leaddocket leads get <id> [--detailed]: Retrieve lead profile.leaddocket leads change-status <id> --status-id <id> [--sub-status-id <id>]: Change lead status.leaddocket leads update-fields <id> <fields...>: Update custom fields (e.g.,104=Automated).leaddocket leads add-note <id> --note <content>: Append a note to a lead.leaddocket leads upload-file <id> <path> [--name <custom_name>]: Upload a local file attachment.
leaddocket contacts search <query>: Search contacts (min. 3 characters).leaddocket contacts get <id>: Get contact details.leaddocket contacts add-tag <id> <tag_id>: Add a lookup tag to a contact.leaddocket contacts delete-tag <id> <contact_tag_id>: Remove a tag from a contact.
leaddocket users list: List all active system users.
leaddocket lookups types: List available system lookup categories.leaddocket lookups list <type>: List lookup values (e.g.,LeadSource,CaseType,Statuses,Tags,Offices).
leaddocket tasks list <lead_id>: View tasks for a specific lead.leaddocket tasks create <lead_id> --summary <text> [options]: Create a task on a lead.--details <text>: Detailed description/notes.--task-type <type>: Task type (e.g., Call, File, Form).--user <id>: Assigned user ID.--due <YYYY-MM-DD>: Due date.
leaddocket expenses list [--start <date>] [--end <date>]: List operational/marketing expenses.leaddocket expenses get <id>: Get details of an expense.leaddocket expenses add --amount <num> [options]: Register a new expense.leaddocket expenses delete <id>: Delete an expense record.
leaddocket settlements get <id>: Get detailed settlement details.leaddocket settlements lead <lead_id>: List settlements for a specific lead.leaddocket settlements add <lead_id> [options]: Add a settlement record.
leaddocket calls start <payload>: Register a VoIP call start (accepts JSON string or path to JSON file).leaddocket calls end <payload>: Register a VoIP call end.leaddocket calls get <id>: View details of a registered call event.leaddocket calls download-recording <id> <dest>: Download call audio recording.leaddocket calls download-transcription <id> [<dest>]: Download call transcript (prints to stdout if no dest is provided).
leaddocket forms list: List all LeadForms.leaddocket forms get <id>: View detailed configuration of a LeadForm.leaddocket forms create --case-type-id <id> [options]: Create a new form.leaddocket forms update <id> [options]: Update an existing form's settings.leaddocket forms delete <id>: Delete a LeadForm.leaddocket forms add-field <form_id> --field-id <id> [options]: Add a field to a form.leaddocket forms update-field <form_id> <field_id> [options]: Update form field settings.leaddocket forms delete-field <form_id> <field_id>: Remove a field from a form.leaddocket forms get-invitation <lead_id>: Get LeadForm invitation link for a lead.leaddocket forms create-invitation <lead_id> [--contact-method <method>]: Generate invitation link.
leaddocket referrals list: List referral sources.leaddocket referrals get <id>: View referral details.leaddocket referrals get-by-code <code>: Fetch details by tracker/external code.leaddocket referrals add --name <name> [options]: Add a new referral partner.leaddocket referrals update <id> --name <name> [options]: Update partner details.leaddocket referrals delete <id>: Remove a partner.leaddocket referrals groups: List referral groups.leaddocket referrals practice-areas: List practice areas used on referrals.leaddocket referrals update-code <id> <code>: Update case tracker code.leaddocket referrals update-external-code <id> <ext_code>: Update external code.
Distributed under the MIT License. See LICENSE for more information.