Skip to content

calljacob/leaddocket-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeadDocket CLI

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.


Features

  • 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 --json flag to retrieve raw JSON payloads.

Installation

Prerequisites

Ensure you have the Rust toolchain installed. If not, get it from rustup.rs.

Install Globally (Recommended)

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.

Build from Source (Alternative)

If you only want to compile the binary without installing it globally:

cargo build --release

The 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).


Configuration

The CLI needs a LeadDocket API Key and Base URL to communicate with your LeadDocket instance.

1. Interactive Initialization

Run the following command to set up your configuration interactively:

leaddocket config init

This 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

2. Environment Variables

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 show

Usage

Run leaddocket --help to see a full list of commands and global options.

leaddocket [OPTIONS] <COMMAND>

Global Options

  • -j, --json: Returns raw JSON payloads instead of formatted CLI tables. Perfect for automation scripts (e.g., using jq).

Commands Reference

1. Configuration

  • leaddocket config init: Interactively initialize API credentials.
  • leaddocket config show: Show current configuration status.

2. Leads

  • 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.

3. Contacts

  • 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.

4. Users

  • leaddocket users list: List all active system users.

5. Lookups

  • leaddocket lookups types: List available system lookup categories.
  • leaddocket lookups list <type>: List lookup values (e.g., LeadSource, CaseType, Statuses, Tags, Offices).

6. Tasks

  • 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.

7. Expenses

  • 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.

8. Settlements

  • 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.

9. VoIP Calls

  • 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).

10. LeadForms

  • 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.

11. Referral Partners

  • 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.

License

Distributed under the MIT License. See LICENSE for more information.

About

A cli tool for leaddocket.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors