@getfrontline/cli 1.0.0 → 1.0.3
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 +246 -319
- package/dist/commands/auth/login.d.ts.map +1 -1
- package/dist/commands/auth/login.js +29 -4
- package/dist/commands/auth/login.js.map +1 -1
- package/dist/commands/auth/profiles.d.ts.map +1 -1
- package/dist/commands/auth/profiles.js +7 -11
- package/dist/commands/auth/profiles.js.map +1 -1
- package/dist/commands/object/export.js +3 -3
- package/dist/commands/object/field.js +5 -5
- package/dist/commands/object/index.js +8 -8
- package/dist/commands/object/index.js.map +1 -1
- package/dist/commands/object/option.js +4 -4
- package/dist/commands/object/record-type.js +4 -4
- package/dist/commands/object/record.js +8 -8
- package/dist/commands/object/relation.js +4 -4
- package/dist/commands/object/view.js +9 -9
- package/dist/lib/cliVersion.d.ts +8 -0
- package/dist/lib/cliVersion.d.ts.map +1 -0
- package/dist/lib/cliVersion.js +26 -0
- package/dist/lib/cliVersion.js.map +1 -0
- package/dist/lib/config.js +1 -1
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/errors.d.ts +3 -0
- package/dist/lib/errors.d.ts.map +1 -1
- package/dist/lib/errors.js +10 -1
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/helpEpilog.d.ts.map +1 -1
- package/dist/lib/helpEpilog.js +35 -35
- package/dist/lib/helpEpilog.js.map +1 -1
- package/dist/lib/httpClient.d.ts.map +1 -1
- package/dist/lib/httpClient.js +35 -16
- package/dist/lib/httpClient.js.map +1 -1
- package/dist/lib/output.d.ts +10 -0
- package/dist/lib/output.d.ts.map +1 -1
- package/dist/lib/output.js +28 -12
- package/dist/lib/output.js.map +1 -1
- package/dist/max/commands/auth/login.d.ts.map +1 -1
- package/dist/max/commands/auth/login.js +22 -5
- package/dist/max/commands/auth/login.js.map +1 -1
- package/dist/max/commands/chat/repl.d.ts +9 -0
- package/dist/max/commands/chat/repl.d.ts.map +1 -1
- package/dist/max/commands/chat/repl.js +15 -11
- package/dist/max/commands/chat/repl.js.map +1 -1
- package/dist/max/commands/chat/send.d.ts.map +1 -1
- package/dist/max/commands/chat/send.js +17 -0
- package/dist/max/commands/chat/send.js.map +1 -1
- package/dist/max/lib/httpClient.d.ts.map +1 -1
- package/dist/max/lib/httpClient.js +11 -4
- package/dist/max/lib/httpClient.js.map +1 -1
- package/dist/max/ui/banner.d.ts.map +1 -1
- package/dist/max/ui/banner.js +21 -21
- package/dist/max/ui/banner.js.map +1 -1
- package/dist/max.js +15 -3
- package/dist/max.js.map +1 -1
- package/dist/skills/aggregations/SKILL.md +7 -7
- package/dist/skills/auth-and-profiles/SKILL.md +1 -1
- package/dist/skills/crm-setup/SKILL.md +58 -48
- package/dist/skills/crud-operations/SKILL.md +2 -2
- package/dist/skills/export-and-delete/SKILL.md +5 -5
- package/dist/skills/files/SKILL.md +4 -4
- package/dist/skills/filter-and-query/SKILL.md +7 -7
- package/dist/skills/frontline-internals/SKILL.md +209 -0
- package/dist/skills/max-auth/SKILL.md +76 -76
- package/dist/skills/max-chat/SKILL.md +111 -111
- package/dist/skills/notes-and-tasks/SKILL.md +4 -4
- package/dist/skills/pipeline-setup/SKILL.md +13 -13
- package/dist/skills/relations/SKILL.md +20 -15
- package/dist/skills/schema-design/SKILL.md +13 -13
- package/package.json +51 -47
package/README.md
CHANGED
|
@@ -1,319 +1,246 @@
|
|
|
1
|
-
# @
|
|
2
|
-
|
|
3
|
-
Unified Frontline command-line toolbox. Ships two binaries:
|
|
4
|
-
|
|
5
|
-
- **`frontline`** — public REST API: agents, workflows, billing, tables, objects, raw GET, Claude Code skills setup.
|
|
6
|
-
- **`max`** — Max chat & admin REST (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
frontline auth
|
|
45
|
-
|
|
46
|
-
#
|
|
47
|
-
frontline auth
|
|
48
|
-
frontline auth
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
###
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
frontline
|
|
57
|
-
frontline
|
|
58
|
-
frontline
|
|
59
|
-
frontline
|
|
60
|
-
frontline
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
###
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
frontline
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
frontline
|
|
83
|
-
frontline
|
|
84
|
-
frontline workflows
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
###
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
frontline
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
-
|
|
150
|
-
-
|
|
151
|
-
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
max
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
max
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
max
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
max
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
```bash
|
|
248
|
-
export MAX_CLI_LOGO_PATH="/absolute/path/to/logo3.png"
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
If the logo can't be rendered (many Windows terminals), the CLI still shows the text welcome banner.
|
|
252
|
-
|
|
253
|
-
### Configure the hosted login page
|
|
254
|
-
|
|
255
|
-
The CLI opens a **URL you host** (web app). Set:
|
|
256
|
-
|
|
257
|
-
- `MAX_CLI_AUTH_URL` (preferred), or `FRONTLINE_MAX_CLI_AUTH_URL`, or `FRONTLINE_CLI_AUTH_URL`
|
|
258
|
-
|
|
259
|
-
Example:
|
|
260
|
-
|
|
261
|
-
```bash
|
|
262
|
-
export MAX_CLI_AUTH_URL="https://app.getfrontline.ai/max-cli/login"
|
|
263
|
-
max auth login
|
|
264
|
-
```
|
|
265
|
-
Optional override per run:
|
|
266
|
-
|
|
267
|
-
```bash
|
|
268
|
-
max auth login --google --auth-url "https://localhost:3000/max-cli/login"
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
### Contract for the web app (backend + frontend)
|
|
272
|
-
|
|
273
|
-
The CLI appends query parameters to `MAX_CLI_AUTH_URL`:
|
|
274
|
-
|
|
275
|
-
| Parameter | Meaning |
|
|
276
|
-
| --------------- | ------------------------------------------------------------------------- |
|
|
277
|
-
| `provider` | `google`, `microsoft`, or `otp` |
|
|
278
|
-
| `redirect_uri` | `http://127.0.0.1:<port>/callback` (local HTTP server started by the CLI) |
|
|
279
|
-
| `state` | Random anti-CSRF value; **must** be returned unchanged |
|
|
280
|
-
| `response_mode` | `query` (callback uses query string) |
|
|
281
|
-
|
|
282
|
-
After the user signs in with Firebase (Google / Microsoft / email OTP), redirect the browser to:
|
|
283
|
-
|
|
284
|
-
**Success:** `redirect_uri` + `?token=<Firebase_ID_token>&state=<same_state>`
|
|
285
|
-
Optional: `&refresh_token=<refresh_if_you_have_it>` (only if your app can expose it safely).
|
|
286
|
-
|
|
287
|
-
**Error:** `redirect_uri` + `?error=access_denied&state=<same_state>&error_description=<url-encoded message>`
|
|
288
|
-
|
|
289
|
-
The token should be the same **Firebase ID token** your API already accepts in `Authorization: Bearer` with `verifyIdToken` (see `src/api/middlewares/authMiddleware.ts`).
|
|
290
|
-
|
|
291
|
-
### Config file location
|
|
292
|
-
|
|
293
|
-
```bash
|
|
294
|
-
max config-path
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
---
|
|
298
|
-
|
|
299
|
-
## Development
|
|
300
|
-
|
|
301
|
-
This package lives inside the monorepo at `packages/cli`.
|
|
302
|
-
|
|
303
|
-
```bash
|
|
304
|
-
cd packages/cli
|
|
305
|
-
npm install
|
|
306
|
-
npm run dev:frontline -- agents list # run frontline without building
|
|
307
|
-
npm run dev:max -- "Hola" # run max without building
|
|
308
|
-
npm run build # compile TypeScript to dist/
|
|
309
|
-
node dist/index.js --help # run compiled frontline
|
|
310
|
-
node dist/max.js --help # run compiled max
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
Config is persisted via `conf`:
|
|
314
|
-
|
|
315
|
-
- `frontline` binary → project name `frontline-cli`
|
|
316
|
-
- `max` binary → project name `max-cli`
|
|
317
|
-
|
|
318
|
-
They do **not** share credentials.
|
|
319
|
-
|
|
1
|
+
# @getfrontline/cli
|
|
2
|
+
|
|
3
|
+
Unified Frontline command-line toolbox. Ships two binaries:
|
|
4
|
+
|
|
5
|
+
- **`frontline`** — public REST API: agents, workflows, billing, tables, objects, raw GET, Claude Code skills setup.
|
|
6
|
+
- **`max`** — Max chat & admin REST (per-user API key as Bearer, interactive chat).
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install -g @getfrontline/cli
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Or run without installing:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx @getfrontline/cli --help
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Output format
|
|
21
|
+
|
|
22
|
+
All `frontline` commands print **JSON to stdout by default** (scripting-friendly). Opt into human-readable output with:
|
|
23
|
+
|
|
24
|
+
- `--pretty` — key/value blocks, spinners, icons (to stderr-safe channels)
|
|
25
|
+
- `--table` — tabular rendering for list endpoints
|
|
26
|
+
|
|
27
|
+
Errors always go to `stderr` in human form and to `stdout` as structured JSON when the command was invoked in its default (non-pretty) mode.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
# `frontline` binary
|
|
32
|
+
|
|
33
|
+
### Login
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
frontline auth login <api-key>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The API key is shared between `frontline` and `max` automatically.
|
|
40
|
+
|
|
41
|
+
### Switch / inspect profiles
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
frontline auth profiles list # all saved profiles + active one
|
|
45
|
+
frontline auth profiles use prod # change active profile
|
|
46
|
+
frontline auth whoami # hits /me with current profile
|
|
47
|
+
frontline auth logout # remove active profile
|
|
48
|
+
frontline auth logout --profile staging
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Commands
|
|
52
|
+
|
|
53
|
+
### Agents
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
frontline agents list
|
|
57
|
+
frontline agents list --status active
|
|
58
|
+
frontline agents flows <agentId>
|
|
59
|
+
frontline agents flows <agentId> --status active
|
|
60
|
+
frontline agents analytics <agentId> --start-date 2025-01-01 --end-date 2025-12-31
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Workflows
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
frontline workflows list
|
|
67
|
+
frontline workflows list --status active
|
|
68
|
+
frontline workflows analytics <workflowId> --start-date 2025-01-01 --end-date 2025-12-31
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Billing
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
frontline billing get
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Raw API requests
|
|
78
|
+
|
|
79
|
+
For endpoints not yet mapped to a command:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
frontline api get /agents
|
|
83
|
+
frontline api get /agents --query status=active
|
|
84
|
+
frontline api get /workflows/123/analytics --query startDate=2025-01-01 endDate=2025-12-31
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Objects (CRM entities)
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
frontline object list
|
|
91
|
+
frontline object get standard__people
|
|
92
|
+
frontline object schema standard__deals
|
|
93
|
+
frontline object create --data '{"name":"custom_obj","displayName":"Custom","fields":[...]}'
|
|
94
|
+
frontline object update standard__deals --data '{"displayName":"Deals v2"}'
|
|
95
|
+
frontline object count standard__deals
|
|
96
|
+
frontline object delete standard__custom_object
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Tables (spreadsheet-like)
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
frontline table list
|
|
103
|
+
frontline table get my_table
|
|
104
|
+
frontline table create my_table --data '{"displayName":"My Table","columns":[{"name":"Name","type":"string","metadata":{"format":"text"}}]}'
|
|
105
|
+
frontline table delete my_table
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Shared sub-commands (object & table)
|
|
109
|
+
|
|
110
|
+
Both `object` and `table` expose the same set of sub-commands:
|
|
111
|
+
|
|
112
|
+
| Command | Description |
|
|
113
|
+
| ---------------- | ----------------------------------------------- |
|
|
114
|
+
| `field` | Manage fields (columns) — CRUD |
|
|
115
|
+
| `option` | Manage select-field options — CRUD |
|
|
116
|
+
| `record` / `row` | Manage rows — list, get, create, update, delete |
|
|
117
|
+
| `relation` | Link / unlink related records |
|
|
118
|
+
| `view` | Manage views (object only) — CRUD |
|
|
119
|
+
| `record-type` | Manage record types (object only) |
|
|
120
|
+
| `note` | Notes on rows — CRUD |
|
|
121
|
+
| `task` | Tasks on rows — CRUD + complete / uncomplete |
|
|
122
|
+
| `file` | Files on rows — list, get, download, delete |
|
|
123
|
+
| `aggregation` | Aggregations — CRUD + compute |
|
|
124
|
+
| `export` | Export data as XLSX or CSV |
|
|
125
|
+
|
|
126
|
+
Run `frontline <resource> <subcommand> --help` for details and examples.
|
|
127
|
+
|
|
128
|
+
### Global flags
|
|
129
|
+
|
|
130
|
+
Every `frontline` command accepts:
|
|
131
|
+
|
|
132
|
+
- `--api-key <key>` — override stored API key for a single call
|
|
133
|
+
- `--profile <name>` — use a specific saved profile
|
|
134
|
+
- `--debug` — verbose request/response logs
|
|
135
|
+
- `--pretty` — human-readable output
|
|
136
|
+
- `--table` — tabular output for list endpoints
|
|
137
|
+
|
|
138
|
+
## Claude Code Skills
|
|
139
|
+
|
|
140
|
+
Optional: install Frontline skills into Claude Code (auto-detected on `npm install`):
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
frontline setup --claude-skills # install new skills
|
|
144
|
+
frontline setup --claude-skills --force # overwrite existing
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Skills currently shipped:
|
|
148
|
+
|
|
149
|
+
- **Public API:** `frontline-agents`, `frontline-workflows`, `frontline-billing`, `frontline-api`
|
|
150
|
+
- **Max:** `max-chat`, `max-auth`
|
|
151
|
+
- **Table / Object CRUD:** `auth-and-profiles`, `crm-setup`, `crud-operations`, `pipeline-setup`, `schema-design`, `resource-creation`, `record-type-management`, `relations`, `filter-and-query`, `files`, `notes-and-tasks`, `export-and-delete`, `aggregations`
|
|
152
|
+
|
|
153
|
+
## Debugging
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
frontline agents list --debug
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Troubleshooting
|
|
160
|
+
|
|
161
|
+
- **"No API key found"** — run `frontline auth login <key>`.
|
|
162
|
+
- **"No Max API key found"** (Max CLI) — run `max auth login <key>` or `frontline auth login <key>` on the same profile.
|
|
163
|
+
- **"Missing or invalid API key"** — key expired / revoked. Generate a new one.
|
|
164
|
+
- **"Request timed out"** — check network.
|
|
165
|
+
- **Rate limit** — public API allows 100 req/min.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
# `max` binary
|
|
170
|
+
|
|
171
|
+
Authentication uses the **same API key** as `frontline`. Logging in with either CLI keeps them in sync.
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
max --help
|
|
175
|
+
max auth login <api-key>
|
|
176
|
+
max auth whoami
|
|
177
|
+
max auth logout # clears Max + matching Frontline profile
|
|
178
|
+
max auth logout --keep-frontline # only clears the Max store
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Response shape and stdout
|
|
182
|
+
|
|
183
|
+
Max Public API responses are typically `{ "ok": true|false, "data": ... }`. HTTP errors still use 4xx/5xx; logical failures may return `200` with `ok: false` (the CLI treats those as errors).
|
|
184
|
+
|
|
185
|
+
- **`max "…"`** (root) and **`max chat send`**: default stdout is **one-line JSON** (`JSON.stringify` of the last response: POST, or last GET after polling). Use **`--pretty`** for assistant **plain text** from `data`. Use **`--json`** to print only the POST body and **skip polling**.
|
|
186
|
+
- **`max conversations …`**: same idea — default one-line JSON; **`--pretty`** for plain text when the CLI can infer it.
|
|
187
|
+
- **`max chat` / REPL**: stdout is assistant **plain text** from `data` when possible (interactive UX); otherwise one-line JSON. No progress spinners on stdout.
|
|
188
|
+
|
|
189
|
+
### Public API — Max conversations
|
|
190
|
+
|
|
191
|
+
| Method | Path (after base) |
|
|
192
|
+
| ------- | ------------------------------------------------- |
|
|
193
|
+
| `POST` | `/max/conversations/message` |
|
|
194
|
+
| `GET` | `/max/conversations/:conversationId` |
|
|
195
|
+
| `PATCH` | `/max/conversations/:conversationId` |
|
|
196
|
+
| `POST` | `/max/conversations/:conversationId/abortMessage` |
|
|
197
|
+
| `GET` | `/max/conversations/` |
|
|
198
|
+
|
|
199
|
+
CLI:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
max conversations list
|
|
203
|
+
max conversations get 123
|
|
204
|
+
max conversations update 123 --data '{"title":"Renamed"}'
|
|
205
|
+
max conversations abort 123
|
|
206
|
+
# alias: max conv list
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Global flags: `--profile`, `--api-key`, `--pretty`, `--debug` (same resolution as `max chat send`).
|
|
210
|
+
|
|
211
|
+
## Chat with Max
|
|
212
|
+
|
|
213
|
+
After `max auth login`, you can send messages:
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
# Send message (uses last conversation by default)
|
|
217
|
+
max "Hola"
|
|
218
|
+
|
|
219
|
+
# Start a new conversation
|
|
220
|
+
max --new "Hola"
|
|
221
|
+
|
|
222
|
+
# Explicit conversation id
|
|
223
|
+
max --conversation 123 "Hola"
|
|
224
|
+
|
|
225
|
+
# Default: one-line JSON from the API; human reply with --pretty
|
|
226
|
+
max "Hola" --pretty
|
|
227
|
+
|
|
228
|
+
# Override API key for one run
|
|
229
|
+
max "Hola" --api-key flk_...
|
|
230
|
+
|
|
231
|
+
# Alternative explicit command form
|
|
232
|
+
max chat send "Hola"
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
You can also start an interactive session (so you don't have to type `max` every time):
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
max chat
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Inside the interactive prompt, use:
|
|
242
|
+
|
|
243
|
+
- `:help` for commands
|
|
244
|
+
- `:new` to start a new conversation
|
|
245
|
+
- `:conv <id>` to switch conversations
|
|
246
|
+
- `:exit` to quit
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsCpC,eAAO,MAAM,YAAY,SAoDnB,CAAC"}
|
|
@@ -4,17 +4,28 @@ exports.loginCommand = void 0;
|
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
5
|
const config_1 = require("../../lib/config");
|
|
6
6
|
const output_1 = require("../../lib/output");
|
|
7
|
+
const auth_1 = require("../../lib/auth");
|
|
7
8
|
const helpEpilog_1 = require("../../lib/helpEpilog");
|
|
8
9
|
const maxConfig_1 = require("../../max/maxConfig");
|
|
9
10
|
const banner_1 = require("../../max/ui/banner");
|
|
11
|
+
function printNextSteps() {
|
|
12
|
+
console.log();
|
|
13
|
+
console.log(output_1.brand.primary.bold("Start here"));
|
|
14
|
+
console.log(` ${output_1.brand.primary("frontline auth whoami")} ${output_1.brand.muted("Verify your API key")}`);
|
|
15
|
+
console.log(` ${output_1.brand.primary("frontline agents list")} ${output_1.brand.muted("List your agents")}`);
|
|
16
|
+
console.log(` ${output_1.brand.primary("frontline workflows list")} ${output_1.brand.muted("List your workflows")}`);
|
|
17
|
+
console.log(` ${output_1.brand.primary("max chat")} ${output_1.brand.muted("Open Max in your terminal")}`);
|
|
18
|
+
}
|
|
10
19
|
exports.loginCommand = new commander_1.Command("login")
|
|
11
20
|
.description("Store an API key for the current (or specified) profile. Does NOT verify the key.")
|
|
12
21
|
.argument("<api-key>", "Your Frontline API key")
|
|
13
22
|
.option("--base-url <url>", `Advanced: Public API base URL (default: ${(0, config_1.getDefaultBaseUrl)()})`)
|
|
14
23
|
.option("--profile <name>", "Profile name (default: current profile)")
|
|
24
|
+
.option("--json", "Output the saved profile as JSON")
|
|
15
25
|
.addHelpText("after", `\n${helpEpilog_1.FRONTLINE_AUTH_LOGIN_EPILOG}\n`)
|
|
16
26
|
.action(async (apiKey, opts) => {
|
|
17
|
-
|
|
27
|
+
if (!opts.json)
|
|
28
|
+
await (0, banner_1.printFrontlineLogo)();
|
|
18
29
|
const profileName = opts.profile ?? (0, config_1.getCurrentProfile)();
|
|
19
30
|
const existing = (0, config_1.getProfile)(profileName);
|
|
20
31
|
const baseUrl = opts.baseUrl ?? existing?.baseUrl ?? (0, config_1.getDefaultBaseUrl)();
|
|
@@ -28,12 +39,26 @@ exports.loginCommand = new commander_1.Command("login")
|
|
|
28
39
|
(0, config_1.setCurrentProfile)(profileName);
|
|
29
40
|
(0, maxConfig_1.setMaxCurrentProfile)(profileName);
|
|
30
41
|
}
|
|
31
|
-
|
|
32
|
-
(0, output_1.success)({
|
|
42
|
+
const output = {
|
|
33
43
|
authenticated: true,
|
|
34
44
|
profile: profileName,
|
|
35
|
-
key_preview:
|
|
45
|
+
key_preview: (0, auth_1.redactToken)(apiKey),
|
|
46
|
+
base_url: baseUrl,
|
|
36
47
|
config_path: (0, config_1.getConfigPath)(),
|
|
48
|
+
};
|
|
49
|
+
if (opts.json) {
|
|
50
|
+
(0, output_1.printJson)(output);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
console.log(`${output_1.brand.primary.bold("Welcome to Frontline CLI")}`);
|
|
54
|
+
console.log(output_1.brand.muted("You're signed in and ready to use Frontline from your terminal."));
|
|
55
|
+
console.log();
|
|
56
|
+
(0, output_1.printSuccess)(`Profile "${profileName}" is ready.`);
|
|
57
|
+
(0, output_1.printKeyValue)({
|
|
58
|
+
profile: output.profile,
|
|
59
|
+
baseUrl: output.base_url,
|
|
60
|
+
keyPreview: output.key_preview,
|
|
37
61
|
});
|
|
62
|
+
printNextSteps();
|
|
38
63
|
});
|
|
39
64
|
//# sourceMappingURL=login.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/commands/auth/login.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,6CAO0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/commands/auth/login.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/profiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/profiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2FpC,eAAO,MAAM,eAAe,SAGO,CAAC"}
|