lindoai-cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +322 -0
- package/dist/index.cjs +2900 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +40 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +2875 -0
- package/dist/index.js.map +1 -0
- package/package.json +53 -0
package/README.md
ADDED
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
# @lindo/cli
|
|
2
|
+
|
|
3
|
+
Command-line interface for the Lindo API. Interact with AI agents, workflows, workspace management, and analytics from your terminal.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @lindo/cli
|
|
9
|
+
# or
|
|
10
|
+
yarn global add @lindo/cli
|
|
11
|
+
# or
|
|
12
|
+
pnpm add -g @lindo/cli
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Configure your API key
|
|
19
|
+
lindo config set apiKey your-api-key
|
|
20
|
+
|
|
21
|
+
# Run an agent
|
|
22
|
+
lindo agents run my-agent --input '{"prompt": "Hello!"}'
|
|
23
|
+
|
|
24
|
+
# Start a workflow
|
|
25
|
+
lindo workflows start publish-page --params '{"page_id": "page-123"}'
|
|
26
|
+
|
|
27
|
+
# Get workflow status
|
|
28
|
+
lindo workflows status instance-123
|
|
29
|
+
|
|
30
|
+
# Get workspace credits
|
|
31
|
+
lindo workspace credits
|
|
32
|
+
|
|
33
|
+
# Get analytics
|
|
34
|
+
lindo analytics workspace --from 2024-01-01 --to 2024-01-31
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Configuration
|
|
38
|
+
|
|
39
|
+
The CLI supports configuration via environment variables and a config file.
|
|
40
|
+
|
|
41
|
+
### Environment Variables
|
|
42
|
+
|
|
43
|
+
| Variable | Description |
|
|
44
|
+
|----------|-------------|
|
|
45
|
+
| `LINDO_API_KEY` | Your Lindo API key |
|
|
46
|
+
| `LINDO_BASE_URL` | API base URL (default: https://api.lindo.ai) |
|
|
47
|
+
|
|
48
|
+
### Config File
|
|
49
|
+
|
|
50
|
+
Configuration is stored in `~/.lindo/config.json`.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# Set API key
|
|
54
|
+
lindo config set apiKey your-api-key
|
|
55
|
+
|
|
56
|
+
# Set custom base URL
|
|
57
|
+
lindo config set baseUrl https://custom-api.example.com
|
|
58
|
+
|
|
59
|
+
# Get a config value
|
|
60
|
+
lindo config get apiKey
|
|
61
|
+
|
|
62
|
+
# List all config values
|
|
63
|
+
lindo config list
|
|
64
|
+
|
|
65
|
+
# Show config file path
|
|
66
|
+
lindo config path
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Configuration Precedence
|
|
70
|
+
|
|
71
|
+
1. Environment variables (highest priority)
|
|
72
|
+
2. Config file (`~/.lindo/config.json`)
|
|
73
|
+
3. Default values (lowest priority)
|
|
74
|
+
|
|
75
|
+
## Command Reference
|
|
76
|
+
|
|
77
|
+
### Global Options
|
|
78
|
+
|
|
79
|
+
| Option | Description |
|
|
80
|
+
|--------|-------------|
|
|
81
|
+
| `-v, --version` | Output the current version |
|
|
82
|
+
| `-h, --help` | Display help for command |
|
|
83
|
+
|
|
84
|
+
### `lindo config`
|
|
85
|
+
|
|
86
|
+
Manage CLI configuration.
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Set a configuration value
|
|
90
|
+
lindo config set <key> <value>
|
|
91
|
+
|
|
92
|
+
# Get a configuration value
|
|
93
|
+
lindo config get <key>
|
|
94
|
+
|
|
95
|
+
# List all configuration values
|
|
96
|
+
lindo config list
|
|
97
|
+
|
|
98
|
+
# Show config file path
|
|
99
|
+
lindo config path
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Valid configuration keys:** `apiKey`, `baseUrl`
|
|
103
|
+
|
|
104
|
+
### `lindo agents`
|
|
105
|
+
|
|
106
|
+
Run AI agents.
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# Run an agent
|
|
110
|
+
lindo agents run <agent-id> [options]
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Options:**
|
|
114
|
+
|
|
115
|
+
| Option | Description | Default |
|
|
116
|
+
|--------|-------------|---------|
|
|
117
|
+
| `-i, --input <json>` | Input data as JSON string | `{}` |
|
|
118
|
+
| `-s, --stream` | Stream the response | `false` |
|
|
119
|
+
| `-f, --format <format>` | Output format (`json`, `table`) | `table` |
|
|
120
|
+
|
|
121
|
+
**Examples:**
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Run an agent with input
|
|
125
|
+
lindo agents run my-agent --input '{"prompt": "Hello!"}'
|
|
126
|
+
|
|
127
|
+
# Run with streaming
|
|
128
|
+
lindo agents run my-agent --input '{"prompt": "Hello!"}' --stream
|
|
129
|
+
|
|
130
|
+
# Output as JSON
|
|
131
|
+
lindo agents run my-agent --input '{"prompt": "Hello!"}' --format json
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### `lindo workflows`
|
|
135
|
+
|
|
136
|
+
Manage workflows.
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# Start a workflow
|
|
140
|
+
lindo workflows start <workflow-name> [options]
|
|
141
|
+
|
|
142
|
+
# Get workflow status
|
|
143
|
+
lindo workflows status <instance-id> [options]
|
|
144
|
+
|
|
145
|
+
# Pause a workflow
|
|
146
|
+
lindo workflows pause <instance-id> [options]
|
|
147
|
+
|
|
148
|
+
# Resume a workflow
|
|
149
|
+
lindo workflows resume <instance-id> [options]
|
|
150
|
+
|
|
151
|
+
# Terminate a workflow
|
|
152
|
+
lindo workflows terminate <instance-id> [options]
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Options for `start`:**
|
|
156
|
+
|
|
157
|
+
| Option | Description | Default |
|
|
158
|
+
|--------|-------------|---------|
|
|
159
|
+
| `-p, --params <json>` | Workflow parameters as JSON string | `{}` |
|
|
160
|
+
| `-f, --format <format>` | Output format (`json`, `table`) | `table` |
|
|
161
|
+
|
|
162
|
+
**Options for other commands:**
|
|
163
|
+
|
|
164
|
+
| Option | Description | Default |
|
|
165
|
+
|--------|-------------|---------|
|
|
166
|
+
| `-f, --format <format>` | Output format (`json`, `table`) | `table` |
|
|
167
|
+
|
|
168
|
+
**Examples:**
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
# Start a workflow
|
|
172
|
+
lindo workflows start publish-page --params '{"page_id": "page-123"}'
|
|
173
|
+
|
|
174
|
+
# Get workflow status
|
|
175
|
+
lindo workflows status instance-123
|
|
176
|
+
|
|
177
|
+
# Pause a running workflow
|
|
178
|
+
lindo workflows pause instance-123
|
|
179
|
+
|
|
180
|
+
# Resume a paused workflow
|
|
181
|
+
lindo workflows resume instance-123
|
|
182
|
+
|
|
183
|
+
# Terminate a workflow
|
|
184
|
+
lindo workflows terminate instance-123
|
|
185
|
+
|
|
186
|
+
# Output as JSON
|
|
187
|
+
lindo workflows status instance-123 --format json
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### `lindo workspace`
|
|
191
|
+
|
|
192
|
+
Workspace operations.
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
# Get credit balance
|
|
196
|
+
lindo workspace credits [options]
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**Options:**
|
|
200
|
+
|
|
201
|
+
| Option | Description | Default |
|
|
202
|
+
|--------|-------------|---------|
|
|
203
|
+
| `-f, --format <format>` | Output format (`json`, `table`) | `table` |
|
|
204
|
+
|
|
205
|
+
**Examples:**
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
# Get credits in table format
|
|
209
|
+
lindo workspace credits
|
|
210
|
+
|
|
211
|
+
# Get credits as JSON
|
|
212
|
+
lindo workspace credits --format json
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### `lindo analytics`
|
|
216
|
+
|
|
217
|
+
Analytics operations.
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
# Get workspace analytics
|
|
221
|
+
lindo analytics workspace [options]
|
|
222
|
+
|
|
223
|
+
# Get website analytics
|
|
224
|
+
lindo analytics website [options]
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
**Options:**
|
|
228
|
+
|
|
229
|
+
| Option | Description | Default |
|
|
230
|
+
|--------|-------------|---------|
|
|
231
|
+
| `--from <date>` | Start date (ISO format) | - |
|
|
232
|
+
| `--to <date>` | End date (ISO format) | - |
|
|
233
|
+
| `-f, --format <format>` | Output format (`json`, `table`) | `table` |
|
|
234
|
+
|
|
235
|
+
**Examples:**
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
# Get workspace analytics
|
|
239
|
+
lindo analytics workspace
|
|
240
|
+
|
|
241
|
+
# Get analytics for a date range
|
|
242
|
+
lindo analytics workspace --from 2024-01-01 --to 2024-01-31
|
|
243
|
+
|
|
244
|
+
# Get website analytics as JSON
|
|
245
|
+
lindo analytics website --format json
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## Output Formats
|
|
249
|
+
|
|
250
|
+
The CLI supports two output formats:
|
|
251
|
+
|
|
252
|
+
### Table Format (default)
|
|
253
|
+
|
|
254
|
+
Human-readable formatted output:
|
|
255
|
+
|
|
256
|
+
```
|
|
257
|
+
┌─────────────┬────────────┐
|
|
258
|
+
│ workspace_id│ ws-123 │
|
|
259
|
+
│ balance │ 1000 │
|
|
260
|
+
│ allocated │ 5000 │
|
|
261
|
+
│ used │ 4000 │
|
|
262
|
+
└─────────────┴────────────┘
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### JSON Format
|
|
266
|
+
|
|
267
|
+
Machine-readable JSON output:
|
|
268
|
+
|
|
269
|
+
```json
|
|
270
|
+
{
|
|
271
|
+
"workspace_id": "ws-123",
|
|
272
|
+
"balance": 1000,
|
|
273
|
+
"allocated": 5000,
|
|
274
|
+
"used": 4000
|
|
275
|
+
}
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
Use `--format json` for scripting and automation.
|
|
279
|
+
|
|
280
|
+
## Error Handling
|
|
281
|
+
|
|
282
|
+
The CLI provides helpful error messages:
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
$ lindo agents run my-agent
|
|
286
|
+
✗ API key not configured
|
|
287
|
+
ℹ Run: lindo config set apiKey <your-api-key>
|
|
288
|
+
ℹ Or set the LINDO_API_KEY environment variable
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Authentication Errors
|
|
292
|
+
|
|
293
|
+
If authentication fails, the CLI will prompt you to configure your API key:
|
|
294
|
+
|
|
295
|
+
```bash
|
|
296
|
+
✗ Authentication failed
|
|
297
|
+
ℹ Your API key may be invalid or expired.
|
|
298
|
+
ℹ
|
|
299
|
+
ℹ To configure your API key:
|
|
300
|
+
ℹ 1. Run: lindo config set apiKey <your-api-key>
|
|
301
|
+
ℹ 2. Or set the LINDO_API_KEY environment variable
|
|
302
|
+
ℹ
|
|
303
|
+
ℹ To get an API key:
|
|
304
|
+
ℹ Visit https://app.lindo.ai/settings/api-keys
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## Development
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
# Build the CLI
|
|
311
|
+
pnpm build
|
|
312
|
+
|
|
313
|
+
# Run type checking
|
|
314
|
+
pnpm typecheck
|
|
315
|
+
|
|
316
|
+
# Run tests
|
|
317
|
+
pnpm test
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
## License
|
|
321
|
+
|
|
322
|
+
MIT
|