LeadGenius CLI Skill
Operate the LeadGenius Pro B2B platform from the command line. This skill provides the lgp CLI for lead management, enrichment, AI scoring, pipeline automation, user provisioning, and more.
Setup
Install the CLI globally:
npm install -g leadgenius-cli
Set the API key (persists across sessions):
lgp config set api-key lgp_YOUR_KEY_HERE
lgp auth test
Credentials are saved to ~/.leadgenius-cli/session.json and auto-loaded on subsequent runs.
Core Workflows
Search and list leads
# Smart search — auto-detects email, name, or URL, case-insensitive
lgp leads search -q "Jane Doe"
lgp leads search -q "user@example.com"
# List leads for a client (shows interactive client picker if -c omitted)
lgp leads list
lgp leads list -c <client-id> --limit 20
Import leads from CSV
lgp leads import --file leads.csv
CSV headers map directly to API fields: firstName, lastName, email, companyName, title, linkedinUrl, etc. The CLI prompts for client selection.
Enrich, score, and generate AI content
lgp tasks enrich --lead <id>
lgp tasks score --lead <id>
lgp tasks copyright --lead <id>
Run FSD pipeline (full automation)
lgp fsd run -c <client> --icp <id> --enrich --score
lgp fsd status <pipelineId>
lgp fsd campaigns
Provision a new user for UI login at last.leadgenius.app
# Creates Cognito user + CompanyUser + optional API key
lgp users provision -e user@example.com -p "SecurePass123!" --company-id <id> --role admin --group admin
# Set UI access (requires admin key)
lgp cognito set-attributes -e user@example.com --attributes '{"custom:allowed_views":"role:companyAdmin|*"}'
Manage territory companies
lgp companies list -c <client>
lgp companies leads <companyId>
lgp companies content-analysis <companyId>
lgp companies aggregate -c <client>
lgp companies events radar
EpsimoAI credits and threads
In TUI mode (lgp with no args), EpsimoAI authenticates automatically via Cognito token exchange. In CLI mode:
lgp epsimo activate --cognito-token <jwt>
lgp epsimo info -t <token>
lgp epsimo credits -t <token>
lgp epsimo threads -t <token>
Report bugs and request features
lgp maintenance bugs report --desc "Description of the issue" --email dev@company.com
lgp maintenance enhancements request --desc "Feature idea" --email dev@company.com
lgp maintenance bugs list
All Command Groups
| Group |
Description |
Key Commands |
auth |
Test connection |
auth test |
leads |
Lead CRUD, search, import, dedup |
list, search -q, import --file, dedup |
tasks |
Background jobs |
enrich, score, copyright |
fsd |
Full-Stack Demand pipeline |
run, campaigns, status |
companies |
Territory intelligence |
list, leads, aggregate, events |
users |
User management |
list, create, provision, menu-config |
org |
Company management |
list, create, rename, add-user |
cognito |
Cognito user pool (admin) |
list, get, create, set-attributes |
epsimo |
EpsimoAI integration |
activate, info, credits, threads |
tables |
Generic CRUD for any table |
list <Table>, create, update, delete |
generate |
Lead generation |
from-icp, direct, schedule |
campaigns |
ABM campaigns |
list, create |
clients |
Client management |
list, create |
shares |
Shared links |
create, extend, revoke |
webhooks |
Inbound events |
list, get, reprocess |
maintenance |
Bugs & enhancements |
bugs list/report, enhancements list/request |
pipeline |
Analytics |
--start --end |
account-analysis |
Account intelligence |
list, analyze, export |
admin |
Backups, PITR, system |
backup, pitr, org-tree, views |
config |
Session management |
show, set, get, reset |
Output Format
By default, the CLI shows smart-formatted output with tables, colors, and progress bars. Use --format json for raw JSON (useful for piping to jq or scripts):
lgp leads list -c <id> --format json | jq '.data[].email'
Interactive TUI
Launch with no arguments for a menu-driven interface:
lgp
The TUI provides client picker dropdowns, auto-authentication for EpsimoAI, and all commands accessible via menus.
API Base URL
https://api.leadgenius.app/api/automation/
Environment Variables
| Variable |
Description |
LGP_API_KEY |
API key (lgp_ prefix) |
LGP_URL |
Base URL (default: https://api.leadgenius.app) |
LGP_ADMIN_KEY |
Admin key for cognito/admin commands |
Reference Docs
- Full CLI README
- API Endpoints — all REST endpoints with request/response examples
- CLI Reference — detailed flag documentation
- Workflows — step-by-step business workflows
- Use Cases — end-to-end scenarios
1---2name: leadgenius-cli3description: Manage B2B leads, enrichment, AI scoring, and sales automation via the LeadGenius Pro platform. Use when the user asks to find leads, enrich contacts, score prospects, manage campaigns, import CSV leads, provision users, run FSD pipelines, check EpsimoAI credits, manage territory companies, or interact with the LeadGenius API. Also use when the user mentions "lgp", "LeadGenius", "lead enrichment", "lead scoring", "ICP", "FSD pipeline", "territory companies", or "EpsimoAI".4license: See LICENSE file in repository root5---67# LeadGenius CLI Skill89Operate the LeadGenius Pro B2B platform from the command line. This skill provides the `lgp` CLI for lead management, enrichment, AI scoring, pipeline automation, user provisioning, and more.1011## Setup1213Install the CLI globally:1415```bash16npm install -g leadgenius-cli17```1819Set the API key (persists across sessions):2021```bash22lgp config set api-key lgp_YOUR_KEY_HERE23lgp auth test24```2526Credentials are saved to `~/.leadgenius-cli/session.json` and auto-loaded on subsequent runs.2728## Core Workflows2930### Search and list leads3132```bash33# Smart search — auto-detects email, name, or URL, case-insensitive34lgp leads search -q "Jane Doe"35lgp leads search -q "user@example.com"3637# List leads for a client (shows interactive client picker if -c omitted)38lgp leads list39lgp leads list -c <client-id> --limit 2040```4142### Import leads from CSV4344```bash45lgp leads import --file leads.csv46```4748CSV headers map directly to API fields: `firstName`, `lastName`, `email`, `companyName`, `title`, `linkedinUrl`, etc. The CLI prompts for client selection.4950### Enrich, score, and generate AI content5152```bash53lgp tasks enrich --lead <id>54lgp tasks score --lead <id>55lgp tasks copyright --lead <id>56```5758### Run FSD pipeline (full automation)5960```bash61lgp fsd run -c <client> --icp <id> --enrich --score62lgp fsd status <pipelineId>63lgp fsd campaigns64```6566### Provision a new user for UI login at last.leadgenius.app6768```bash69# Creates Cognito user + CompanyUser + optional API key70lgp users provision -e user@example.com -p "SecurePass123!" --company-id <id> --role admin --group admin7172# Set UI access (requires admin key)73lgp cognito set-attributes -e user@example.com --attributes '{"custom:allowed_views":"role:companyAdmin|*"}'74```7576### Manage territory companies7778```bash79lgp companies list -c <client>80lgp companies leads <companyId>81lgp companies content-analysis <companyId>82lgp companies aggregate -c <client>83lgp companies events radar84```8586### EpsimoAI credits and threads8788In TUI mode (`lgp` with no args), EpsimoAI authenticates automatically via Cognito token exchange. In CLI mode:8990```bash91lgp epsimo activate --cognito-token <jwt>92lgp epsimo info -t <token>93lgp epsimo credits -t <token>94lgp epsimo threads -t <token>95```9697### Report bugs and request features9899```bash100lgp maintenance bugs report --desc "Description of the issue" --email dev@company.com101lgp maintenance enhancements request --desc "Feature idea" --email dev@company.com102lgp maintenance bugs list103```104105## All Command Groups106107| Group | Description | Key Commands |108|-------|-------------|-------------|109| `auth` | Test connection | `auth test` |110| `leads` | Lead CRUD, search, import, dedup | `list`, `search -q`, `import --file`, `dedup` |111| `tasks` | Background jobs | `enrich`, `score`, `copyright` |112| `fsd` | Full-Stack Demand pipeline | `run`, `campaigns`, `status` |113| `companies` | Territory intelligence | `list`, `leads`, `aggregate`, `events` |114| `users` | User management | `list`, `create`, `provision`, `menu-config` |115| `org` | Company management | `list`, `create`, `rename`, `add-user` |116| `cognito` | Cognito user pool (admin) | `list`, `get`, `create`, `set-attributes` |117| `epsimo` | EpsimoAI integration | `activate`, `info`, `credits`, `threads` |118| `tables` | Generic CRUD for any table | `list <Table>`, `create`, `update`, `delete` |119| `generate` | Lead generation | `from-icp`, `direct`, `schedule` |120| `campaigns` | ABM campaigns | `list`, `create` |121| `clients` | Client management | `list`, `create` |122| `shares` | Shared links | `create`, `extend`, `revoke` |123| `webhooks` | Inbound events | `list`, `get`, `reprocess` |124| `maintenance` | Bugs & enhancements | `bugs list/report`, `enhancements list/request` |125| `pipeline` | Analytics | `--start --end` |126| `account-analysis` | Account intelligence | `list`, `analyze`, `export` |127| `admin` | Backups, PITR, system | `backup`, `pitr`, `org-tree`, `views` |128| `config` | Session management | `show`, `set`, `get`, `reset` |129130## Output Format131132By default, the CLI shows smart-formatted output with tables, colors, and progress bars. Use `--format json` for raw JSON (useful for piping to `jq` or scripts):133134```bash135lgp leads list -c <id> --format json | jq '.data[].email'136```137138## Interactive TUI139140Launch with no arguments for a menu-driven interface:141142```bash143lgp144```145146The TUI provides client picker dropdowns, auto-authentication for EpsimoAI, and all commands accessible via menus.147148## API Base URL149150```151https://api.leadgenius.app/api/automation/152```153154## Environment Variables155156| Variable | Description |157|----------|-------------|158| `LGP_API_KEY` | API key (lgp_ prefix) |159| `LGP_URL` | Base URL (default: https://api.leadgenius.app) |160| `LGP_ADMIN_KEY` | Admin key for cognito/admin commands |161162## Reference Docs163164- [Full CLI README](README.md)165- [API Endpoints](references/api_endpoints.md) — all REST endpoints with request/response examples166- [CLI Reference](references/cli_reference.md) — detailed flag documentation167- [Workflows](references/workflows.md) — step-by-step business workflows168- [Use Cases](references/use_cases.md) — end-to-end scenarios