aui-agent-builder 0.3.24 → 0.3.26

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # AUI Agent Builder CLI
2
2
 
3
- Build, configure, and manage AUI AI agents from the command line. Import agent configurations as local JSON files, edit them in your editor with full schema autocomplete, validate, and push changes back to the backend.
3
+ Build, version, and deploy AI agents from your terminal. Import agent configurations as local JSON files, edit them in your editor with full schema autocomplete, validate, push changes, and manage versions.
4
4
 
5
5
  ## Installation
6
6
 
@@ -13,568 +13,286 @@ Requires Node.js 18+.
13
13
  ## Quick Start
14
14
 
15
15
  ```bash
16
- # 1. Sign in (select your org → account → agent)
16
+ # 1. Authenticate
17
17
  aui login
18
18
 
19
- # 1b. (Optional) Switch environment
20
- aui env custom
21
-
22
- # 2. Browse and manage your agents
23
- aui agents
19
+ # 2. Create a new agent
20
+ aui agents --create
24
21
 
25
- # 3. Import an agent as local .aui.json files
22
+ # 3. Import agent config as local files
26
23
  aui import-agent
27
24
 
28
- # 4. Edit the files in VSCode / Cursor (autocomplete works out of the box)
25
+ # 4. Edit .aui.json files in your editor / Cursor
29
26
 
30
- # 5. Validate your changes
31
- aui validate
32
-
33
- # 6. Push changes back to the backend
27
+ # 5. Push changes back
34
28
  aui push
29
+
30
+ # 6. Publish and activate the version
31
+ aui version publish
32
+ aui version activate
35
33
  ```
36
34
 
37
35
  ## Hierarchy
38
36
 
39
- AUI uses a three-level hierarchy for organizing resources:
40
-
41
37
  ```
42
38
  Organization
43
39
  └── Account (Project)
44
40
  └── Agent (Network)
41
+ └── Version (v1.0, v1.1, v2.0, ...)
45
42
  ```
46
43
 
47
44
  - **Organization** — top-level workspace, tied to your login credentials
48
- - **Account (Project)** — a project within the organization (only org owners can create these)
45
+ - **Account (Project)** — a project within the organization
49
46
  - **Agent (Network)** — an AI agent within a project
50
-
51
- When you log in, the CLI walks you through selecting each level. Your selections are saved in the session so you don't have to repeat them.
52
-
53
- ## Authentication
54
-
55
- ### Email (recommended)
56
-
57
- ```bash
58
- aui login
59
- ```
60
-
61
- Select **Email**, enter your email address, and paste the verification code from your inbox. After authentication, you'll be guided through selecting your organization, account, and agent.
62
-
63
- ### Access Token
64
-
65
- ```bash
66
- aui login
67
- ```
68
-
69
- Select **Access token**, then paste your `x-access-token` from the browser DevTools (Network tab → any request → Headers).
70
-
71
- ### CLI Flags
72
-
73
- ```bash
74
- aui login --email user@example.com # Go straight to email OTP
75
- aui login --token eyJ... # Use token directly
76
- aui login --environment production # Target production
77
- ```
78
-
79
- ### Session Management
80
-
81
- When already logged in, `aui login` shows your current session and lets you:
82
-
83
- - Continue with current session
84
- - Switch organization (resets account and agent)
85
- - Switch account (project)
86
- - Switch agent
87
- - Login again
88
- - Logout
89
-
90
- Session is stored in `~/.aui/session.json`. The environment file (`~/.aui/environment`) is always updated to match the session's environment on login, so all commands stay in sync.
91
-
92
- ## Environments (`aui env`)
93
-
94
- The CLI supports multiple environments. Right now you can switch between:
95
-
96
- - **`staging`**
97
- - **`custom`** (uses the v3 base URL path)
98
- - **`production`** (wired, but URLs can be updated later)
99
-
100
- Use:
101
-
102
- ```bash
103
- aui env # Show current + interactive switch
104
- aui env staging
105
- aui env custom
106
- aui env production
107
- ```
108
-
109
- Environment selection is saved to `~/.aui/environment`.
110
-
111
- ### Environment ↔ Session Sync
112
-
113
- The environment and auth session are always kept in sync:
114
-
115
- - **`aui login`** — after authenticating, the selected environment is automatically saved to `~/.aui/environment`. This ensures commands like `push`, `pull`, and `sync` use the same environment as the session token.
116
- - **`aui env`** — when switching to a different environment, the CLI clears the existing session (since the token belongs to the old environment) and automatically starts the login flow for the new environment.
117
-
118
- This prevents mismatches where API requests hit one environment with a token issued for another.
47
+ - **Version** — a snapshot of the agent's configuration (draft → published → active)
119
48
 
120
49
  ## Commands
121
50
 
122
- ### Core Workflow
123
-
124
- | Command | Description |
125
- | ------------------------ | ------------------------------------------------------ |
126
- | `aui login` | Authenticate and select org → account → agent |
127
- | `aui env [env]` | Show or switch environment (staging/custom/production) |
128
- | `aui create-agent [dir]` | Scaffold a new blank agent project with examples |
129
- | `aui import-agent [id]` | Download an agent as local `.aui.json` files |
130
- | `aui validate [path]` | Validate `.aui.json` files for errors |
131
- | `aui push` | Upload local changes to the backend |
132
- | `aui status` | Show session, linked agent, and file summary |
133
- | `aui diff [a] [b]` | Compare two agent configurations |
134
-
135
- ### Management
136
-
137
- | Command | Description |
138
- | ----------------- | -------------------------------------------- |
139
- | `aui accounts` | Manage accounts list, create, switch |
140
- | `aui agents` | Manage agents list, create, switch, import |
141
- | `aui list-agents` | Quick table view of agents in your account |
51
+ ### Authentication
52
+
53
+ | Command | Description |
54
+ |---------|-------------|
55
+ | `aui login` | Authenticate with AUI |
56
+ | `aui login --environment custom` | Login to a specific environment |
57
+ | `aui login --token <jwt>` | Login with a JWT token directly |
58
+ | `aui logout` | Clear local session and credentials |
59
+
60
+ After login, the CLI suggests your next steps: import an existing agent or create a new one.
61
+
62
+ ### Agent Creation
63
+
64
+ | Command | Description |
65
+ |---------|-------------|
66
+ | `aui agents --create` | Interactive: select org → account → enter name. Uses General category by default |
67
+ | `aui agents --create --name "My Agent"` | Create with a specific name (still prompts for org/account) |
68
+ | `aui agents --create --name "My Agent" --category GOOGLE_FLIGHTS-V3` | Create with a specific category (by key or name) |
69
+ | `aui agents --create --name "My Agent" --account-id <id>` | Skip org/account selection |
70
+ | `aui agents --create --name "My Agent" --network-id <id>` | Register agent on an existing network |
71
+ | `aui agents --create --full` | Create + version + publish + activate in one command |
72
+ | `aui agents --list` | List all agents in the current account |
73
+ | `aui agents --switch` | Switch which agent is selected in your session |
74
+
75
+ ### Import & Pull
76
+
77
+ | Command | Description |
78
+ |---------|-------------|
79
+ | `aui import-agent` | Interactive: select org → account → agent. Auto-selects active version |
80
+ | `aui import-agent <agent-id>` | Import a specific agent by network ID |
81
+ | `aui import-agent --version <id>` | Import a specific version of the current session's agent |
82
+ | `aui pull` | Pull latest config into an existing project (requires `.auirc`) |
83
+ | `aui pull --force` | Pull without overwrite confirmation |
84
+
85
+ ### Version Management
86
+
87
+ | Command | Description |
88
+ |---------|-------------|
89
+ | `aui version` | Interactive version menu |
90
+ | `aui version list` | List all versions with status, stats, and active marker |
91
+ | `aui version list --base-only` | List only base versions (no revisions) |
92
+ | `aui version list --version-number 3` | List all revisions of version 3 |
93
+ | `aui version create` | Interactive: choose source, bump mode, metadata |
94
+ | `aui version create --source agent-scope` | Create new major version from live scope (v1.0, v2.0) |
95
+ | `aui version create --source version --from <id>` | Create revision by cloning (v1.0 → v1.1) |
96
+ | `aui version create --source version --from <id> --bump version_number` | Major bump from clone (v1.0 → v2.0) |
97
+ | `aui version publish` | Publish a draft (locks it permanently) |
98
+ | `aui version publish <id>` | Publish a specific draft |
99
+ | `aui version activate` | Activate a published version as live |
100
+ | `aui version activate <id>` | Activate a specific version |
101
+ | `aui version archive <id>` | Archive a published version |
102
+ | `aui version get <id>` | View full version details |
103
+ | `aui version update <id> --label X --tags Y --notes Z` | Update version metadata |
104
+
105
+ ### Push
106
+
107
+ | Command | Description |
108
+ |---------|-------------|
109
+ | `aui push` | Push changes. Versioned agents: finds/creates draft, pushes with `agent_version_id`. Old agents: pushes to live scope |
110
+ | `aui push --version-id <id>` | Push into a specific version draft |
111
+ | `aui push --dry-run` | Preview what would be pushed |
112
+ | `aui push --force` | Push even if validation fails |
113
+ | `aui push --skip-validation` | Skip validation step |
114
+
115
+ ### Development
116
+
117
+ | Command | Description |
118
+ |---------|-------------|
119
+ | `aui validate [path]` | Validate `.aui.json` files against schemas |
120
+ | `aui diff [a] [b]` | Compare configs or show changes since import |
121
+ | `aui status` | Show session, linked agent, and project summary |
142
122
 
143
123
  ### Configuration
144
124
 
145
- | Command | Description |
146
- | --------------------- | --------------------------------------------------- |
147
- | `aui add-integration` | Add an integration (API, RAG, or MCP) |
148
- | `aui rag` | Manage RAG knowledge bases — upload, export, update |
149
- | `aui chat` | Interactive conversation with an agent |
150
-
151
- ### Aliases
125
+ | Command | Description |
126
+ |---------|-------------|
127
+ | `aui account` | Manage accounts list, create, switch |
128
+ | `aui env [environment]` | Show or switch environment |
129
+ | `aui pull-schema` | Fetch domain schemas from backend |
130
+ | `aui add-integration` | Add an integration (API, RAG, or MCP) |
131
+ | `aui rag` | Manage RAG knowledge bases and files |
152
132
 
153
- | Alias | Equivalent |
154
- | ------------- | ------------------ |
155
- | `aui import` | `aui import-agent` |
156
- | `aui account` | `aui accounts` |
157
- | `aui agent` | `aui agents` |
158
- | `aui ls` | `aui list-agents` |
133
+ ### Tools
159
134
 
160
- ## Account Management
135
+ | Command | Description |
136
+ |---------|-------------|
137
+ | `aui chat` | Start a conversation with an AUI agent |
138
+ | `aui serve` | Launch web-based chat playground |
139
+ | `aui revert` | Reset to HEAD (discard local changes) |
140
+ | `aui upgrade` | Update aui-agent-builder to latest version |
161
141
 
162
- Manage accounts (projects) within your organization:
163
-
164
- ```bash
165
- aui accounts
166
- ```
167
-
168
- Interactive menu with options to:
169
-
170
- - **List** all accounts with status and creation date
171
- - **Create** a new account (org owner permission required)
172
- - **Switch** active account
173
-
174
- Quick shortcuts:
142
+ ### Aliases
175
143
 
176
- ```bash
177
- aui accounts --list
178
- aui accounts --create "My Project"
179
- aui accounts --switch
180
- ```
144
+ | Alias | Equivalent |
145
+ |-------|------------|
146
+ | `aui import` | `aui import-agent` |
147
+ | `aui account` | `aui accounts` |
148
+ | `aui agent` | `aui agents` |
149
+ | `aui ls` | `aui list-agents` |
150
+ | `aui versions` | `aui version` |
181
151
 
182
- ## Agent Management
152
+ ## Workflows
183
153
 
184
- Manage agents within your account:
154
+ ### Creating a New Agent
185
155
 
186
156
  ```bash
187
- aui agents
188
- ```
189
-
190
- Interactive menu with options to:
157
+ # Interactive flow
158
+ aui agents --create
159
+ # → Select org → Select account → Enter name → Agent created
191
160
 
192
- - **List** all agents with current selection highlighted
193
- - **Switch** active agent
194
- - **Create** a new agent project (scaffolds local files)
195
- - **Import** from current account
196
- - **Import from another account** in the same organization
197
- - **Import from another organization** entirely
161
+ # Then either:
162
+ # Option A: Import, edit, push, version
163
+ aui import-agent
164
+ cd ./my-agent
165
+ # edit files
166
+ aui push
167
+ aui version publish
168
+ aui version activate
198
169
 
199
- Quick shortcuts:
170
+ # Option B: Version immediately
171
+ aui version create --source agent-scope
172
+ aui version publish
173
+ aui version activate
200
174
 
201
- ```bash
202
- aui agents --list
203
- aui agents --switch
204
- aui agents --create
205
- aui agents --import
175
+ # Shortcut: all at once
176
+ aui agents --create --full
206
177
  ```
207
178
 
208
- ## Importing an Agent
209
-
210
- Download an existing agent's full configuration to a local folder:
179
+ ### Editing an Existing Agent
211
180
 
212
181
  ```bash
182
+ # 1. Import (auto-selects active version)
213
183
  aui import-agent
214
- ```
215
184
 
216
- 1. Lists all agents in your current account
217
- 2. You select which agent to import
218
- 3. Creates a project folder named after the agent (e.g. `./my-agent/`)
219
- 4. Downloads configuration from 6 endpoints (general settings, parameters, entities, integrations, tools, rules)
220
- 5. Writes `.aui.json` files with the full agent configuration
221
- 6. Sets up schema autocomplete for your editor
222
- 7. Creates a `.auirc` file linking the project to the backend agent
185
+ # 2. Edit .aui.json files
186
+ cd ./my-agent
223
187
 
224
- You can also import a specific agent by ID:
188
+ # 3. Push (creates version draft automatically)
189
+ aui push
225
190
 
226
- ```bash
227
- aui import-agent 69119ed25f297aae09f62505
228
- aui import-agent --dir ./custom-folder
191
+ # 4. Publish and activate
192
+ aui version publish
193
+ aui version activate
229
194
  ```
230
195
 
231
- ### Cross-Account and Cross-Org Import
232
-
233
- To import agents from a different account or organization, use the `aui agents` menu and select:
234
-
235
- - **Import from another account** — browse accounts in your current org
236
- - **Import from another organization** — browse all your organizations, then accounts, then agents
237
-
238
- ## Creating a New Agent
239
-
240
- Scaffold a new project with example files and documentation:
196
+ ### Working with Versions
241
197
 
242
198
  ```bash
243
- aui create-agent my-agent
244
- ```
199
+ # List versions
200
+ aui version list
245
201
 
246
- This creates a complete project with:
202
+ # Create revision (v1.0 v1.1)
203
+ aui version create --source version --from <v1.0-id>
247
204
 
248
- - Example parameters, entities, integrations, tools, and rules
249
- - A `GUIDE.md` explaining every field and how to configure the agent
250
- - Schema autocomplete for VSCode and Cursor
251
- - All files ready to edit and push
205
+ # Create major version (v2.0)
206
+ aui version create --source agent-scope
252
207
 
253
- ```bash
254
- aui create-agent my-agent --force # Overwrite existing files
208
+ # Publish and go live
209
+ aui version publish <id>
210
+ aui version activate <id>
211
+
212
+ # Archive old versions
213
+ aui version archive <id>
255
214
  ```
256
215
 
257
216
  ## Agent Project Structure
258
217
 
259
- After `aui import-agent` or `aui create-agent`, your project folder looks like:
218
+ After `aui import-agent`, your project folder contains:
260
219
 
261
220
  ```
262
221
  my-agent/
263
- ├── agent.aui.json Agent name, objective, tone, guardrails
264
- ├── parameters.aui.json Data the agent collects and outputs
265
- ├── entities.aui.json Groups of related parameters
266
- ├── integrations.aui.json API, RAG, and MCP connections
267
- ├── rules.aui.json Global behavioral rules
268
- ├── tools/ One file per agent capability
222
+ ├── agent.aui.json Agent name, objective, tone, guardrails
223
+ ├── parameters.aui.json Data the agent collects and outputs
224
+ ├── entities.aui.json Groups of related parameters
225
+ ├── integrations.aui.json API, RAG, and MCP connections
226
+ ├── rules.aui.json Global behavioral rules
227
+ ├── widgets.aui.json Card templates for rich responses
228
+ ├── tools/ One file per agent capability
269
229
  │ ├── product_search.aui.json
270
230
  │ └── generative_ai.aui.json
271
- ├── GUIDE.md Step-by-step building guide
272
- ├── .auirc Project config (agent ID, environment)
273
- └── .vscode/settings.json Schema autocomplete config
274
- ```
275
-
276
- ### File Reference
277
-
278
- **`agent.aui.json`** — The agent's identity. Define its name, objective (what it does), guardrails (what it should not do), tone of voice, and brevity preference.
279
-
280
- **`parameters.aui.json`** — Data units the agent works with. Each parameter has a code (kebab-case), type (string, numeric, date, boolean, object), usage (input from user, output from API, or both), and a description that guides the LLM on how to extract it.
281
-
282
- **`entities.aui.json`** — Groups of related parameters. For example, a "Transaction" entity groups transaction-id, amount, status, and date together.
283
-
284
- **`integrations.aui.json`** — External connections. API integrations define an endpoint URL, HTTP method, authentication, request schema, and response mapping. RAG integrations connect to knowledge bases. MCP integrations connect to Model Context Protocol servers.
285
-
286
- **`tools/*.aui.json`** — Each tool is one capability the agent has. A tool defines when it activates (when_to_use), what parameters it needs, which integrations it calls, and rules for pre/post execution behavior.
287
-
288
- **`rules.aui.json`** — Global rules that apply across tools. Define conditions (when) and actions (then) to control agent behavior like blocking certain actions, requiring confirmation, or activating other tools.
289
-
290
- ## Adding Integrations
291
-
292
- Add API, RAG, or MCP integrations to your project:
293
-
294
- ```bash
295
- aui add-integration
296
- ```
297
-
298
- Select the integration type, provide a code name, and the command scaffolds the JSON config with the correct structure and placeholder values.
299
-
300
- - **API** — generates endpoint URL, method, authentication, request schema, and test curl
301
- - **RAG** — prompts for knowledge hub (new or existing) and scope (organization, account, or network)
302
- - **MCP** — generates a minimal config to fill in
303
-
304
- ## RAG Knowledge Bases
305
-
306
- Manage RAG knowledge bases — list, upload files/URLs, export, and update:
307
-
308
- ```bash
309
- aui rag # Interactive menu
310
- aui rag --add-file # Quick shortcut to upload files or URLs
311
- ```
312
-
313
- ### First-Time Setup
314
-
315
- The first time you run `aui rag`, you'll be prompted to paste your RAG API key. The key is saved securely to `~/.aui/kbm-key` (file permission 600) and reused automatically on future runs. You can also set it via the `AUI_KBM_API_KEY` environment variable.
316
-
317
- ### Interactive Menu
318
-
319
- Running `aui rag` opens an interactive menu:
320
-
321
- | Option | What it does |
322
- | ------------------------------------ | ------------------------------------------------------------------ |
323
- | **List knowledge bases** | Shows all KBs for the current agent with IDs and scope |
324
- | **Upload files to a knowledge base** | Upload local files (PDF, CSV, TXT, etc.) to a new or existing KB |
325
- | **Upload URLs to a knowledge base** | Scrape web pages into a new or existing KB |
326
- | **Export knowledge bases** | Download all KB data to `aui.rag.json` in the current directory |
327
- | **Update from file** | Push an edited `aui.rag.json` back to the server (diff-based sync) |
328
-
329
- ### Uploading Files
330
-
331
- ```bash
332
- aui rag
333
- # → Upload files to a knowledge base
334
- # → Select an existing KB or create a new one
335
- # → Drag/paste file path(s)
336
- ```
337
-
338
- Supported file types include PDF, CSV, TXT, and other text-based formats. Multiple files can be added in a single session.
339
-
340
- ### Uploading URLs
341
-
342
- ```bash
343
- aui rag
344
- # → Upload URLs to a knowledge base
345
- # → Select an existing KB or create a new one
346
- # → Paste URL(s) to scrape
347
- ```
348
-
349
- ### Export and Update Workflow
350
-
351
- The export/update flow lets you bulk-edit knowledge base content:
352
-
353
- ```bash
354
- # 1. Export all KB data to a local JSON file
355
- aui rag
356
- # → Export knowledge bases
357
- # → Saves aui.rag.json
358
-
359
- # 2. Edit the JSON file — add, modify, or remove vectors
360
-
361
- # 3. Push changes back
362
- aui rag
363
- # → Update from file
364
- # → Select aui.rag.json
365
- # → Server applies changes (creates new, updates changed, deletes removed)
231
+ ├── knowledge-hubs/ Knowledge base resources and files
232
+ ├── schemas/ Domain schemas for validation
233
+ ├── .auirc Project config (agent ID, version, environment)
234
+ ├── .vscode/settings.json Schema autocomplete config
235
+ ├── GUIDE.md Step-by-step building guide
236
+ ├── AGENTS.md Agent documentation
237
+ └── BEST_PRACTICES.md Configuration best practices
366
238
  ```
367
239
 
368
- ### Quick Upload Shortcut
240
+ ## Version Lifecycle
369
241
 
370
- ```bash
371
- aui rag --add-file
372
242
  ```
373
-
374
- Skips the menu and goes straight to uploading. Choose between files or URLs, select a knowledge base, and upload.
375
-
376
- ## Validating Changes
377
-
378
- Check your configuration files for errors before pushing:
379
-
380
- ```bash
381
- aui validate
243
+ draft → published → active
244
+ archived
382
245
  ```
383
246
 
384
- `aui validate` performs **CLI validation**:
385
-
386
- - JSON syntax
387
- - Required fields (codes, types, objectives)
388
- - Cross-references (e.g. tools referencing unknown integrations; entities referencing unknown parameters)
389
-
390
- ### Schema vs `aui validate` (important)
391
-
392
- When you import/create an agent, the CLI also writes:
393
-
394
- - **`.aui-schema/aui.dschema.json`** (JSON Schema file)
395
- - **`.vscode/settings.json`** (wires the schema for VSCode/Cursor)
247
+ - **Draft** editable, receives pushes via `agent_version_id`
248
+ - **Published** — locked permanently, ready to activate
249
+ - **Active** — the live production configuration (one per agent)
250
+ - **Archived** retired, can be viewed and cloned but not activated
396
251
 
397
- This provides **editor validation + autocomplete** (red squiggles, enum dropdowns, hover docs).
252
+ ## Backwards Compatibility
398
253
 
399
- That schema is **separate** from `aui validate`:
254
+ The CLI handles both new (versioned) and legacy agents:
400
255
 
401
- - **Schema**: editor-time, strict typing/shape checking for JSON files
402
- - **`aui validate`**: CLI-time checks + cross-reference integrity
256
+ - **New agents** with versions: import uses `version_id` to fetch version-specific data, push creates drafts with `agent_version_id`
257
+ - **Legacy agents** without versions: import falls back to network scope, push goes to live scope directly
258
+ - The transition is automatic — no user action needed
403
259
 
404
- If the backend introduces new fields (for example, the integrations schema expands in the V2 endpoints),
405
- your editor schema may need updating. Re-importing an agent refreshes `.aui-schema/`.
260
+ ## Environments
406
261
 
407
262
  ```bash
408
- aui validate --verbose # Detailed output per file
263
+ aui env # Show current environment
264
+ aui env staging # Switch to staging
265
+ aui env custom # Switch to custom (v3 endpoints)
266
+ aui env production # Switch to production
409
267
  ```
410
268
 
411
- ## Pushing Changes
412
-
413
- Upload your local changes to the backend:
414
-
415
- ```bash
416
- aui push
417
- ```
418
-
419
- ### Authentication behavior (Bearer-first, API-key fallback)
420
-
421
- For agent-settings endpoints (import/push), the CLI will:
422
-
423
- 1. **Use your Bearer token** from `aui login` (`Authorization: Bearer ...`)
424
- 2. If the server returns an **authorization error** (401/403, “not a member”, etc.), the CLI prompts for an **Agent Settings API key**
425
- 3. The key is saved locally and reused automatically
426
-
427
- Local key storage:
428
-
429
- - `~/.aui/agent-settings-key`
430
-
431
- You can also provide it via env var:
432
-
433
- - `AUI_AGENT_TOOLS_API_KEY`
434
-
435
- ### API Workflow key (required for `aui add-integration`)
436
-
437
- The API Workflow endpoint requires an API key (no Bearer token). If it’s missing, the CLI prompts and saves it:
438
-
439
- - `~/.aui/api-workflow-key`
440
-
441
- Env var override:
442
-
443
- - `AUI_API_WORKFLOW_KEY`
444
-
445
- ### Common push errors and what they mean
446
-
447
- - **“No agent linked to this project”**
448
- - You are not inside a project folder that contains a readable `.auirc`, or the `.auirc` JSON is invalid/empty.
449
- - Fix: run `aui import` again, or open `.auirc` and fix JSON.
450
-
451
- - **“Missing: account_id / organization_id / network_id …”**
452
- - The CLI can’t resolve scope IDs needed for agent-settings endpoints.
453
- - Fix: re-import (`aui import`) or re-login (`aui login`) so the session has the correct org/account selected.
454
-
455
- The push command detects changes via git diff and pushes only what changed:
456
-
457
- | Resource | Method | What gets sent |
458
- | -------------------- | ------ | ----------------------------------------------------------- |
459
- | **Tools (modified)** | PATCH | Only changed fields (name, when_to_use, goal, config, etc.) |
460
- | **Tools (new)** | POST | Full tool object |
461
- | **General Settings** | PATCH | Only changed fields |
462
- | **Parameters** | PUT | Full parameters data (upsert) |
463
- | **Entities** | PUT | Full entities data (upsert) |
464
- | **Rules** | PUT | Full rules data (upsert) |
465
-
466
- All changes are pushed **in parallel** for speed. After a successful push, the git baseline is updated so the next push only sends new changes.
467
-
468
- ```bash
469
- aui push --dry-run # Preview only — shows changes without pushing
470
- aui push --force # Push even with validation warnings
471
- aui push --skip-validation
472
- ```
473
-
474
- ## Comparing Configurations
475
-
476
- See what changed since you imported:
477
-
478
- ```bash
479
- aui diff
480
- ```
481
-
482
- Or compare two agent folders side by side:
483
-
484
- ```bash
485
- aui diff ./agent-v1 ./agent-v2
486
- ```
487
-
488
- Shows added, removed, and modified parameters, entities, tools, integrations, and rules.
489
-
490
- ## Schema Autocomplete
491
-
492
- Every project includes a JSON schema that enables in your editor:
493
-
494
- - Field name suggestions as you type
495
- - Enum dropdowns for types, actions, methods, and operators
496
- - Descriptions on hover
497
- - Inline validation highlighting
269
+ ## Configuration Files
498
270
 
499
- Works in VSCode and Cursor out of the box.
271
+ | File | Purpose |
272
+ |------|---------|
273
+ | `~/.aui/session.json` | Auth token, org, account, agent, environment |
274
+ | `~/.aui/environment` | Selected environment |
275
+ | `~/.aui/kbm-key` | RAG API key |
276
+ | `~/.aui/agent-settings-key` | Agent Settings API key (fallback auth) |
277
+ | `~/.aui/api-workflow-key` | API Workflow key |
278
+ | `.auirc` | Project config — agent ID, version, environment |
500
279
 
501
- ## Agent Chat
280
+ ## Environment Variables
502
281
 
503
- Talk to any agent directly from the terminal:
504
-
505
- ```bash
506
- aui chat
507
- ```
508
-
509
- - **Real-time streaming** responses appear as the agent types
510
- - **Auto-connect** select an agent from your account; API key is fetched automatically
511
- - **Product cards** results show name, price, rating, reviews, and links
512
- - **Suggestions** AI-generated follow-up questions
513
-
514
- ### Chat Options
515
-
516
- ```bash
517
- aui chat # Interactive
518
- aui chat --api-key API_KEY_xxx # Skip API key prompt
519
- aui chat --env azure # Azure environment (default: GCP)
520
- aui chat --rest # REST only, no streaming
521
- ```
522
-
523
- ### Chat Commands
524
-
525
- | Command | Action |
526
- | ---------- | ------------------------- |
527
- | `/exit` | End conversation |
528
- | `/clear` | Clear screen |
529
- | `/history` | View message history |
530
- | `/suggest` | Get follow-up suggestions |
531
- | `/task` | Show task ID |
532
- | `/help` | Show commands |
533
-
534
- ## Configuration
535
-
536
- ### Session
537
-
538
- `~/.aui/session.json` — created by `aui login`. Stores auth token, organization, account, agent, and environment.
539
-
540
- ### Project Config
541
-
542
- `.auirc` — created by `aui import-agent` or `aui create-agent`. Links the project to a backend agent. Also stores the network API key for `aui chat`.
543
-
544
- ### RAG API Key
545
-
546
- `~/.aui/kbm-key` — created automatically the first time you run `aui rag` and paste the API key. The key is stored with file permission 600 (readable only by you). You can also set it via the `AUI_KBM_API_KEY` environment variable, which takes priority over the saved file.
547
-
548
- ### Stored Files
549
-
550
- | File | Purpose |
551
- | --------------------------- | ------------------------------------------------------------------ |
552
- | `~/.aui/session.json` | Auth token, org, account, agent, environment (synced with env file) |
553
- | `~/.aui/environment` | Selected environment (synced with session on login/env switch) |
554
- | `~/.aui/kbm-key` | RAG API key (auto-saved on first use) |
555
- | `~/.aui/agent-settings-key` | Agent Settings API key (fallback if Bearer token lacks permission) |
556
- | `~/.aui/api-workflow-key` | API Workflow key (required for `aui add-integration`) |
557
- | `.auirc` | Project config — links folder to a backend agent |
558
- | `aui.rag.json` | Exported RAG knowledge base data |
559
-
560
- ### Environment Variables
561
-
562
- | Variable | Description |
563
- | ------------------------- | ----------------------------------------------------- |
564
- | `AUI_AUTH_TOKEN` | Auth token (skip login) |
565
- | `AUI_API_URL` | Override API base URL |
566
- | `AUI_ENVIRONMENT` | `staging`, `custom`, or `production` |
567
- | `AUI_ACCOUNT_ID` | Account ID |
568
- | `AUI_ORGANIZATION_ID` | Organization ID |
569
- | `AUI_AGENT_CODE` | Agent code |
570
- | `AUI_KBM_API_KEY` | RAG API key (overrides saved key in `~/.aui/kbm-key`) |
571
- | `AUI_AGENT_TOOLS_API_KEY` | Agent Settings API key (fallback auth) |
572
- | `AUI_API_WORKFLOW_KEY` | API Workflow key |
282
+ | Variable | Description |
283
+ |----------|-------------|
284
+ | `AUI_AUTH_TOKEN` | Auth token (skip login) |
285
+ | `AUI_API_URL` | Override API base URL |
286
+ | `AUI_ENVIRONMENT` | `staging`, `custom`, or `production` |
287
+ | `AUI_ACCOUNT_ID` | Account ID |
288
+ | `AUI_ORGANIZATION_ID` | Organization ID |
289
+ | `AUI_KBM_API_KEY` | RAG API key |
290
+ | `AUI_AGENT_TOOLS_API_KEY` | Agent Settings API key |
291
+ | `AUI_API_WORKFLOW_KEY` | API Workflow key |
292
+ | `AUI_DEBUG` | Enable debug logging (`AUI_DEBUG=1`) |
573
293
 
574
294
  ## Local Development
575
295
 
576
- To run the CLI from your local source code instead of the published npm package:
577
-
578
296
  ```bash
579
297
  cd aui-agent-builder
580
298
  npm install
@@ -582,68 +300,15 @@ npm run build
582
300
  npm link
583
301
  ```
584
302
 
585
- This creates a global `aui` symlink pointing to your local build. Any changes you make are reflected after running `npm run build` again.
586
-
587
- To verify you're running the local version:
588
-
589
- ```bash
590
- which aui
591
- # Should show a path inside your project, not a global npm path
592
- ```
593
-
594
- To switch back to the published version:
595
-
596
- ```bash
597
- npm uninstall -g aui-agent-builder
598
- npm install -g aui-agent-builder
599
- ```
600
-
601
303
  ## Updating
602
304
 
603
- ### Update Notifications
604
-
605
- The CLI automatically checks for new versions once every 24 hours. When an update is available, a banner appears after command output:
606
-
607
- ```
608
- ╭──────────────────────────────────────────────╮
609
- │ Update available: 0.1.86 → 0.1.87 │
610
- │ Run: npm install -g aui-agent-builder │
611
- ╰──────────────────────────────────────────────╯
612
- ```
613
-
614
- The check is non-blocking and never affects CLI performance. For Homebrew users, the banner shows `brew upgrade aui` instead.
615
-
616
- ### Upgrade Command
617
-
618
- Upgrade directly from the CLI:
619
-
620
305
  ```bash
621
- aui upgrade
622
- ```
623
-
624
- This automatically detects whether you installed via npm or Homebrew and runs the appropriate upgrade command.
625
-
626
- ### Manual Upgrade
627
-
628
- ```bash
629
- # npm
630
- npm install -g aui-agent-builder
631
-
632
- # Homebrew
633
- brew upgrade aui
634
- ```
635
-
636
- ### Disable Update Notifications
637
-
638
- ```bash
639
- # Environment variable
640
- AUI_NO_UPDATE_CHECK=1 aui status
641
-
642
- # Or use ecosystem-standard flag
643
- NO_UPDATE_NOTIFIER=1 aui status
306
+ aui upgrade # Auto-detect npm or Homebrew
307
+ npm install -g aui-agent-builder # Manual npm
308
+ brew upgrade aui # Manual Homebrew
644
309
  ```
645
310
 
646
- Update notifications are also automatically suppressed in CI environments (`CI=true`) and when using `--quiet`, `--json`, or `--silent` flags.
311
+ The CLI checks for updates every 24 hours and shows a banner when one is available.
647
312
 
648
313
  ## License
649
314