systemprompt-cli 0.21.1

Unified CLI for systemprompt.io AI governance: agent orchestration, MCP governance, analytics, profiles, cloud deploy, and self-hosted operations.
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
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
<div align="center">

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://systemprompt.io/files/images/logo.svg">
  <source media="(prefers-color-scheme: light)" srcset="https://systemprompt.io/files/images/logo-dark.svg">
  <img src="https://systemprompt.io/files/images/logo.svg" alt="systemprompt.io" width="180">
</picture>

### Production infrastructure for AI agents

[**Website**](https://systemprompt.io) · [**Documentation**](https://systemprompt.io/documentation/) · [**Guides**](https://systemprompt.io/guides) · [**Core**](https://github.com/systempromptio/systemprompt-core) · [**CLI Reference**](https://github.com/systempromptio/systemprompt-core/tree/main/crates/entry/cli) · [**Discord**](https://discord.gg/wkAbSuPWpr)

</div>

---


# Config CLI Commands

`admin config` reads and edits the active profile YAML, the single source of truth for how the instance runs. Every group below writes back to that profile. All commands support non-interactive mode for automation.

---

## Prerequisites

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

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

---

## Command Groups

`admin config` has thirteen groups. `show`, `list`, and `validate` are top-level; the rest are subcommand groups.

| Group | Purpose |
|-------|---------|
| `show` | Configuration overview for the active profile |
| `list` | List all configuration files |
| `validate` | Validate configuration files (exits non-zero on failure) |
| `server` | Host, port, HTTPS, and CORS origins |
| `runtime` | Environment, log level, output format |
| `security` | JWT issuer, token expiry, trusted issuers |
| `paths` | Show and validate configured filesystem paths |
| `provider` | Enable/disable AI providers and set the default (policy) |
| `gateway` | Gateway enable/disable, routes, default provider |
| `governance` | Authorization hook (webhook/extension/disabled/unrestricted) |
| `catalog` | Provider registry under `profile.providers` (providers, models) |
| `secret` | Set a provider or custom secret in the secrets store |
| `rate-limits` | Per-endpoint rates, tier multipliers, presets, import/export |

---

## show / list / validate

```bash
sp admin config show              # overview of the active profile
sp admin config list              # configuration files on disk
sp admin config validate          # validate; exits non-zero if invalid
```

`show` returns a `Card`, `list` and `validate` return a `Table`. `validate` bails with a non-zero exit code when the profile is invalid.

---

## server

Host, port, HTTPS, and CORS origins.

```bash
sp admin config server show
sp admin config server set --host 127.0.0.1 --port 8080 --use-https false
sp admin config server cors list
sp admin config server cors add https://app.example.com
sp admin config server cors remove https://app.example.com
```

| Subcommand | Purpose |
|------------|---------|
| `show` | Show server configuration |
| `set` | Set `--host`, `--port`, `--use-https` |
| `cors list` / `cors add <ORIGIN>` / `cors remove <ORIGIN>` | Manage allowed CORS origins |

---

## runtime

Environment, log level, and output format.

```bash
sp admin config runtime show
sp admin config runtime set --environment production --log-level normal --output-format json
```

| Subcommand | Purpose |
|------------|---------|
| `show` (alias `list`) | Show runtime configuration |
| `set` | Set `--environment`, `--log-level`, `--output-format` |

---

## security

JWT issuer, token expiry, and trusted issuers for token exchange.

```bash
sp admin config security show
sp admin config security set --jwt-issuer https://auth.example.com --access-expiry 3600 --refresh-expiry 2592000
sp admin config security trusted-issuer add \
  --issuer https://idp.example.com \
  --jwks-uri https://idp.example.com/.well-known/jwks.json \
  --audience systemprompt
sp admin config security trusted-issuer remove --issuer https://idp.example.com
```

| Subcommand | Purpose |
|------------|---------|
| `show` (alias `list`) | Show security configuration |
| `set` | Set `--jwt-issuer`, `--access-expiry`, `--refresh-expiry` |
| `trusted-issuer add` / `remove` | Manage RFC 8693 token-exchange issuers |

---

## paths

Show and validate the configured filesystem paths.

```bash
sp admin config paths show
sp admin config paths validate
```

| Subcommand | Purpose |
|------------|---------|
| `show` (alias `list`) | Show configured paths |
| `validate` | Verify every configured path exists |

---

## provider

Enable, disable, and set the default AI provider. This is the policy layer over the catalog: it decides which declared providers are usable and which is the default.

```bash
sp admin config provider list
sp admin config provider enable anthropic
sp admin config provider disable openai
sp admin config provider set anthropic
```

| Subcommand | Purpose |
|------------|---------|
| `list` | List AI providers |
| `set <PROVIDER>` | Set the default provider |
| `enable <PROVIDER>` / `disable <PROVIDER>` | Toggle a provider |

---

## gateway

Gateway enable/disable, model routes, and default provider.

```bash
sp admin config gateway enable
sp admin config gateway disable
sp admin config gateway route list
sp admin config gateway route add --model-pattern "claude-*" --provider anthropic
sp admin config gateway route remove --model-pattern "claude-*"
sp admin config gateway default-provider set anthropic
sp admin config gateway default-provider clear
```

| Subcommand | Purpose |
|------------|---------|
| `enable` / `disable` | Toggle the gateway |
| `route list` / `route add` / `route remove` | Manage routes (upsert by `--model-pattern`, targeting `--provider`) |
| `default-provider set` / `clear` | Set or clear the gateway default provider |

---

## governance

The authorization hook that every request is evaluated against.

```bash
sp admin config governance show
sp admin config governance set --mode webhook --url https://authz.example.com/evaluate
sp admin config governance set --mode extension
sp admin config governance set --mode disabled
```

| Subcommand | Purpose |
|------------|---------|
| `show` | Show governance configuration |
| `set` | Set `--mode` (`webhook`, `extension`, `disabled`, `unrestricted`); `--url` required for `webhook` |

`unrestricted` requires an explicit acknowledgement; it disables authorization entirely.

---

## catalog

The provider registry under `profile.providers`: which providers exist and which models they serve. Providers must be declared here before `provider` or `gateway` can reference them.

```bash
sp admin config catalog provider list
sp admin config catalog provider add --name anthropic --wire anthropic
sp admin config catalog provider remove anthropic
sp admin config catalog model add --provider anthropic --id claude-sonnet-4-6-20250610 --alias sonnet
sp admin config catalog model remove --provider anthropic --id claude-sonnet-4-6-20250610
```

| Subcommand | Purpose |
|------------|---------|
| `provider list` / `provider add` / `provider remove` | Manage declared providers (`--wire`: `anthropic`, `openai-chat`, `openai-responses`, `gemini`) |
| `model add` / `model remove` | Manage models under a provider (repeatable `--alias`) |

---

## secret

Set a provider or custom secret in the profile's secrets store.

```bash
sp admin config secret set anthropic "sk-ant-..."
sp admin config secret set minimax "..."
```

| Subcommand | Purpose |
|------------|---------|
| `set <NAME> <VALUE>` | Write a secret to the profile's secrets file |

---

## Rate Limits Commands

The `rate-limits` group is the richest. Alongside `show`, `tier`, `docs`, `set`, `enable`, `disable`, `validate`, `compare`, and `reset`, it also has `preset`, `export`, `import`, and `diff`:

```bash
sp admin config rate-limits preset list
sp admin config rate-limits preset show <name>
sp admin config rate-limits preset apply <name>
sp admin config rate-limits export limits.json
sp admin config rate-limits import limits.json
sp admin config rate-limits diff --file limits.json
```

### config rate-limits show

Show current rate limit configuration from the profile.

```bash
sp admin config rate-limits show
sp --json admin 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 admin 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 admin 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 admin 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 admin 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 admin 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 admin 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

Default base rates (before the tier multiplier is applied). These are the built-in defaults from `RateLimitsConfig::default()`; a profile may override any of them, so `rate-limits show` reflects the loaded profile rather than these values. Effective admin limits are the base rate times the admin multiplier (10x), so `stream` defaults to 100/s base and 1000/s for admin.

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

Default burst multiplier is 3. Default tier multipliers: admin 10, user 1, a2a 5, mcp 5, service 5, anon 0.5.

---

## 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 admin config rate-limits show | jq .

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

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

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

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

---

## Complete Configuration Workflow

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

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

# Phase 3: Compare across tiers
sp --json admin 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 admin 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


---

<div align="center">

**[systemprompt.io](https://systemprompt.io)** · **[Documentation](https://systemprompt.io/documentation/)** · **[Guides](https://systemprompt.io/guides)** · **[Live Demo](https://systemprompt.io/features/demo)** · **[Template](https://github.com/systempromptio/systemprompt-template)** · **[Discord](https://discord.gg/wkAbSuPWpr)**

<sub>CLI reference · Own how your organization uses AI.</sub>

</div>