systemprompt-cli 0.1.22

systemprompt.io OS - CLI for agent orchestration, AI operations, and system management
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
<div align="center">
  <a href="https://systemprompt.io">
    <img src="https://systemprompt.io/logo.svg" alt="systemprompt.io" width="150" />
  </a>
  <p><strong>Production infrastructure for AI agents</strong></p>
  <p><a href="https://systemprompt.io">systemprompt.io</a><a href="https://github.com/systempromptio/systemprompt">GitHub</a><a href="https://systemprompt.io/documentation">Documentation</a></p>
</div>

---


# Config CLI Commands

This document provides complete documentation for AI agents to use the config CLI commands. All commands support non-interactive mode for automation.

---

## Prerequisites

```bash
export SYSTEMPROMPT_PROFILE=/var/www/html/tyingshoelaces/.systemprompt/profiles/local/profile.yaml
cd /var/www/html/systemprompt-core
cargo build --package systemprompt-cli

alias sp="./target/debug/systemprompt --non-interactive"
```

---

## Command Reference

| Command | Description | Artifact Type | Requires Services |
|---------|-------------|---------------|-------------------|
| `admin config rate-limits show` | Show rate limit configuration | `Card` | No |
| `admin config rate-limits tier <TIER>` | Show effective limits for a tier | `Card` | No |
| `admin config rate-limits docs` | Show rate limits documentation | `Table` | No |
| `admin config rate-limits set` | Set a rate limit value | `Text` | No |
| `admin config rate-limits enable` | Enable rate limiting | `Text` | No |
| `admin config rate-limits disable` | Disable rate limiting | `Text` | No |
| `admin config rate-limits validate` | Validate configuration | `Card` | No |
| `admin config rate-limits compare` | Compare limits across tiers | `Table` | No |
| `admin config rate-limits reset` | Reset to default values | `Table` | No |

---

## Rate Limits Commands

### config rate-limits show

Show current rate limit configuration from the profile.

```bash
sp admin config rate-limits show
sp --json config rate-limits show
```

**Output Structure:**
```json
{
  "disabled": true,
  "oauth_public_per_second": 2,
  "oauth_auth_per_second": 2,
  "contexts_per_second": 50,
  "tasks_per_second": 10,
  "artifacts_per_second": 15,
  "agent_registry_per_second": 20,
  "agents_per_second": 3,
  "mcp_registry_per_second": 20,
  "mcp_per_second": 100,
  "stream_per_second": 1,
  "content_per_second": 20,
  "burst_multiplier": 2,
  "tier_multipliers": {
    "admin": 10.0,
    "user": 1.0,
    "a2a": 5.0,
    "mcp": 5.0,
    "service": 5.0,
    "anon": 0.5
  }
}
```

**Artifact Type:** `Card`

---

### config rate-limits tier

Show effective limits for a specific tier (base rates multiplied by tier multiplier).

```bash
sp admin config rate-limits tier admin
sp admin config rate-limits tier user
sp admin config rate-limits tier anon
sp --json config rate-limits tier a2a
```

**Arguments:**
| Argument | Required | Description |
|----------|----------|-------------|
| `<TIER>` | Yes | Tier name: `admin`, `user`, `a2a`, `mcp`, `service`, `anon` |

**Output Structure:**
```json
{
  "tier": "admin",
  "multiplier": 10.0,
  "effective_limits": {
    "oauth_public_per_second": 20,
    "oauth_auth_per_second": 20,
    "contexts_per_second": 500,
    "tasks_per_second": 100,
    "artifacts_per_second": 150,
    "agent_registry_per_second": 200,
    "agents_per_second": 30,
    "mcp_registry_per_second": 200,
    "mcp_per_second": 1000,
    "stream_per_second": 10,
    "content_per_second": 200
  }
}
```

**Artifact Type:** `Card`

---

### config rate-limits docs

Show comprehensive rate limits documentation including base rates, tier multipliers, and effective limits comparison.

```bash
sp admin config rate-limits docs
sp --json config rate-limits docs
```

**Output Structure:**
```json
{
  "base_rates": [
    {"endpoint": "OAuth Public", "rate_per_second": 2},
    {"endpoint": "Contexts", "rate_per_second": 50}
  ],
  "tier_multipliers": [
    {"tier": "Admin", "multiplier": 10.0},
    {"tier": "User", "multiplier": 1.0}
  ],
  "effective_limits": [
    {"endpoint": "Contexts", "admin": 500, "user": 50, "anon": 25}
  ],
  "burst_multiplier": 2,
  "disabled": true
}
```

**Artifact Type:** `Table`

---

### config rate-limits set

Set a rate limit value. Modifies the profile YAML file.

```bash
# Set endpoint rate
sp admin config rate-limits set --endpoint contexts --rate 100
sp admin config rate-limits set --endpoint tasks --rate 20

# Set tier multiplier
sp admin config rate-limits set --tier admin --multiplier 15.0
sp admin config rate-limits set --tier anon --multiplier 0.25

# Set burst multiplier
sp admin config rate-limits set --burst 3
```

**Flags:**
| Flag | Description |
|------|-------------|
| `--endpoint <NAME>` | Endpoint: `oauth_public`, `oauth_auth`, `contexts`, `tasks`, `artifacts`, `agent_registry`, `agents`, `mcp_registry`, `mcp`, `stream`, `content` |
| `--rate <VALUE>` | Rate per second (requires `--endpoint`) |
| `--tier <NAME>` | Tier: `admin`, `user`, `a2a`, `mcp`, `service`, `anon` |
| `--multiplier <VALUE>` | Multiplier value (requires `--tier`) |
| `--burst <VALUE>` | Burst multiplier value |

**Output Structure:**
```json
{
  "field": "contexts_per_second",
  "old_value": "50",
  "new_value": "100",
  "message": "Updated contexts rate: 50 -> 100/s"
}
```

**Artifact Type:** `Text`

---

### config rate-limits enable

Enable rate limiting.

```bash
sp admin config rate-limits enable
sp --json config rate-limits enable
```

**Output Structure:**
```json
{
  "enabled": true,
  "message": "Rate limiting enabled"
}
```

**Artifact Type:** `Text`

---

### config rate-limits disable

Disable rate limiting.

```bash
sp admin config rate-limits disable
sp --json config rate-limits disable
```

**Output Structure:**
```json
{
  "enabled": false,
  "message": "Rate limiting disabled"
}
```

**Artifact Type:** `Text`

---

### config rate-limits validate

Validate rate limit configuration for errors and warnings.

```bash
sp admin config rate-limits validate
sp --json config rate-limits validate
```

**Validation Checks:**
- No zero or negative rates
- Positive tier multipliers
- Tier hierarchy: `anon < user < admin`
- Burst multiplier is reasonable (1-10x)

**Output Structure:**
```json
{
  "valid": true,
  "errors": [],
  "warnings": [
    "Rate limiting is currently DISABLED"
  ]
}
```

**Artifact Type:** `Card`

---

### config rate-limits compare

Compare effective limits across all tiers side-by-side.

```bash
sp admin config rate-limits compare
sp --json config rate-limits compare
```

**Output Structure:**
```json
{
  "endpoints": [
    {
      "endpoint": "Contexts",
      "admin": 500,
      "user": 50,
      "a2a": 250,
      "mcp": 250,
      "service": 250,
      "anon": 25
    }
  ]
}
```

**Artifact Type:** `Table`

---

### config rate-limits reset

Reset rate limits to default values.

```bash
# Preview changes (dry run)
sp admin config rate-limits reset --dry-run

# Reset all to defaults
sp admin config rate-limits reset --yes

# Reset specific endpoint
sp admin config rate-limits reset --endpoint contexts --yes

# Reset specific tier multiplier
sp admin config rate-limits reset --tier admin --yes
```

**Flags:**
| Flag | Description |
|------|-------------|
| `-y`, `--yes` | Skip confirmation (required in non-interactive mode) |
| `--dry-run` | Preview changes without applying |
| `--endpoint <NAME>` | Reset only this endpoint |
| `--tier <NAME>` | Reset only this tier multiplier |

**Output Structure:**
```json
{
  "reset_type": "all",
  "changes": [
    {
      "field": "contexts_per_second",
      "old_value": "100",
      "new_value": "50"
    }
  ],
  "message": "Reset 1 value(s) to defaults"
}
```

**Artifact Type:** `Table`

---

## Tier Reference

| Tier | Description | Default Multiplier |
|------|-------------|-------------------|
| `admin` | Administrative users | 10.0x |
| `user` | Authenticated users | 1.0x (baseline) |
| `a2a` | Agent-to-agent communication | 5.0x |
| `mcp` | MCP protocol requests | 5.0x |
| `service` | Internal service calls | 5.0x |
| `anon` | Anonymous/unauthenticated | 0.5x |

---

## Endpoint Reference

| Endpoint | Description | Default Rate |
|----------|-------------|--------------|
| `oauth_public` | Public OAuth endpoints | 2/s |
| `oauth_auth` | Authenticated OAuth endpoints | 2/s |
| `contexts` | Context operations | 50/s |
| `tasks` | Task operations | 10/s |
| `artifacts` | Artifact operations | 15/s |
| `agent_registry` | Agent registry operations | 20/s |
| `agents` | Agent operations | 3/s |
| `mcp_registry` | MCP registry operations | 20/s |
| `mcp` | MCP operations | 100/s |
| `stream` | SSE streaming | 10/s |
| `content` | Content operations | 20/s |

---

## Error Handling

### Invalid Tier
```bash
sp admin config rate-limits tier invalid
# Error: Unknown tier: invalid. Valid tiers: admin, user, a2a, mcp, service, anon
```

### Invalid Endpoint
```bash
sp admin config rate-limits set --endpoint invalid --rate 100
# Error: Unknown endpoint: invalid. Valid endpoints: oauth_public, oauth_auth, contexts, tasks, artifacts, agent_registry, agents, mcp_registry, mcp, stream, content
```

### Missing Required Flags
```bash
sp admin config rate-limits set --endpoint contexts
# Error: --rate is required when --endpoint is specified

sp admin config rate-limits reset
# Error: --yes or --dry-run is required in non-interactive mode
```

---

## JSON Output

All commands support `--json` flag for structured output:

```bash
# Get full rate limits as JSON
sp --json config rate-limits show | jq .

# Get specific tier effective limits
sp --json config rate-limits tier admin | jq '.effective_limits.contexts_per_second'

# Check if rate limiting is disabled
sp --json config rate-limits show | jq '.disabled'

# Compare all tiers
sp --json config rate-limits compare | jq '.endpoints[] | select(.endpoint == "Contexts")'

# Validate and check for errors
sp --json config rate-limits validate | jq '.errors'
```

---

## Complete Configuration Workflow

```bash
# Phase 1: View current configuration
sp --json config rate-limits show

# Phase 2: Validate configuration
sp --json config rate-limits validate

# Phase 3: Compare across tiers
sp --json config rate-limits compare

# Phase 4: Make changes
sp admin config rate-limits set --endpoint contexts --rate 100
sp admin config rate-limits set --tier admin --multiplier 15.0
sp admin config rate-limits enable

# Phase 5: Verify changes
sp --json config rate-limits show

# Phase 6: Reset if needed
sp admin config rate-limits reset --dry-run
sp admin config rate-limits reset --yes
```

---

## Compliance Checklist

- [x] All `execute` functions accept `config: &CliConfig`
- [x] All commands return `CommandResult<T>` with proper artifact type
- [x] All output types derive `Serialize`, `Deserialize`, `JsonSchema`
- [x] No `println!` / `eprintln!` - uses `CliService`
- [x] No `unwrap()` / `expect()` - uses `?` with `.context()`
- [x] JSON output supported via `--json` flag
- [x] Destructive operations (`reset`) require `--yes` in non-interactive mode
- [x] `--dry-run` supported for preview