@getfrontline/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 +319 -0
- package/dist/assets/logo3.png +0 -0
- package/dist/commands/agents/analytics.d.ts +3 -0
- package/dist/commands/agents/analytics.d.ts.map +1 -0
- package/dist/commands/agents/analytics.js +67 -0
- package/dist/commands/agents/analytics.js.map +1 -0
- package/dist/commands/agents/flows.d.ts +3 -0
- package/dist/commands/agents/flows.d.ts.map +1 -0
- package/dist/commands/agents/flows.js +47 -0
- package/dist/commands/agents/flows.js.map +1 -0
- package/dist/commands/agents/list.d.ts +3 -0
- package/dist/commands/agents/list.d.ts.map +1 -0
- package/dist/commands/agents/list.js +46 -0
- package/dist/commands/agents/list.js.map +1 -0
- package/dist/commands/api/raw.d.ts +3 -0
- package/dist/commands/api/raw.d.ts.map +1 -0
- package/dist/commands/api/raw.js +54 -0
- package/dist/commands/api/raw.js.map +1 -0
- package/dist/commands/auth/login.d.ts +3 -0
- package/dist/commands/auth/login.d.ts.map +1 -0
- package/dist/commands/auth/login.js +39 -0
- package/dist/commands/auth/login.js.map +1 -0
- package/dist/commands/auth/logout.d.ts +3 -0
- package/dist/commands/auth/logout.d.ts.map +1 -0
- package/dist/commands/auth/logout.js +16 -0
- package/dist/commands/auth/logout.js.map +1 -0
- package/dist/commands/auth/profiles.d.ts +3 -0
- package/dist/commands/auth/profiles.d.ts.map +1 -0
- package/dist/commands/auth/profiles.js +72 -0
- package/dist/commands/auth/profiles.js.map +1 -0
- package/dist/commands/auth/whoami.d.ts +3 -0
- package/dist/commands/auth/whoami.d.ts.map +1 -0
- package/dist/commands/auth/whoami.js +46 -0
- package/dist/commands/auth/whoami.js.map +1 -0
- package/dist/commands/billing/get.d.ts +3 -0
- package/dist/commands/billing/get.d.ts.map +1 -0
- package/dist/commands/billing/get.js +42 -0
- package/dist/commands/billing/get.js.map +1 -0
- package/dist/commands/object/aggregation.d.ts +3 -0
- package/dist/commands/object/aggregation.d.ts.map +1 -0
- package/dist/commands/object/aggregation.js +78 -0
- package/dist/commands/object/aggregation.js.map +1 -0
- package/dist/commands/object/export.d.ts +3 -0
- package/dist/commands/object/export.d.ts.map +1 -0
- package/dist/commands/object/export.js +98 -0
- package/dist/commands/object/export.js.map +1 -0
- package/dist/commands/object/field.d.ts +3 -0
- package/dist/commands/object/field.d.ts.map +1 -0
- package/dist/commands/object/field.js +76 -0
- package/dist/commands/object/field.js.map +1 -0
- package/dist/commands/object/file.d.ts +3 -0
- package/dist/commands/object/file.d.ts.map +1 -0
- package/dist/commands/object/file.js +105 -0
- package/dist/commands/object/file.js.map +1 -0
- package/dist/commands/object/index.d.ts +3 -0
- package/dist/commands/object/index.d.ts.map +1 -0
- package/dist/commands/object/index.js +136 -0
- package/dist/commands/object/index.js.map +1 -0
- package/dist/commands/object/note.d.ts +3 -0
- package/dist/commands/object/note.d.ts.map +1 -0
- package/dist/commands/object/note.js +62 -0
- package/dist/commands/object/note.js.map +1 -0
- package/dist/commands/object/option.d.ts +3 -0
- package/dist/commands/object/option.d.ts.map +1 -0
- package/dist/commands/object/option.js +78 -0
- package/dist/commands/object/option.js.map +1 -0
- package/dist/commands/object/record-type.d.ts +3 -0
- package/dist/commands/object/record-type.d.ts.map +1 -0
- package/dist/commands/object/record-type.js +73 -0
- package/dist/commands/object/record-type.js.map +1 -0
- package/dist/commands/object/record.d.ts +3 -0
- package/dist/commands/object/record.d.ts.map +1 -0
- package/dist/commands/object/record.js +128 -0
- package/dist/commands/object/record.js.map +1 -0
- package/dist/commands/object/relation.d.ts +3 -0
- package/dist/commands/object/relation.d.ts.map +1 -0
- package/dist/commands/object/relation.js +73 -0
- package/dist/commands/object/relation.js.map +1 -0
- package/dist/commands/object/task.d.ts +3 -0
- package/dist/commands/object/task.d.ts.map +1 -0
- package/dist/commands/object/task.js +88 -0
- package/dist/commands/object/task.js.map +1 -0
- package/dist/commands/object/view.d.ts +3 -0
- package/dist/commands/object/view.d.ts.map +1 -0
- package/dist/commands/object/view.js +118 -0
- package/dist/commands/object/view.js.map +1 -0
- package/dist/commands/setup/claudeSkills.d.ts +3 -0
- package/dist/commands/setup/claudeSkills.d.ts.map +1 -0
- package/dist/commands/setup/claudeSkills.js +84 -0
- package/dist/commands/setup/claudeSkills.js.map +1 -0
- package/dist/commands/table/aggregation.d.ts +3 -0
- package/dist/commands/table/aggregation.d.ts.map +1 -0
- package/dist/commands/table/aggregation.js +78 -0
- package/dist/commands/table/aggregation.js.map +1 -0
- package/dist/commands/table/export.d.ts +3 -0
- package/dist/commands/table/export.d.ts.map +1 -0
- package/dist/commands/table/export.js +97 -0
- package/dist/commands/table/export.js.map +1 -0
- package/dist/commands/table/field.d.ts +3 -0
- package/dist/commands/table/field.d.ts.map +1 -0
- package/dist/commands/table/field.js +76 -0
- package/dist/commands/table/field.js.map +1 -0
- package/dist/commands/table/file.d.ts +3 -0
- package/dist/commands/table/file.d.ts.map +1 -0
- package/dist/commands/table/file.js +106 -0
- package/dist/commands/table/file.js.map +1 -0
- package/dist/commands/table/index.d.ts +3 -0
- package/dist/commands/table/index.d.ts.map +1 -0
- package/dist/commands/table/index.js +142 -0
- package/dist/commands/table/index.js.map +1 -0
- package/dist/commands/table/note.d.ts +3 -0
- package/dist/commands/table/note.d.ts.map +1 -0
- package/dist/commands/table/note.js +62 -0
- package/dist/commands/table/note.js.map +1 -0
- package/dist/commands/table/option.d.ts +3 -0
- package/dist/commands/table/option.d.ts.map +1 -0
- package/dist/commands/table/option.js +78 -0
- package/dist/commands/table/option.js.map +1 -0
- package/dist/commands/table/relation.d.ts +3 -0
- package/dist/commands/table/relation.d.ts.map +1 -0
- package/dist/commands/table/relation.js +74 -0
- package/dist/commands/table/relation.js.map +1 -0
- package/dist/commands/table/row.d.ts +3 -0
- package/dist/commands/table/row.d.ts.map +1 -0
- package/dist/commands/table/row.js +124 -0
- package/dist/commands/table/row.js.map +1 -0
- package/dist/commands/table/task.d.ts +3 -0
- package/dist/commands/table/task.d.ts.map +1 -0
- package/dist/commands/table/task.js +88 -0
- package/dist/commands/table/task.js.map +1 -0
- package/dist/commands/workflows/analytics.d.ts +3 -0
- package/dist/commands/workflows/analytics.d.ts.map +1 -0
- package/dist/commands/workflows/analytics.js +60 -0
- package/dist/commands/workflows/analytics.js.map +1 -0
- package/dist/commands/workflows/list.d.ts +3 -0
- package/dist/commands/workflows/list.d.ts.map +1 -0
- package/dist/commands/workflows/list.js +47 -0
- package/dist/commands/workflows/list.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/auth.d.ts +13 -0
- package/dist/lib/auth.d.ts.map +1 -0
- package/dist/lib/auth.js +40 -0
- package/dist/lib/auth.js.map +1 -0
- package/dist/lib/config.d.ts +28 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +77 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/errors.d.ts +13 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +31 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/globalOpts.d.ts +23 -0
- package/dist/lib/globalOpts.d.ts.map +1 -0
- package/dist/lib/globalOpts.js +40 -0
- package/dist/lib/globalOpts.js.map +1 -0
- package/dist/lib/helpEpilog.d.ts +18 -0
- package/dist/lib/helpEpilog.d.ts.map +1 -0
- package/dist/lib/helpEpilog.js +56 -0
- package/dist/lib/helpEpilog.js.map +1 -0
- package/dist/lib/httpClient.d.ts +50 -0
- package/dist/lib/httpClient.d.ts.map +1 -0
- package/dist/lib/httpClient.js +196 -0
- package/dist/lib/httpClient.js.map +1 -0
- package/dist/lib/output.d.ts +38 -0
- package/dist/lib/output.d.ts.map +1 -0
- package/dist/lib/output.js +131 -0
- package/dist/lib/output.js.map +1 -0
- package/dist/max/browserLogin.d.ts +15 -0
- package/dist/max/browserLogin.d.ts.map +1 -0
- package/dist/max/browserLogin.js +164 -0
- package/dist/max/browserLogin.js.map +1 -0
- package/dist/max/commands/auth/login.d.ts +3 -0
- package/dist/max/commands/auth/login.d.ts.map +1 -0
- package/dist/max/commands/auth/login.js +58 -0
- package/dist/max/commands/auth/login.js.map +1 -0
- package/dist/max/commands/auth/logout.d.ts +3 -0
- package/dist/max/commands/auth/logout.d.ts.map +1 -0
- package/dist/max/commands/auth/logout.js +23 -0
- package/dist/max/commands/auth/logout.js.map +1 -0
- package/dist/max/commands/auth/whoami.d.ts +3 -0
- package/dist/max/commands/auth/whoami.d.ts.map +1 -0
- package/dist/max/commands/auth/whoami.js +46 -0
- package/dist/max/commands/auth/whoami.js.map +1 -0
- package/dist/max/commands/chat/repl.d.ts +3 -0
- package/dist/max/commands/chat/repl.d.ts.map +1 -0
- package/dist/max/commands/chat/repl.js +104 -0
- package/dist/max/commands/chat/repl.js.map +1 -0
- package/dist/max/commands/chat/send.d.ts +25 -0
- package/dist/max/commands/chat/send.d.ts.map +1 -0
- package/dist/max/commands/chat/send.js +163 -0
- package/dist/max/commands/chat/send.js.map +1 -0
- package/dist/max/commands/conversations/abort.d.ts +3 -0
- package/dist/max/commands/conversations/abort.d.ts.map +1 -0
- package/dist/max/commands/conversations/abort.js +55 -0
- package/dist/max/commands/conversations/abort.js.map +1 -0
- package/dist/max/commands/conversations/get.d.ts +3 -0
- package/dist/max/commands/conversations/get.d.ts.map +1 -0
- package/dist/max/commands/conversations/get.js +42 -0
- package/dist/max/commands/conversations/get.js.map +1 -0
- package/dist/max/commands/conversations/index.d.ts +3 -0
- package/dist/max/commands/conversations/index.d.ts.map +1 -0
- package/dist/max/commands/conversations/index.js +16 -0
- package/dist/max/commands/conversations/index.js.map +1 -0
- package/dist/max/commands/conversations/list.d.ts +3 -0
- package/dist/max/commands/conversations/list.d.ts.map +1 -0
- package/dist/max/commands/conversations/list.js +35 -0
- package/dist/max/commands/conversations/list.js.map +1 -0
- package/dist/max/commands/conversations/update.d.ts +3 -0
- package/dist/max/commands/conversations/update.d.ts.map +1 -0
- package/dist/max/commands/conversations/update.js +53 -0
- package/dist/max/commands/conversations/update.js.map +1 -0
- package/dist/max/jwtDecode.d.ts +5 -0
- package/dist/max/jwtDecode.d.ts.map +1 -0
- package/dist/max/jwtDecode.js +19 -0
- package/dist/max/jwtDecode.js.map +1 -0
- package/dist/max/lib/auth.d.ts +20 -0
- package/dist/max/lib/auth.d.ts.map +1 -0
- package/dist/max/lib/auth.js +53 -0
- package/dist/max/lib/auth.js.map +1 -0
- package/dist/max/lib/httpClient.d.ts +25 -0
- package/dist/max/lib/httpClient.d.ts.map +1 -0
- package/dist/max/lib/httpClient.js +138 -0
- package/dist/max/lib/httpClient.js.map +1 -0
- package/dist/max/lib/maxResponse.d.ts +30 -0
- package/dist/max/lib/maxResponse.d.ts.map +1 -0
- package/dist/max/lib/maxResponse.js +132 -0
- package/dist/max/lib/maxResponse.js.map +1 -0
- package/dist/max/lib/publicApiPaths.d.ts +12 -0
- package/dist/max/lib/publicApiPaths.d.ts.map +1 -0
- package/dist/max/lib/publicApiPaths.js +15 -0
- package/dist/max/lib/publicApiPaths.js.map +1 -0
- package/dist/max/maxConfig.d.ts +31 -0
- package/dist/max/maxConfig.d.ts.map +1 -0
- package/dist/max/maxConfig.js +50 -0
- package/dist/max/maxConfig.js.map +1 -0
- package/dist/max/ui/banner.d.ts +3 -0
- package/dist/max/ui/banner.d.ts.map +1 -0
- package/dist/max/ui/banner.js +96 -0
- package/dist/max/ui/banner.js.map +1 -0
- package/dist/max.d.ts +3 -0
- package/dist/max.d.ts.map +1 -0
- package/dist/max.js +94 -0
- package/dist/max.js.map +1 -0
- package/dist/scripts/postinstall.d.ts +8 -0
- package/dist/scripts/postinstall.d.ts.map +1 -0
- package/dist/scripts/postinstall.js +149 -0
- package/dist/scripts/postinstall.js.map +1 -0
- package/dist/skills/aggregations/SKILL.md +122 -0
- package/dist/skills/auth-and-profiles/SKILL.md +102 -0
- package/dist/skills/crm-setup/SKILL.md +385 -0
- package/dist/skills/crud-operations/SKILL.md +287 -0
- package/dist/skills/export-and-delete/SKILL.md +96 -0
- package/dist/skills/files/SKILL.md +70 -0
- package/dist/skills/filter-and-query/SKILL.md +199 -0
- package/dist/skills/frontline-agents/SKILL.md +99 -0
- package/dist/skills/frontline-api/SKILL.md +59 -0
- package/dist/skills/frontline-billing/SKILL.md +42 -0
- package/dist/skills/frontline-workflows/SKILL.md +72 -0
- package/dist/skills/max-auth/SKILL.md +76 -0
- package/dist/skills/max-chat/SKILL.md +111 -0
- package/dist/skills/notes-and-tasks/SKILL.md +128 -0
- package/dist/skills/pipeline-setup/SKILL.md +233 -0
- package/dist/skills/record-type-management/SKILL.md +104 -0
- package/dist/skills/relations/SKILL.md +153 -0
- package/dist/skills/resource-creation/SKILL.md +86 -0
- package/dist/skills/schema-design/SKILL.md +263 -0
- package/package.json +47 -0
package/README.md
ADDED
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
# @frontline/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 (Firebase ID token auth, interactive chat).
|
|
7
|
+
|
|
8
|
+
> **Note (dev):** the default base URL is `http://localhost:7010/public/v1`.
|
|
9
|
+
> When deploying to production, update it manually (per-profile, flag, or env var).
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g @frontline/cli
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Or run without installing:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx @frontline/cli --help
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Output format
|
|
24
|
+
|
|
25
|
+
All `frontline` commands print **JSON to stdout by default** so you can pipe them into `jq`, scripts, or CI. Opt into human-readable output with:
|
|
26
|
+
|
|
27
|
+
- `--pretty` — key/value blocks, spinners, icons (to stderr-safe channels)
|
|
28
|
+
- `--table` — tabular rendering for list endpoints
|
|
29
|
+
|
|
30
|
+
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.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
# `frontline` binary
|
|
35
|
+
|
|
36
|
+
## Authentication
|
|
37
|
+
|
|
38
|
+
API keys are sent via `Authorization: Bearer`.
|
|
39
|
+
|
|
40
|
+
### Login
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Default profile, default base URL (localhost in dev)
|
|
44
|
+
frontline auth login <api-key>
|
|
45
|
+
|
|
46
|
+
# Multiple environments via named profiles
|
|
47
|
+
frontline auth login <key> --profile production --base-url https://api.getfrontline.ai/public/v1
|
|
48
|
+
frontline auth login <key> --profile staging --base-url https://staging-api.example.com/public/v1
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The key is stored locally in your OS config dir (via `conf`). No `/me`/`/billing` verification is performed at login time — the key is saved as-is and validated on first real call.
|
|
52
|
+
|
|
53
|
+
### Switch / inspect profiles
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
frontline auth profiles list # all saved profiles + active one
|
|
57
|
+
frontline auth profiles use prod # change active profile
|
|
58
|
+
frontline auth whoami # hits /me with current profile
|
|
59
|
+
frontline auth logout # remove active profile
|
|
60
|
+
frontline auth logout --profile staging
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Resolution priority
|
|
64
|
+
|
|
65
|
+
`--api-key` / `--base-url` flags → `FRONTLINE_API_KEY` / `FRONTLINE_BASE_URL` env → active profile → default (`http://localhost:7010/public/v1`).
|
|
66
|
+
|
|
67
|
+
## Commands
|
|
68
|
+
|
|
69
|
+
### Agents
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
frontline agents list
|
|
73
|
+
frontline agents list --status active
|
|
74
|
+
frontline agents flows <agentId>
|
|
75
|
+
frontline agents flows <agentId> --status active
|
|
76
|
+
frontline agents analytics <agentId> --start-date 2025-01-01 --end-date 2025-12-31
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Workflows
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
frontline workflows list
|
|
83
|
+
frontline workflows list --status active
|
|
84
|
+
frontline workflows analytics <workflowId> --start-date 2025-01-01 --end-date 2025-12-31
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Billing
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
frontline billing get
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Raw API requests
|
|
94
|
+
|
|
95
|
+
For endpoints not yet mapped to a command:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
frontline api get /agents
|
|
99
|
+
frontline api get /agents --query status=active
|
|
100
|
+
frontline api get /workflows/123/analytics --query startDate=2025-01-01 endDate=2025-12-31
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Objects (CRM entities)
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
frontline object list
|
|
107
|
+
frontline object get sor__people
|
|
108
|
+
frontline object schema sor__deals
|
|
109
|
+
frontline object create --data '{"name":"custom_obj","displayName":"Custom","fields":[...]}'
|
|
110
|
+
frontline object update sor__deals --data '{"displayName":"Deals v2"}'
|
|
111
|
+
frontline object count sor__deals
|
|
112
|
+
frontline object delete sor__custom_object
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Tables (spreadsheet-like)
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
frontline table list
|
|
119
|
+
frontline table get my_table
|
|
120
|
+
frontline table create my_table --data '{"displayName":"My Table","columns":[{"name":"Name","type":"string","metadata":{"format":"text"}}]}'
|
|
121
|
+
frontline table delete my_table
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Shared sub-commands (object & table)
|
|
125
|
+
|
|
126
|
+
Both `object` and `table` expose the same set of sub-commands:
|
|
127
|
+
|
|
128
|
+
| Command | Description |
|
|
129
|
+
| ---------------- | ----------------------------------------------- |
|
|
130
|
+
| `field` | Manage fields (columns) — CRUD |
|
|
131
|
+
| `option` | Manage select-field options — CRUD |
|
|
132
|
+
| `record` / `row` | Manage rows — list, get, create, update, delete |
|
|
133
|
+
| `relation` | Link / unlink related records |
|
|
134
|
+
| `view` | Manage views (object only) — CRUD |
|
|
135
|
+
| `record-type` | Manage record types (object only) |
|
|
136
|
+
| `note` | Notes on rows — CRUD |
|
|
137
|
+
| `task` | Tasks on rows — CRUD + complete / uncomplete |
|
|
138
|
+
| `file` | Files on rows — list, get, download, delete |
|
|
139
|
+
| `aggregation` | Aggregations — CRUD + compute |
|
|
140
|
+
| `export` | Export data as XLSX or CSV |
|
|
141
|
+
|
|
142
|
+
Run `frontline <resource> <subcommand> --help` for details and examples.
|
|
143
|
+
|
|
144
|
+
### Global flags
|
|
145
|
+
|
|
146
|
+
Every `frontline` command accepts:
|
|
147
|
+
|
|
148
|
+
- `--api-key <key>` — override stored API key for a single call
|
|
149
|
+
- `--base-url <url>` — override stored base URL for a single call
|
|
150
|
+
- `--profile <name>` — use a specific saved profile
|
|
151
|
+
- `--debug` — verbose request/response logs (token is redacted)
|
|
152
|
+
- `--pretty` — human-readable output
|
|
153
|
+
- `--table` — tabular output for list endpoints
|
|
154
|
+
|
|
155
|
+
## Claude Code Skills
|
|
156
|
+
|
|
157
|
+
Install Frontline skills into Claude Code (auto-detected on `npm install`):
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
frontline setup --claude-skills # install new skills
|
|
161
|
+
frontline setup --claude-skills --force # overwrite existing
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Skills currently shipped:
|
|
165
|
+
|
|
166
|
+
- **Public API:** `frontline-agents`, `frontline-workflows`, `frontline-billing`, `frontline-api`
|
|
167
|
+
- **Max:** `max-chat`, `max-auth`
|
|
168
|
+
- **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`
|
|
169
|
+
|
|
170
|
+
## Debugging
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
frontline agents list --debug
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Troubleshooting
|
|
177
|
+
|
|
178
|
+
- **"No API key found"** — run `frontline auth login <key>` or set `FRONTLINE_API_KEY`.
|
|
179
|
+
- **"Missing or invalid API key"** — key expired / revoked. Generate a new one.
|
|
180
|
+
- **"Request timed out"** — check network; if using a custom base URL, verify with `frontline auth profiles list`.
|
|
181
|
+
- **Rate limit** — public API allows 100 req/min.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
# `max` binary
|
|
186
|
+
|
|
187
|
+
Browser-based sign-in (Firebase ID token flow). Same npm package exposes the `max` command after install.
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
max --help
|
|
191
|
+
max auth login
|
|
192
|
+
max auth login --google
|
|
193
|
+
max auth login --microsoft
|
|
194
|
+
max auth login --email
|
|
195
|
+
max auth login --otp
|
|
196
|
+
max auth whoami
|
|
197
|
+
max auth logout
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Chat with Max
|
|
201
|
+
|
|
202
|
+
After signing in, you can send messages:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
# Send message (uses last conversation by default)
|
|
206
|
+
max "Hola"
|
|
207
|
+
|
|
208
|
+
# Start a new conversation
|
|
209
|
+
max --new "Hola"
|
|
210
|
+
|
|
211
|
+
# Explicit conversation id
|
|
212
|
+
max --conversation 123 "Hola"
|
|
213
|
+
|
|
214
|
+
# Alternative explicit command form
|
|
215
|
+
max chat send "Hola"
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
You can also start an interactive session (so you don't have to type `max` every time):
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
max chat
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Inside the interactive prompt, use:
|
|
225
|
+
|
|
226
|
+
- `:help` for commands
|
|
227
|
+
- `:new` to start a new conversation
|
|
228
|
+
- `:conv <id>` to switch conversations
|
|
229
|
+
- `:exit` to quit
|
|
230
|
+
|
|
231
|
+
## Configuration
|
|
232
|
+
|
|
233
|
+
The Max API base defaults to `https://prod-api.getfrontline.ai/api/v2`.
|
|
234
|
+
Override with `--api-base-url` or set `MAX_API_BASE_URL`:
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
export MAX_API_BASE_URL="https://localhost:7010/api/v2"
|
|
238
|
+
max --new "Hola" --debug
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Terminal logo (optional)
|
|
242
|
+
|
|
243
|
+
The package ships a bundled logo at `packages/cli/assets/logo3.png` (included in the published npm package via `package.json` → `files`). The CLI looks for it automatically.
|
|
244
|
+
|
|
245
|
+
Override the path:
|
|
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
|
+
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../../src/commands/agents/analytics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwCpC,eAAO,MAAM,sBAAsB,SAyD7B,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.agentsAnalyticsCommand = void 0;
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const httpClient_1 = require("../../lib/httpClient");
|
|
10
|
+
const output_1 = require("../../lib/output");
|
|
11
|
+
const helpEpilog_1 = require("../../lib/helpEpilog");
|
|
12
|
+
exports.agentsAnalyticsCommand = new commander_1.Command("analytics")
|
|
13
|
+
.description("Get analytics for a specific agent")
|
|
14
|
+
.argument("<agentId>", "Agent ID")
|
|
15
|
+
.option("--start-date <date>", "Start date (YYYY-MM-DD)")
|
|
16
|
+
.option("--end-date <date>", "End date (YYYY-MM-DD)")
|
|
17
|
+
.option("--pretty", "Pretty human-readable output")
|
|
18
|
+
.option("--table", "Render as table")
|
|
19
|
+
.option("--api-key <key>", helpEpilog_1.FRONTLINE_API_KEY_OPTION)
|
|
20
|
+
.option("--base-url <url>", helpEpilog_1.FRONTLINE_BASE_URL_OPTION)
|
|
21
|
+
.option("--profile <name>", helpEpilog_1.FRONTLINE_PROFILE_OPTION)
|
|
22
|
+
.option("--debug", "Show debug information (redacted token)")
|
|
23
|
+
.action(async (agentId, options) => {
|
|
24
|
+
let data;
|
|
25
|
+
try {
|
|
26
|
+
data = await (0, httpClient_1.apiGet)({
|
|
27
|
+
path: `/agents/${agentId}/analytics`,
|
|
28
|
+
query: {
|
|
29
|
+
startDate: options.startDate,
|
|
30
|
+
endDate: options.endDate,
|
|
31
|
+
},
|
|
32
|
+
apiKey: options.apiKey,
|
|
33
|
+
baseUrl: options.baseUrl,
|
|
34
|
+
profile: options.profile,
|
|
35
|
+
debug: options.debug,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
40
|
+
const hint = err.hint;
|
|
41
|
+
(0, output_1.error)("api_error", message, output_1.EXIT_CODES.GENERAL_ERROR, { suggestion: hint });
|
|
42
|
+
}
|
|
43
|
+
if (options.pretty || options.table) {
|
|
44
|
+
console.log(chalk_1.default.bold("\nSummary"));
|
|
45
|
+
(0, output_1.printKeyValue)({
|
|
46
|
+
"Total Credits": data.summary.totalCredits,
|
|
47
|
+
"Total Conversations": data.summary.totalConversations,
|
|
48
|
+
});
|
|
49
|
+
if (data.creditsByDate.length > 0) {
|
|
50
|
+
console.log(chalk_1.default.bold("\nCredits by Date"));
|
|
51
|
+
(0, output_1.printTable)(data.creditsByDate, [
|
|
52
|
+
"date",
|
|
53
|
+
"totalCredits",
|
|
54
|
+
]);
|
|
55
|
+
}
|
|
56
|
+
if (data.conversationsByChannel.length > 0) {
|
|
57
|
+
console.log(chalk_1.default.bold("\nConversations by Channel"));
|
|
58
|
+
(0, output_1.printTable)(data.conversationsByChannel, [
|
|
59
|
+
"channel",
|
|
60
|
+
"totalConversations",
|
|
61
|
+
]);
|
|
62
|
+
}
|
|
63
|
+
process.exit(0);
|
|
64
|
+
}
|
|
65
|
+
(0, output_1.success)(data);
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=analytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiCpC,eAAO,MAAM,kBAAkB,SAuCzB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.agentsFlowsCommand = void 0;
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const httpClient_1 = require("../../lib/httpClient");
|
|
6
|
+
const output_1 = require("../../lib/output");
|
|
7
|
+
const helpEpilog_1 = require("../../lib/helpEpilog");
|
|
8
|
+
exports.agentsFlowsCommand = new commander_1.Command("flows")
|
|
9
|
+
.description("List flows for a specific agent")
|
|
10
|
+
.argument("<agentId>", "Agent ID")
|
|
11
|
+
.option("--status <status>", "Filter by flow status")
|
|
12
|
+
.option("--pretty", "Pretty human-readable output")
|
|
13
|
+
.option("--table", "Render as table")
|
|
14
|
+
.option("--api-key <key>", helpEpilog_1.FRONTLINE_API_KEY_OPTION)
|
|
15
|
+
.option("--base-url <url>", helpEpilog_1.FRONTLINE_BASE_URL_OPTION)
|
|
16
|
+
.option("--profile <name>", helpEpilog_1.FRONTLINE_PROFILE_OPTION)
|
|
17
|
+
.option("--debug", "Show debug information (redacted token)")
|
|
18
|
+
.action(async (agentId, options) => {
|
|
19
|
+
let data;
|
|
20
|
+
try {
|
|
21
|
+
data = await (0, httpClient_1.apiGet)({
|
|
22
|
+
path: `/agents/${agentId}/flows`,
|
|
23
|
+
query: { status: options.status },
|
|
24
|
+
apiKey: options.apiKey,
|
|
25
|
+
baseUrl: options.baseUrl,
|
|
26
|
+
profile: options.profile,
|
|
27
|
+
debug: options.debug,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
32
|
+
const hint = err.hint;
|
|
33
|
+
(0, output_1.error)("api_error", message, output_1.EXIT_CODES.GENERAL_ERROR, { suggestion: hint });
|
|
34
|
+
}
|
|
35
|
+
if (options.pretty || options.table) {
|
|
36
|
+
(0, output_1.printTable)(data.results, [
|
|
37
|
+
"id",
|
|
38
|
+
"name",
|
|
39
|
+
"status",
|
|
40
|
+
"runCount",
|
|
41
|
+
"createdAt",
|
|
42
|
+
]);
|
|
43
|
+
process.exit(0);
|
|
44
|
+
}
|
|
45
|
+
(0, output_1.success)(data);
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=flows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flows.js","sourceRoot":"","sources":["../../../src/commands/agents/flows.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,qDAA8C;AAC9C,6CAA0E;AAC1E,qDAI8B;AA0BjB,QAAA,kBAAkB,GAAG,IAAI,mBAAO,CAAC,OAAO,CAAC;KACjD,WAAW,CAAC,iCAAiC,CAAC;KAC9C,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC;KACjC,MAAM,CAAC,mBAAmB,EAAE,uBAAuB,CAAC;KACpD,MAAM,CAAC,UAAU,EAAE,8BAA8B,CAAC;KAClD,MAAM,CAAC,SAAS,EAAE,iBAAiB,CAAC;KACpC,MAAM,CAAC,iBAAiB,EAAE,qCAAwB,CAAC;KACnD,MAAM,CAAC,kBAAkB,EAAE,sCAAyB,CAAC;KACrD,MAAM,CAAC,kBAAkB,EAAE,qCAAwB,CAAC;KACpD,MAAM,CAAC,SAAS,EAAE,yCAAyC,CAAC;KAC5D,MAAM,CAAC,KAAK,EAAE,OAAe,EAAE,OAAqB,EAAE,EAAE;IACrD,IAAI,IAAmB,CAAC;IACxB,IAAI,CAAC;QACD,IAAI,GAAG,MAAM,IAAA,mBAAM,EAAgB;YAC/B,IAAI,EAAE,WAAW,OAAO,QAAQ;YAChC,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE;YACjC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,KAAK,EAAE,OAAO,CAAC,KAAK;SACvB,CAAC,CAAC;IACP,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACpB,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,MAAM,IAAI,GAAI,GAAyB,CAAC,IAAI,CAAC;QAC7C,IAAA,cAAK,EAAC,WAAW,EAAE,OAAO,EAAE,mBAAU,CAAC,aAAa,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IAChF,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClC,IAAA,mBAAU,EAAC,IAAK,CAAC,OAA+C,EAAE;YAC9D,IAAI;YACJ,MAAM;YACN,QAAQ;YACR,UAAU;YACV,WAAW;SACd,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,IAAA,gBAAO,EAAC,IAAK,CAAC,CAAC;AACnB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/agents/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgCpC,eAAO,MAAM,iBAAiB,SAwCxB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.agentsListCommand = void 0;
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const httpClient_1 = require("../../lib/httpClient");
|
|
6
|
+
const output_1 = require("../../lib/output");
|
|
7
|
+
const helpEpilog_1 = require("../../lib/helpEpilog");
|
|
8
|
+
exports.agentsListCommand = new commander_1.Command("list")
|
|
9
|
+
.description("List all agents (JSON by default; use --pretty/--table for human-readable output)")
|
|
10
|
+
.option("--status <status>", "Filter by status (e.g. active, inactive, draft)")
|
|
11
|
+
.option("--pretty", "Pretty human-readable output")
|
|
12
|
+
.option("--table", "Render as table")
|
|
13
|
+
.option("--api-key <key>", helpEpilog_1.FRONTLINE_API_KEY_OPTION)
|
|
14
|
+
.option("--base-url <url>", helpEpilog_1.FRONTLINE_BASE_URL_OPTION)
|
|
15
|
+
.option("--profile <name>", helpEpilog_1.FRONTLINE_PROFILE_OPTION)
|
|
16
|
+
.option("--debug", "Show debug information (redacted token)")
|
|
17
|
+
.action(async (options) => {
|
|
18
|
+
let data;
|
|
19
|
+
try {
|
|
20
|
+
data = await (0, httpClient_1.apiGet)({
|
|
21
|
+
path: "/agents",
|
|
22
|
+
query: { status: options.status },
|
|
23
|
+
apiKey: options.apiKey,
|
|
24
|
+
baseUrl: options.baseUrl,
|
|
25
|
+
profile: options.profile,
|
|
26
|
+
debug: options.debug,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
31
|
+
const hint = err.hint;
|
|
32
|
+
(0, output_1.error)("api_error", message, output_1.EXIT_CODES.GENERAL_ERROR, { suggestion: hint });
|
|
33
|
+
}
|
|
34
|
+
if (options.pretty || options.table) {
|
|
35
|
+
(0, output_1.printTable)(data.results, [
|
|
36
|
+
"id",
|
|
37
|
+
"name",
|
|
38
|
+
"status",
|
|
39
|
+
"createdAt",
|
|
40
|
+
"updatedAt",
|
|
41
|
+
]);
|
|
42
|
+
process.exit(0);
|
|
43
|
+
}
|
|
44
|
+
(0, output_1.success)(data);
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/agents/list.ts"],"names":[],"mappings":";;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IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClC,IAAA,mBAAU,EAAC,IAAK,CAAC,OAA+C,EAAE;YAC9D,IAAI;YACJ,MAAM;YACN,QAAQ;YACR,WAAW;YACX,WAAW;SACd,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,IAAA,gBAAO,EAAC,IAAK,CAAC,CAAC;AACnB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"raw.d.ts","sourceRoot":"","sources":["../../../src/commands/api/raw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgCpC,eAAO,MAAM,aAAa,SAuCpB,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.apiRawCommand = void 0;
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const httpClient_1 = require("../../lib/httpClient");
|
|
6
|
+
const output_1 = require("../../lib/output");
|
|
7
|
+
const helpEpilog_1 = require("../../lib/helpEpilog");
|
|
8
|
+
function parseQueryParams(pairs) {
|
|
9
|
+
const query = {};
|
|
10
|
+
if (!pairs)
|
|
11
|
+
return query;
|
|
12
|
+
for (const pair of pairs) {
|
|
13
|
+
const eqIndex = pair.indexOf("=");
|
|
14
|
+
if (eqIndex === -1) {
|
|
15
|
+
query[pair] = "";
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
query[pair.slice(0, eqIndex)] = pair.slice(eqIndex + 1);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return query;
|
|
22
|
+
}
|
|
23
|
+
exports.apiRawCommand = new commander_1.Command("raw")
|
|
24
|
+
.description("Escape hatch: authenticated GET against the same Public API base URL as other commands (path is relative to that base, e.g. /agents).")
|
|
25
|
+
.argument("<method>", "HTTP method (only get is supported today)")
|
|
26
|
+
.argument("<path>", "Path under the Public API root (must start with /), e.g. /agents or /workflows")
|
|
27
|
+
.option("--query <pairs...>", "Query parameters as key=value pairs")
|
|
28
|
+
.option("--api-key <key>", helpEpilog_1.FRONTLINE_API_KEY_OPTION)
|
|
29
|
+
.option("--base-url <url>", helpEpilog_1.FRONTLINE_BASE_URL_OPTION)
|
|
30
|
+
.option("--profile <name>", helpEpilog_1.FRONTLINE_PROFILE_OPTION)
|
|
31
|
+
.option("--debug", "Show debug information (redacted token)")
|
|
32
|
+
.action(async (method, path, options) => {
|
|
33
|
+
if (method.toLowerCase() !== "get") {
|
|
34
|
+
(0, output_1.error)("unsupported_method", `Only GET requests are supported. Got: ${method}`, output_1.EXIT_CODES.BAD_INPUT);
|
|
35
|
+
}
|
|
36
|
+
const query = parseQueryParams(options.query);
|
|
37
|
+
try {
|
|
38
|
+
const data = await (0, httpClient_1.apiGet)({
|
|
39
|
+
path,
|
|
40
|
+
query,
|
|
41
|
+
apiKey: options.apiKey,
|
|
42
|
+
baseUrl: options.baseUrl,
|
|
43
|
+
profile: options.profile,
|
|
44
|
+
debug: options.debug,
|
|
45
|
+
});
|
|
46
|
+
(0, output_1.success)(data);
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
50
|
+
const hint = err.hint;
|
|
51
|
+
(0, output_1.error)("api_error", message, output_1.EXIT_CODES.GENERAL_ERROR, { suggestion: hint });
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=raw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"raw.js","sourceRoot":"","sources":["../../../src/commands/api/raw.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,qDAA8C;AAC9C,6CAA8D;AAC9D,qDAI8B;AAU9B,SAAS,gBAAgB,CAAC,KAAgB;IACtC,MAAM,KAAK,GAA2B,EAAE,CAAC;IACzC,IAAI,C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,mBAAM,EAAC;YACtB,IAAI;YACJ,KAAK;YACL,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,KAAK,EAAE,OAAO,CAAC,KAAK;SACvB,CAAC,CAAC;QACH,IAAA,gBAAO,EAAC,IAAI,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACpB,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,MAAM,IAAI,GAAI,GAAyB,CAAC,IAAI,CAAC;QAC7C,IAAA,cAAK,EAAC,WAAW,EAAE,OAAO,EAAE,mBAAU,CAAC,aAAa,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IAChF,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +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;AAmBpC,eAAO,MAAM,YAAY,SAmCnB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loginCommand = void 0;
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const config_1 = require("../../lib/config");
|
|
6
|
+
const output_1 = require("../../lib/output");
|
|
7
|
+
const helpEpilog_1 = require("../../lib/helpEpilog");
|
|
8
|
+
const maxConfig_1 = require("../../max/maxConfig");
|
|
9
|
+
const banner_1 = require("../../max/ui/banner");
|
|
10
|
+
exports.loginCommand = new commander_1.Command("login")
|
|
11
|
+
.description("Store an API key for the current (or specified) profile. Does NOT verify the key.")
|
|
12
|
+
.argument("<api-key>", "Your Frontline API key")
|
|
13
|
+
.option("--base-url <url>", `Advanced: Public API base URL (default: ${(0, config_1.getDefaultBaseUrl)()})`)
|
|
14
|
+
.option("--profile <name>", "Profile name (default: current profile)")
|
|
15
|
+
.addHelpText("after", `\n${helpEpilog_1.FRONTLINE_AUTH_LOGIN_EPILOG}\n`)
|
|
16
|
+
.action(async (apiKey, opts) => {
|
|
17
|
+
await (0, banner_1.printFrontlineLogo)();
|
|
18
|
+
const profileName = opts.profile ?? (0, config_1.getCurrentProfile)();
|
|
19
|
+
const existing = (0, config_1.getProfile)(profileName);
|
|
20
|
+
const baseUrl = opts.baseUrl ?? existing?.baseUrl ?? (0, config_1.getDefaultBaseUrl)();
|
|
21
|
+
(0, config_1.setProfile)(profileName, { apiKey, baseUrl });
|
|
22
|
+
// Always overwrite the matching Max profile too (shared credential).
|
|
23
|
+
const existingMax = (0, maxConfig_1.getMaxProfile)(profileName);
|
|
24
|
+
(0, maxConfig_1.setMaxProfile)(profileName, { ...(existingMax ?? {}), apiKey });
|
|
25
|
+
// If the caller named a profile explicitly, also switch to it so
|
|
26
|
+
// subsequent commands without --profile use it.
|
|
27
|
+
if (opts.profile) {
|
|
28
|
+
(0, config_1.setCurrentProfile)(profileName);
|
|
29
|
+
(0, maxConfig_1.setMaxCurrentProfile)(profileName);
|
|
30
|
+
}
|
|
31
|
+
(0, output_1.info)(`API key saved to profile "${profileName}"`);
|
|
32
|
+
(0, output_1.success)({
|
|
33
|
+
authenticated: true,
|
|
34
|
+
profile: profileName,
|
|
35
|
+
key_preview: apiKey.substring(0, 5) + "...",
|
|
36
|
+
config_path: (0, config_1.getConfigPath)(),
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=login.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/commands/auth/login.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,6CAO0B;AAC1B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