@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
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontline-internals
|
|
3
|
+
description: >
|
|
4
|
+
Internal workings of the Frontline platform: how the base CRM objects
|
|
5
|
+
(Company, Deals, People, Tickets) relate to each other, how activity
|
|
6
|
+
synchronization works automatically for People and Companies, and how
|
|
7
|
+
periodic consolidation keeps CRM records up to date. Read this skill
|
|
8
|
+
before designing new entities or fields to avoid duplicating behavior
|
|
9
|
+
that the system already handles automatically.
|
|
10
|
+
allowed-tools: Bash(frontline:*)
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Frontline Internal System Mechanics
|
|
14
|
+
|
|
15
|
+
Understanding how Frontline works internally is critical **before** designing
|
|
16
|
+
new objects, fields, or relations. Many common CRM needs are already handled
|
|
17
|
+
automatically by the platform.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 1. Base Objects and Their Relationships
|
|
22
|
+
|
|
23
|
+
Frontline ships with four core objects that form the foundation of every
|
|
24
|
+
account. They are pre-provisioned and cannot be deleted.
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
standard__companies — Organizations / accounts
|
|
28
|
+
standard__people — Individual contacts
|
|
29
|
+
standard__deals — Sales opportunities
|
|
30
|
+
standard__tickets — Support or service requests
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Built-in Relations
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
People → Companies (many-to-many)
|
|
37
|
+
Deals → People (many-to-many)
|
|
38
|
+
Deals → Company (many-to-one)
|
|
39
|
+
Tickets → People (many-to-many)
|
|
40
|
+
Tickets → Company (many-to-one)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
> **Before creating a new entity**, check whether it fits naturally as a
|
|
44
|
+
> custom object linked to one of these four. Most vertical use cases (leads,
|
|
45
|
+
> vendors, partners, subscribers) are best modeled as extensions of People or
|
|
46
|
+
> Companies rather than standalone objects.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 2. Automatic Activity Synchronization
|
|
51
|
+
|
|
52
|
+
When an account grants the required permissions, Frontline automatically
|
|
53
|
+
captures and attaches **activity records** to People and Company objects.
|
|
54
|
+
You do **not** need to create these manually or build pipelines to collect them.
|
|
55
|
+
|
|
56
|
+
### Activity Types (peopleActivity / companyActivity)
|
|
57
|
+
|
|
58
|
+
Each activity record has a `type` field that identifies the source:
|
|
59
|
+
|
|
60
|
+
| Type | Description |
|
|
61
|
+
| --------------- | ------------------------------------------------------------ |
|
|
62
|
+
| `email` | Inbound or outbound emails linked to the contact or company |
|
|
63
|
+
| `conversation` | Chat/messaging interactions (Slack, etc.) |
|
|
64
|
+
| _(more coming)_ | The system is designed to receive additional types over time |
|
|
65
|
+
|
|
66
|
+
Activity records are stored as `peopleActivity` (for People) or
|
|
67
|
+
`companyActivity` (for Companies) and are surfaced automatically in the
|
|
68
|
+
record's activity feed.
|
|
69
|
+
|
|
70
|
+
### What this means in practice
|
|
71
|
+
|
|
72
|
+
- **You do not need an "Emails" table.** Emails are synced automatically.
|
|
73
|
+
- **You do not need a "Conversations" table.** Those are synced automatically.
|
|
74
|
+
- If you need to query or filter activities, use the activity endpoints
|
|
75
|
+
rather than creating a parallel data structure.
|
|
76
|
+
|
|
77
|
+
> **Before building a new data pipeline or table to capture interactions**,
|
|
78
|
+
> verify whether that interaction type is already handled by the activity
|
|
79
|
+
> sync. Adding a duplicate table leads to split history and inconsistent data.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 3. Periodic Consolidation
|
|
84
|
+
|
|
85
|
+
Beyond real-time activity sync, Frontline runs **periodic consolidation jobs**
|
|
86
|
+
that aggregate and summarize information at the People and Company level.
|
|
87
|
+
|
|
88
|
+
### What gets consolidated
|
|
89
|
+
|
|
90
|
+
- **Last Interaction** — The most recent interaction date across all activity
|
|
91
|
+
types is computed and written to the People record. For Companies, this is
|
|
92
|
+
further propagated from all linked People: the Company's `Last Interaction`
|
|
93
|
+
always reflects the freshest interaction across any of its contacts.
|
|
94
|
+
- **Profile Insights (Structured AI Assessments)** — The system evaluates the
|
|
95
|
+
state of the relationship and record data.
|
|
96
|
+
- **For People**: Sentiment (very_positive to very_negative), Engagement
|
|
97
|
+
Level (highly_engaged to at_risk), key relationship description, identified
|
|
98
|
+
Risks (e.g., churn signals), and Opportunities.
|
|
99
|
+
- **For Companies**: Connection Strength (Strong/Medium/Weak), Key People
|
|
100
|
+
discovery (stakeholders), and Company Mission extraction.
|
|
101
|
+
- **Key Topics** — A list of the top 3-5 recurring themes in interactions
|
|
102
|
+
(e.g., "Pricing", "Onboarding", "Product Feedback").
|
|
103
|
+
- **Summaries** — Concise, professional overviews of the person or company
|
|
104
|
+
based on all recent context.
|
|
105
|
+
|
|
106
|
+
### Implications for custom fields
|
|
107
|
+
|
|
108
|
+
- Do **not** build a custom "last email date" or "last activity date" field
|
|
109
|
+
and try to keep it in sync manually via hooks or external automation.
|
|
110
|
+
The system already maintains `Last Interaction` for this purpose.
|
|
111
|
+
- If you need a consolidation that does not yet exist, raise it as a
|
|
112
|
+
platform request rather than building a workaround.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## 4. Design Checklist — Before Adding New Entities or Fields
|
|
117
|
+
|
|
118
|
+
Use this checklist whenever you are about to create a new object, table, or field:
|
|
119
|
+
|
|
120
|
+
1. **Is this already a base object?**
|
|
121
|
+
Check `frontline object list` — `standard__companies`, `standard__people`,
|
|
122
|
+
`standard__deals`, `standard__tickets` may already fit.
|
|
123
|
+
|
|
124
|
+
2. **Is this interaction data?**
|
|
125
|
+
If the new entity stores emails, messages, calls, or any user-to-contact
|
|
126
|
+
interaction, check whether the activity sync already covers it before
|
|
127
|
+
building a custom table.
|
|
128
|
+
|
|
129
|
+
3. **Is this a summary or aggregate?**
|
|
130
|
+
If the field would need to be recomputed based on interactions
|
|
131
|
+
(e.g., "last contacted", "interaction count"), check if periodic
|
|
132
|
+
consolidation already provides it via built-in fields.
|
|
133
|
+
|
|
134
|
+
4. **Does a relation already exist?**
|
|
135
|
+
Run `frontline object schema <obj>` to inspect existing relations before
|
|
136
|
+
creating a new one. Duplicate relations cause inconsistent data.
|
|
137
|
+
|
|
138
|
+
5. **Only then — extend or create.**
|
|
139
|
+
If none of the above covers the need, proceed to add a custom field
|
|
140
|
+
(see `crm-setup` skill) or create a new object/table.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## 5. Memories & Intelligent Consolidation
|
|
145
|
+
|
|
146
|
+
Beyond raw activity sync, Frontline uses AI to distill important facts and
|
|
147
|
+
structured data about People and Companies. This process is called
|
|
148
|
+
**Consolidation**.
|
|
149
|
+
|
|
150
|
+
### What are "Memories"?
|
|
151
|
+
|
|
152
|
+
Memories are persistent, AI-distilled facts about a person or company that
|
|
153
|
+
provide context for future interactions. Unlike activity logs, memories are
|
|
154
|
+
long-lived and categorized.
|
|
155
|
+
|
|
156
|
+
**Categories include:**
|
|
157
|
+
|
|
158
|
+
- `DECISION`: Specific decisions made (e.g., "Decided to postpone the project until Q3").
|
|
159
|
+
- `AGREEMENT`: Agreed terms or commitments (e.g., "Agreed to a 20% discount for the first year").
|
|
160
|
+
- `PREFERENCE`: Personal or professional preferences (e.g., "Prefers morning meetings").
|
|
161
|
+
- `RISK`: Potential issues or red flags (e.g., "Customer is frustrated with current response times").
|
|
162
|
+
- `OTHER`: General facts or context (e.g., "Is a fan of the Golden State Warriors").
|
|
163
|
+
|
|
164
|
+
> **Example**: Instead of searching through 50 emails to find a contact's
|
|
165
|
+
> preferred communication channel, the system creates a `PREFERENCE` memory:
|
|
166
|
+
> _"Prefers being contacted via WhatsApp after 6pm."_
|
|
167
|
+
|
|
168
|
+
### Structured Data Extracted
|
|
169
|
+
|
|
170
|
+
During periodic consolidation, the LLM extracts and updates specific data
|
|
171
|
+
points to keep record profiles fresh:
|
|
172
|
+
|
|
173
|
+
| Object | Data Point | Description / Examples |
|
|
174
|
+
| :---------- | :------------------- | :--------------------------------------------------------- |
|
|
175
|
+
| **People** | **Profile Insights** | Sentiment, Engagement, Risks, Opportunities, Key Topics |
|
|
176
|
+
| | **Summary** | Professional overview of persona and status |
|
|
177
|
+
| **Company** | **Profile Insights** | Connection Strength, Key Stakeholders, Mission |
|
|
178
|
+
| | **Firmographics** | Revenue, Employee count, Headquarters (from external sync) |
|
|
179
|
+
|
|
180
|
+
### How this data is used
|
|
181
|
+
|
|
182
|
+
1. **Intelligent Feed**: Memories and summaries are displayed in the CRM feed to
|
|
183
|
+
give users instant context without reading threads.
|
|
184
|
+
2. **AI Reasoning (RAG)**: When an AI agent (or you, the developer) queries the
|
|
185
|
+
system, it retrieves these memories to generate responses that are
|
|
186
|
+
contextually aware.
|
|
187
|
+
3. **Automated Triggers**: Consolidated fields (like `Last Interaction` or
|
|
188
|
+
`Connection Strength`) can trigger automated workflows.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## 6. Summary
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
196
|
+
│ WHAT FRONTLINE DOES AUTOMATICALLY │
|
|
197
|
+
│ │
|
|
198
|
+
│ • Syncs emails/conversations → people/company Activity │
|
|
199
|
+
│ • Consolidates Last Interaction & Connection Strength │
|
|
200
|
+
│ │
|
|
201
|
+
│ INTELLIGENT CONSOLIDATION │
|
|
202
|
+
│ • Distills "Memories" (Decisions, Preferences, Risks, etc.) │
|
|
203
|
+
│ • Extracts Structured Data (Summary, Insights, Firmographics) │
|
|
204
|
+
│ • Updates Vector Store for context-aware AI reasoning │
|
|
205
|
+
│ │
|
|
206
|
+
│ BASE OBJECTS │
|
|
207
|
+
│ standard__companies standard__people standard__deals standard__tickets │
|
|
208
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
209
|
+
```
|
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: max-auth
|
|
3
|
-
description: Manage Max CLI authentication — store per-user API key (synced with Frontline CLI), sign out, and inspect the active profile. Use when the user needs Max terminal auth, whoami, or clearing credentials.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## Prerequisites
|
|
7
|
-
|
|
8
|
-
- The `max` CLI must be installed (`npm i -g @frontline/cli` — provides both `frontline` and `max` binaries).
|
|
9
|
-
- A **per-user API key** from the Frontline web app (Settings → API keys). The browser SSO (Firebase) flow is **paused** in the CLI; `MAX_CLI_AUTH_URL` is not required for the current flow.
|
|
10
|
-
|
|
11
|
-
## How credentials work
|
|
12
|
-
|
|
13
|
-
- `max auth login <api-key>` saves the same key to the **Max** store (`max-cli`) and the **Frontline** store (`frontline-cli`) under the **same profile name**, so `max` and `frontline` stay aligned.
|
|
14
|
-
- `max` commands call the **Public API** (`…/public/v1/max/...`) with `Authorization: Bearer <apiKey>` (USER key, same as SoR).
|
|
15
|
-
- Public API base URL: same as `frontline` — `FRONTLINE_BASE_URL`, profile `baseUrl`, or `--base-url` on each command (`max auth login --base-url …` persists it on the Frontline profile).
|
|
16
|
-
- API key resolution: `--api-key` → `MAX_API_KEY` / `FRONTLINE_API_KEY` → Max profile `apiKey` → Frontline profile `apiKey` (same name).
|
|
17
|
-
|
|
18
|
-
## Commands
|
|
19
|
-
|
|
20
|
-
### Sign in (save API key)
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
max auth login <api-key> [--profile <name>] [--base-url <url>]
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
| Option | Description |
|
|
27
|
-
| ------------------ | ---------------------------------------------------------------------------------------------------- |
|
|
28
|
-
| `<api-key>` | Per-user API key (required argument) |
|
|
29
|
-
| `--profile <name>` | Profile to save under (default: current; if set, also switches active profile for Max and Frontline) |
|
|
30
|
-
| `--base-url <url>` | Public API root for **both** `max` and `frontline` on that profile (must end with `/public/v1`) |
|
|
31
|
-
|
|
32
|
-
**Examples:**
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
max auth login flk_abc123
|
|
36
|
-
|
|
37
|
-
max auth login flk_abc123 --profile staging \
|
|
38
|
-
--base-url https://staging-api.example.com/public/v1
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### Sign out
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
max auth logout [--profile <name>] [--keep-frontline]
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
| Option | Description |
|
|
48
|
-
| ------------------ | -------------------------------------------------------------- |
|
|
49
|
-
| `--profile <name>` | Profile to clear (default: current) |
|
|
50
|
-
| `--keep-frontline` | Only clear the Max store; leave the matching Frontline profile |
|
|
51
|
-
|
|
52
|
-
By default, the matching Frontline profile is removed too.
|
|
53
|
-
|
|
54
|
-
### Check profile / credentials
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
max auth whoami [--json] [--profile <name>]
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Shows API key preview, `maxApiBaseUrl`, whether a matching Frontline profile exists, and Max config path (no JWT decode; browser SSO is paused).
|
|
61
|
-
|
|
62
|
-
### Config path
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
max config-path
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## Troubleshooting
|
|
69
|
-
|
|
70
|
-
- **"No API key saved for profile …"** — run `max auth login <api-key>` or `frontline auth login <api-key>` with the same `--profile`.
|
|
71
|
-
- **"No Max API key found"** — same as above, or set `MAX_API_KEY` / `FRONTLINE_API_KEY`.
|
|
72
|
-
- **401 on Max** — key revoked or wrong; create a new key in the app and run `max auth login` again.
|
|
73
|
-
|
|
74
|
-
## Browser SSO note
|
|
75
|
-
|
|
76
|
-
The legacy flow (`max auth login` with no argument, hosted page + localhost callback) is commented out in the package. To restore it later, see git history and `packages/cli/src/max/browserLogin.ts`.
|
|
1
|
+
---
|
|
2
|
+
name: max-auth
|
|
3
|
+
description: Manage Max CLI authentication — store per-user API key (synced with Frontline CLI), sign out, and inspect the active profile. Use when the user needs Max terminal auth, whoami, or clearing credentials.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Prerequisites
|
|
7
|
+
|
|
8
|
+
- The `max` CLI must be installed (`npm i -g @frontline/cli` — provides both `frontline` and `max` binaries).
|
|
9
|
+
- A **per-user API key** from the Frontline web app (Settings → API keys). The browser SSO (Firebase) flow is **paused** in the CLI; `MAX_CLI_AUTH_URL` is not required for the current flow.
|
|
10
|
+
|
|
11
|
+
## How credentials work
|
|
12
|
+
|
|
13
|
+
- `max auth login <api-key>` saves the same key to the **Max** store (`max-cli`) and the **Frontline** store (`frontline-cli`) under the **same profile name**, so `max` and `frontline` stay aligned.
|
|
14
|
+
- `max` commands call the **Public API** (`…/public/v1/max/...`) with `Authorization: Bearer <apiKey>` (USER key, same as SoR).
|
|
15
|
+
- Public API base URL: same as `frontline` — `FRONTLINE_BASE_URL`, profile `baseUrl`, or `--base-url` on each command (`max auth login --base-url …` persists it on the Frontline profile).
|
|
16
|
+
- API key resolution: `--api-key` → `MAX_API_KEY` / `FRONTLINE_API_KEY` → Max profile `apiKey` → Frontline profile `apiKey` (same name).
|
|
17
|
+
|
|
18
|
+
## Commands
|
|
19
|
+
|
|
20
|
+
### Sign in (save API key)
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
max auth login <api-key> [--profile <name>] [--base-url <url>]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
| Option | Description |
|
|
27
|
+
| ------------------ | ---------------------------------------------------------------------------------------------------- |
|
|
28
|
+
| `<api-key>` | Per-user API key (required argument) |
|
|
29
|
+
| `--profile <name>` | Profile to save under (default: current; if set, also switches active profile for Max and Frontline) |
|
|
30
|
+
| `--base-url <url>` | Public API root for **both** `max` and `frontline` on that profile (must end with `/public/v1`) |
|
|
31
|
+
|
|
32
|
+
**Examples:**
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
max auth login flk_abc123
|
|
36
|
+
|
|
37
|
+
max auth login flk_abc123 --profile staging \
|
|
38
|
+
--base-url https://staging-api.example.com/public/v1
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Sign out
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
max auth logout [--profile <name>] [--keep-frontline]
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
| Option | Description |
|
|
48
|
+
| ------------------ | -------------------------------------------------------------- |
|
|
49
|
+
| `--profile <name>` | Profile to clear (default: current) |
|
|
50
|
+
| `--keep-frontline` | Only clear the Max store; leave the matching Frontline profile |
|
|
51
|
+
|
|
52
|
+
By default, the matching Frontline profile is removed too.
|
|
53
|
+
|
|
54
|
+
### Check profile / credentials
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
max auth whoami [--json] [--profile <name>]
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Shows API key preview, `maxApiBaseUrl`, whether a matching Frontline profile exists, and Max config path (no JWT decode; browser SSO is paused).
|
|
61
|
+
|
|
62
|
+
### Config path
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
max config-path
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Troubleshooting
|
|
69
|
+
|
|
70
|
+
- **"No API key saved for profile …"** — run `max auth login <api-key>` or `frontline auth login <api-key>` with the same `--profile`.
|
|
71
|
+
- **"No Max API key found"** — same as above, or set `MAX_API_KEY` / `FRONTLINE_API_KEY`.
|
|
72
|
+
- **401 on Max** — key revoked or wrong; create a new key in the app and run `max auth login` again.
|
|
73
|
+
|
|
74
|
+
## Browser SSO note
|
|
75
|
+
|
|
76
|
+
The legacy flow (`max auth login` with no argument, hosted page + localhost callback) is commented out in the package. To restore it later, see git history and `packages/cli/src/max/browserLogin.ts`.
|
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: max-chat
|
|
3
|
-
description: Send messages to the Max AI assistant and manage conversations from the terminal. Use when the user wants to chat with Max, send a quick question, start a new conversation, or open an interactive chat session.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## Prerequisites
|
|
7
|
-
|
|
8
|
-
- The `max` CLI must be installed (`npm i -g @frontline/cli` — provides both `frontline` and `max` binaries).
|
|
9
|
-
- The user must have a per-user API key saved: `max auth login <api-key>` (or `frontline auth login` on the same profile).
|
|
10
|
-
|
|
11
|
-
## Commands
|
|
12
|
-
|
|
13
|
-
### Quick message (shorthand)
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
max "Your question here"
|
|
17
|
-
max --new "Start a fresh conversation"
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
This is the fastest way to send a single message to Max. It uses the last active conversation by default, or `--new` to start a fresh one.
|
|
21
|
-
|
|
22
|
-
Calls the **Public API**: `POST /public/v1/max/conversations/message` (Bearer = user API key). Responses use `{ "ok": boolean, "data": ... }`. Default stdout is **one-line JSON**; no spinner lines.
|
|
23
|
-
|
|
24
|
-
| Flag | Description |
|
|
25
|
-
| ---------------------- | ----------------------------------------------------------- |
|
|
26
|
-
| `--new` | Start a new conversation instead of continuing the last one |
|
|
27
|
-
| `--conversation <id>` | Send to a specific conversation ID |
|
|
28
|
-
| `--no-wait` | Do not poll for the assistant reply (fire and forget) |
|
|
29
|
-
| `--timeout <seconds>` | Max seconds to wait for assistant reply (default: 60) |
|
|
30
|
-
| `--json` | Print only the POST response JSON (no poll) |
|
|
31
|
-
| `--pretty` | Print assistant plain text from `data` instead of JSON |
|
|
32
|
-
| `--profile <name>` | Use a specific Max CLI profile |
|
|
33
|
-
| `--base-url <url>` | Override Public API root (…/public/v1) for this run |
|
|
34
|
-
| `--api-base-url <url>` | Deprecated alias for `--base-url` |
|
|
35
|
-
| `--api-key <key>` | Override per-user API key for this run |
|
|
36
|
-
| `--debug` | Show HTTP request/response diagnostics |
|
|
37
|
-
|
|
38
|
-
**Example:**
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
# Quick question using last conversation
|
|
42
|
-
max "What agents do I have?"
|
|
43
|
-
|
|
44
|
-
# Start a new conversation
|
|
45
|
-
max --new "Help me set up a new workflow"
|
|
46
|
-
|
|
47
|
-
# Send to a specific conversation
|
|
48
|
-
max --conversation 123 "Continue from here"
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Send a message (explicit command)
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
max chat send <message...> [--new] [--conversation <id>] [--json] [--debug]
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Same as the shorthand above but under the `chat send` subcommand. Default stdout is **one-line JSON**; **`--pretty`** for assistant plain text from `data`.
|
|
58
|
-
|
|
59
|
-
### Interactive chat (REPL)
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
max chat repl [--profile <name>] [--debug] [--timeout <seconds>]
|
|
63
|
-
max chat
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Opens an interactive readline session for back-and-forth conversation with Max.
|
|
67
|
-
|
|
68
|
-
| REPL Command | Description |
|
|
69
|
-
| ------------ | ---------------------------------------- |
|
|
70
|
-
| `:help` | Show available REPL commands |
|
|
71
|
-
| `:new` | Start a new conversation on next message |
|
|
72
|
-
| `:conv <id>` | Switch to a specific conversation ID |
|
|
73
|
-
| `:exit` | Exit the REPL |
|
|
74
|
-
| `Ctrl+C` | Exit the REPL |
|
|
75
|
-
|
|
76
|
-
**Example:**
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
# Start interactive chat
|
|
80
|
-
max chat
|
|
81
|
-
|
|
82
|
-
# Start with a specific profile
|
|
83
|
-
max chat repl --profile work --debug
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### Conversations (Public API)
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
max conversations list
|
|
90
|
-
max conversations get <id>
|
|
91
|
-
max conversations update <id> --data '{"key":"value"}'
|
|
92
|
-
max conversations abort <id>
|
|
93
|
-
# alias: max conv list
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
See `max conversations --help` for flags (`--profile`, `--base-url`, `--api-key`, `--debug`).
|
|
97
|
-
|
|
98
|
-
## Conversation management
|
|
99
|
-
|
|
100
|
-
- Max automatically remembers the last conversation ID in your profile. Subsequent messages continue that conversation.
|
|
101
|
-
- Use `--new` to explicitly start a fresh conversation.
|
|
102
|
-
- Use `--conversation <id>` to jump to a specific conversation.
|
|
103
|
-
- In the REPL, use `:new` and `:conv <id>` to manage conversations interactively.
|
|
104
|
-
|
|
105
|
-
## Troubleshooting
|
|
106
|
-
|
|
107
|
-
- **"No Max API key found"**: run `max auth login <api-key>` or `frontline auth login <api-key>` on the same profile.
|
|
108
|
-
- **"Message cannot be empty"**: provide a non-empty message string.
|
|
109
|
-
- **Timeout waiting for reply**: increase `--timeout` or use `--no-wait` and check the conversation later.
|
|
110
|
-
- Use `--debug` to see the full HTTP request URL, headers, and response status for diagnosing issues.
|
|
111
|
-
- Use `--json` for machine-readable output that can be piped to `jq` or other tools.
|
|
1
|
+
---
|
|
2
|
+
name: max-chat
|
|
3
|
+
description: Send messages to the Max AI assistant and manage conversations from the terminal. Use when the user wants to chat with Max, send a quick question, start a new conversation, or open an interactive chat session.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Prerequisites
|
|
7
|
+
|
|
8
|
+
- The `max` CLI must be installed (`npm i -g @frontline/cli` — provides both `frontline` and `max` binaries).
|
|
9
|
+
- The user must have a per-user API key saved: `max auth login <api-key>` (or `frontline auth login` on the same profile).
|
|
10
|
+
|
|
11
|
+
## Commands
|
|
12
|
+
|
|
13
|
+
### Quick message (shorthand)
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
max "Your question here"
|
|
17
|
+
max --new "Start a fresh conversation"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
This is the fastest way to send a single message to Max. It uses the last active conversation by default, or `--new` to start a fresh one.
|
|
21
|
+
|
|
22
|
+
Calls the **Public API**: `POST /public/v1/max/conversations/message` (Bearer = user API key). Responses use `{ "ok": boolean, "data": ... }`. Default stdout is **one-line JSON**; no spinner lines.
|
|
23
|
+
|
|
24
|
+
| Flag | Description |
|
|
25
|
+
| ---------------------- | ----------------------------------------------------------- |
|
|
26
|
+
| `--new` | Start a new conversation instead of continuing the last one |
|
|
27
|
+
| `--conversation <id>` | Send to a specific conversation ID |
|
|
28
|
+
| `--no-wait` | Do not poll for the assistant reply (fire and forget) |
|
|
29
|
+
| `--timeout <seconds>` | Max seconds to wait for assistant reply (default: 60) |
|
|
30
|
+
| `--json` | Print only the POST response JSON (no poll) |
|
|
31
|
+
| `--pretty` | Print assistant plain text from `data` instead of JSON |
|
|
32
|
+
| `--profile <name>` | Use a specific Max CLI profile |
|
|
33
|
+
| `--base-url <url>` | Override Public API root (…/public/v1) for this run |
|
|
34
|
+
| `--api-base-url <url>` | Deprecated alias for `--base-url` |
|
|
35
|
+
| `--api-key <key>` | Override per-user API key for this run |
|
|
36
|
+
| `--debug` | Show HTTP request/response diagnostics |
|
|
37
|
+
|
|
38
|
+
**Example:**
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Quick question using last conversation
|
|
42
|
+
max "What agents do I have?"
|
|
43
|
+
|
|
44
|
+
# Start a new conversation
|
|
45
|
+
max --new "Help me set up a new workflow"
|
|
46
|
+
|
|
47
|
+
# Send to a specific conversation
|
|
48
|
+
max --conversation 123 "Continue from here"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Send a message (explicit command)
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
max chat send <message...> [--new] [--conversation <id>] [--json] [--debug]
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Same as the shorthand above but under the `chat send` subcommand. Default stdout is **one-line JSON**; **`--pretty`** for assistant plain text from `data`.
|
|
58
|
+
|
|
59
|
+
### Interactive chat (REPL)
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
max chat repl [--profile <name>] [--debug] [--timeout <seconds>]
|
|
63
|
+
max chat
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Opens an interactive readline session for back-and-forth conversation with Max.
|
|
67
|
+
|
|
68
|
+
| REPL Command | Description |
|
|
69
|
+
| ------------ | ---------------------------------------- |
|
|
70
|
+
| `:help` | Show available REPL commands |
|
|
71
|
+
| `:new` | Start a new conversation on next message |
|
|
72
|
+
| `:conv <id>` | Switch to a specific conversation ID |
|
|
73
|
+
| `:exit` | Exit the REPL |
|
|
74
|
+
| `Ctrl+C` | Exit the REPL |
|
|
75
|
+
|
|
76
|
+
**Example:**
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Start interactive chat
|
|
80
|
+
max chat
|
|
81
|
+
|
|
82
|
+
# Start with a specific profile
|
|
83
|
+
max chat repl --profile work --debug
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Conversations (Public API)
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
max conversations list
|
|
90
|
+
max conversations get <id>
|
|
91
|
+
max conversations update <id> --data '{"key":"value"}'
|
|
92
|
+
max conversations abort <id>
|
|
93
|
+
# alias: max conv list
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
See `max conversations --help` for flags (`--profile`, `--base-url`, `--api-key`, `--debug`).
|
|
97
|
+
|
|
98
|
+
## Conversation management
|
|
99
|
+
|
|
100
|
+
- Max automatically remembers the last conversation ID in your profile. Subsequent messages continue that conversation.
|
|
101
|
+
- Use `--new` to explicitly start a fresh conversation.
|
|
102
|
+
- Use `--conversation <id>` to jump to a specific conversation.
|
|
103
|
+
- In the REPL, use `:new` and `:conv <id>` to manage conversations interactively.
|
|
104
|
+
|
|
105
|
+
## Troubleshooting
|
|
106
|
+
|
|
107
|
+
- **"No Max API key found"**: run `max auth login <api-key>` or `frontline auth login <api-key>` on the same profile.
|
|
108
|
+
- **"Message cannot be empty"**: provide a non-empty message string.
|
|
109
|
+
- **Timeout waiting for reply**: increase `--timeout` or use `--no-wait` and check the conversation later.
|
|
110
|
+
- Use `--debug` to see the full HTTP request URL, headers, and response status for diagnosing issues.
|
|
111
|
+
- Use `--json` for machine-readable output that can be piped to `jq` or other tools.
|
|
@@ -111,18 +111,18 @@ frontline object task delete <object> <task-id>
|
|
|
111
111
|
|
|
112
112
|
```bash
|
|
113
113
|
# 1. Find the row you want to annotate
|
|
114
|
-
frontline object record list
|
|
114
|
+
frontline object record list standard__deals --search "Acme"
|
|
115
115
|
# → row ID = 6625abc123def456
|
|
116
116
|
|
|
117
117
|
# 2. Add a note
|
|
118
|
-
frontline object note create
|
|
118
|
+
frontline object note create standard__deals 6625abc123def456 \
|
|
119
119
|
--content "Discussed pricing on call"
|
|
120
120
|
|
|
121
121
|
# 3. Add a follow-up task with a due date
|
|
122
|
-
frontline object task create
|
|
122
|
+
frontline object task create standard__deals 6625abc123def456 \
|
|
123
123
|
--content "Send revised proposal" \
|
|
124
124
|
--due-date 2026-05-15
|
|
125
125
|
|
|
126
126
|
# 4. Later, mark it complete
|
|
127
|
-
frontline object task complete
|
|
127
|
+
frontline object task complete standard__deals 7
|
|
128
128
|
```
|