@lindo/cli
Command-line interface for the Lindo API. Interact with AI agents, workflows, workspace management, and analytics from your terminal.
Installation
npm install -g @lindo/cli
yarn global add @lindo/cli
pnpm add -g @lindo/cli
Quick Start
lindo config set apiKey your-api-key
lindo agents run my-agent --input '{"prompt": "Hello!"}'
lindo workflows start publish-page --params '{"page_id": "page-123"}'
lindo workflows status instance-123
lindo workspace credits
lindo analytics workspace --from 2024-01-01 --to 2024-01-31
Configuration
The CLI supports configuration via environment variables and a config file.
Environment Variables
Config File
Configuration is stored in ~/.lindo/config.json.
lindo config set apiKey your-api-key
lindo config set baseUrl https://custom-api.example.com
lindo config get apiKey
lindo config list
lindo config path
Configuration Precedence
- Environment variables (highest priority)
- Config file (
~/.lindo/config.json)
- Default values (lowest priority)
Command Reference
Global Options
-v, --version | Output the current version |
-h, --help | Display help for command |
lindo config
Manage CLI configuration.
lindo config set <key> <value>
lindo config get <key>
lindo config list
lindo config path
Valid configuration keys: apiKey, baseUrl
lindo agents
Run AI agents.
lindo agents run <agent-id> [options]
Options:
-i, --input <json> | Input data as JSON string | {} |
-s, --stream | Stream the response | false |
-f, --format <format> | Output format (json, table) | table |
Examples:
lindo agents run my-agent --input '{"prompt": "Hello!"}'
lindo agents run my-agent --input '{"prompt": "Hello!"}' --stream
lindo agents run my-agent --input '{"prompt": "Hello!"}' --format json
lindo workflows
Manage workflows.
lindo workflows start <workflow-name> [options]
lindo workflows status <instance-id> [options]
lindo workflows pause <instance-id> [options]
lindo workflows resume <instance-id> [options]
lindo workflows terminate <instance-id> [options]
Options for start:
-p, --params <json> | Workflow parameters as JSON string | {} |
-f, --format <format> | Output format (json, table) | table |
Options for other commands:
-f, --format <format> | Output format (json, table) | table |
Examples:
lindo workflows start publish-page --params '{"page_id": "page-123"}'
lindo workflows status instance-123
lindo workflows pause instance-123
lindo workflows resume instance-123
lindo workflows terminate instance-123
lindo workflows status instance-123 --format json
lindo workspace
Workspace operations.
lindo workspace credits [options]
Options:
-f, --format <format> | Output format (json, table) | table |
Examples:
lindo workspace credits
lindo workspace credits --format json
lindo analytics
Analytics operations.
lindo analytics workspace [options]
lindo analytics website [options]
Options:
--from <date> | Start date (ISO format) | - |
--to <date> | End date (ISO format) | - |
-f, --format <format> | Output format (json, table) | table |
Examples:
lindo analytics workspace
lindo analytics workspace --from 2024-01-01 --to 2024-01-31
lindo analytics website --format json
Output Formats
The CLI supports two output formats:
Table Format (default)
Human-readable formatted output:
┌─────────────┬────────────┐
│ workspace_id│ ws-123 │
│ balance │ 1000 │
│ allocated │ 5000 │
│ used │ 4000 │
└─────────────┴────────────┘
JSON Format
Machine-readable JSON output:
{
"workspace_id": "ws-123",
"balance": 1000,
"allocated": 5000,
"used": 4000
}
Use --format json for scripting and automation.
Error Handling
The CLI provides helpful error messages:
$ lindo agents run my-agent
✗ API key not configured
ℹ Run: lindo config set apiKey <your-api-key>
ℹ Or set the LINDO_API_KEY environment variable
Authentication Errors
If authentication fails, the CLI will prompt you to configure your API key:
✗ Authentication failed
ℹ Your API key may be invalid or expired.
ℹ
ℹ To configure your API key:
ℹ 1. Run: lindo config set apiKey <your-api-key>
ℹ 2. Or set the LINDO_API_KEY environment variable
ℹ
ℹ To get an API key:
ℹ Visit https://app.lindo.ai/settings/api-keys
Development
pnpm build
pnpm typecheck
pnpm test
License
MIT