systemprompt-cli 0.2.2

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
<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>

---


# Skills CLI Commands

This document provides complete documentation for AI agents to use the skills 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 |
|---------|-------------|---------------|-------------------|
| `core skills list` | List configured skills | `Table` | No |
| `core skills create` | Create new skill | `Text` | No |
| `core skills edit <name>` | Edit skill configuration | `Text` | No |
| `core skills delete <name>` | Delete a skill | `Text` | No |
| `core skills status` | Show database sync status | `Table` | No (DB only) |
| `core skills sync` | Sync skills between disk and database | `Text` | No (DB only) |

---

## Core Commands

### skills list

List all configured skills from disk and database.

```bash
sp core skills list
sp --json skills list
sp core skills list --source disk
sp core skills list --source database
sp core skills list --agent primary
```

**Flags:**
| Flag | Default | Description |
|------|---------|-------------|
| `--source` | `all` | Source: `all`, `disk`, `database` |
| `--agent` | None | Filter by agent name |

**Output Structure:**
```json
{
  "skills": [
    {
      "name": "code_review",
      "display_name": "Code Review",
      "description": "Reviews code for quality and best practices",
      "agent": "primary",
      "enabled": true,
      "source": "disk",
      "synced": true
    }
  ],
  "total": 1
}
```

**Artifact Type:** `Table`
**Columns:** `name`, `display_name`, `agent`, `enabled`, `synced`

---

### skills create

Create a new skill configuration.

```bash
sp core skills create \
  --name "my_skill" \
  --display-name "My Skill" \
  --description "A custom skill" \
  --agent primary \
  --prompt "You are a helpful assistant that..."

sp core skills create \
  --name "code_helper" \
  --display-name "Code Helper" \
  --description "Helps with coding tasks" \
  --agent primary \
  --prompt-file ./prompts/code_helper.txt \
  --enabled
```

**Required Flags (non-interactive):**
| Flag | Required | Description |
|------|----------|-------------|
| `--name` | Yes | Skill identifier (lowercase alphanumeric + underscores) |
| `--agent` | Yes | Agent to associate skill with |
| `--prompt` or `--prompt-file` | Yes | Skill prompt (inline or file path) |

**Optional Flags:**
| Flag | Default | Description |
|------|---------|-------------|
| `--display-name` | Same as name | Human-readable name |
| `--description` | Empty | Skill description |
| `--enabled` | `false` | Enable skill after creation |

**Validation Rules:**
- Name: 3-50 characters, lowercase alphanumeric with underscores only
- Agent must exist in configuration

**Output Structure:**
```json
{
  "name": "my_skill",
  "path": "/var/www/html/tyingshoelaces/services/skills/my_skill.yaml",
  "message": "Skill 'my_skill' created successfully"
}
```

**Artifact Type:** `Text`

---

### skills edit

Edit an existing skill configuration.

```bash
sp core skills edit <skill_name> --enable
sp core skills edit <skill_name> --disable
sp core skills edit <skill_name> --description "Updated description"
sp core skills edit <skill_name> --prompt "New prompt text..."
sp core skills edit <skill_name> --prompt-file ./prompts/updated.txt
sp core skills edit <skill_name> --set display_name="New Display Name"
```

**Required Arguments:**
| Argument | Required | Description |
|----------|----------|-------------|
| `<name>` | Yes | Skill name to edit |
| At least one change | Yes | Must specify at least one modification |

**Modification Flags:**
| Flag | Description |
|------|-------------|
| `--enable` | Enable the skill |
| `--disable` | Disable the skill |
| `--description` | Update description |
| `--prompt` | Update prompt text inline |
| `--prompt-file` | Update prompt from file |
| `--set <key=value>` | Set arbitrary config value |

**Supported --set Keys:**
- `display_name`
- `description`
- `enabled` (boolean)
- `agent`

**Output Structure:**
```json
{
  "name": "my_skill",
  "message": "Skill 'my_skill' updated successfully with 2 change(s)",
  "changes": ["enabled: true", "description: Updated description"]
}
```

**Artifact Type:** `Text`

---

### skills delete

Delete a skill configuration.

```bash
sp core skills delete <skill_name> --yes
sp core skills delete my_skill --yes
```

**Required Flags (non-interactive):**
| Flag | Required | Description |
|------|----------|-------------|
| `<name>` | Yes | Skill name to delete |
| `--yes` / `-y` | Yes | Skip confirmation (REQUIRED in non-interactive mode) |

**Output Structure:**
```json
{
  "deleted": "my_skill",
  "message": "Skill 'my_skill' deleted successfully"
}
```

**Artifact Type:** `Text`

---

### skills status

Show database sync status for skills.

```bash
sp core skills status
sp --json skills status
sp core skills status --agent primary
```

**Flags:**
| Flag | Default | Description |
|------|---------|-------------|
| `--agent` | None | Filter by agent name |

**Output Structure:**
```json
{
  "skills": [
    {
      "name": "code_review",
      "disk_exists": true,
      "db_exists": true,
      "synced": true,
      "disk_updated": "2024-01-15T10:30:00Z",
      "db_updated": "2024-01-15T10:30:00Z"
    },
    {
      "name": "old_skill",
      "disk_exists": false,
      "db_exists": true,
      "synced": false,
      "disk_updated": null,
      "db_updated": "2024-01-01T00:00:00Z"
    }
  ],
  "summary": {
    "total_disk": 5,
    "total_db": 6,
    "synced": 5,
    "unsynced": 1
  }
}
```

**Artifact Type:** `Table`
**Columns:** `name`, `disk_exists`, `db_exists`, `synced`

---

### skills sync

Sync skills between disk and database.

```bash
sp core skills sync
sp core skills sync --direction to-db
sp core skills sync --direction from-db
sp core skills sync --agent primary
sp core skills sync --dry-run
```

**Flags:**
| Flag | Default | Description |
|------|---------|-------------|
| `--direction` | `to-db` | Sync direction: `to-db`, `from-db` |
| `--agent` | None | Filter by agent name |
| `--dry-run` | `false` | Show what would be synced without making changes |

**Sync Directions:**
- `to-db`: Push disk configurations to database
- `from-db`: Pull database configurations to disk

**Output Structure:**
```json
{
  "direction": "to-db",
  "created": ["new_skill"],
  "updated": ["existing_skill"],
  "deleted": [],
  "skipped": [],
  "dry_run": false,
  "message": "Synced 2 skill(s) to database"
}
```

**Artifact Type:** `Text`

---

## Complete Skills Management Flow Example

This flow demonstrates the full skills lifecycle:

```bash
# Phase 1: List existing skills
sp --json skills list
sp --json skills status

# Phase 2: Create new skill
sp core skills create \
  --name "documentation_helper" \
  --display-name "Documentation Helper" \
  --description "Helps write and improve documentation" \
  --agent primary \
  --prompt "You are a technical writer assistant. Help users create clear, comprehensive documentation."

# Phase 3: Verify creation
sp --json skills list --source disk
sp --json skills status

# Phase 4: Sync to database
sp core skills sync --direction to-db

# Phase 5: Enable skill
sp core skills edit documentation_helper --enable

# Phase 6: Update skill
sp core skills edit documentation_helper \
  --description "Professional documentation assistance" \
  --prompt "You are an expert technical writer..."

# Phase 7: Re-sync after update
sp core skills sync --direction to-db

# Phase 8: Delete skill
sp core skills delete documentation_helper --yes

# Phase 9: Sync deletion
sp core skills sync --direction to-db

# Phase 10: Verify deletion
sp --json skills list
```

---

## Skill Configuration File Format

Skills are stored as YAML files:

```yaml
# /services/skills/my_skill.yaml
name: my_skill
display_name: My Skill
description: A helpful skill
agent: primary
enabled: true
prompt: |
  You are a helpful assistant that specializes in...

  When responding:
  1. Be clear and concise
  2. Provide examples when helpful
  3. Ask clarifying questions if needed
```

---

## Prompt File Format

For complex prompts, use a separate file:

```bash
# Create prompt file
cat << 'EOF' > ./prompts/my_skill.txt
You are a helpful assistant that specializes in software development.

When responding to requests:
1. Analyze the problem carefully
2. Provide clear, actionable solutions
3. Include code examples when appropriate
4. Explain your reasoning

Always follow best practices and consider edge cases.
EOF

# Create skill with prompt file
sp core skills create \
  --name "dev_helper" \
  --agent primary \
  --prompt-file ./prompts/my_skill.txt
```

---

## Error Handling

### Missing Required Flags

```bash
sp core skills create --name test
# Error: --agent is required in non-interactive mode

sp core skills create --name test --agent primary
# Error: --prompt or --prompt-file is required in non-interactive mode

sp core skills delete my_skill
# Error: --yes is required to delete skills in non-interactive mode
```

### Validation Errors

```bash
sp core skills create --name "Test Skill" --agent primary --prompt "test"
# Error: Skill name must be lowercase alphanumeric with underscores only

sp core skills create --name "ab" --agent primary --prompt "test"
# Error: Skill name must be between 3 and 50 characters

sp core skills create --name "new_skill" --agent nonexistent --prompt "test"
# Error: Agent 'nonexistent' not found
```

### Not Found Errors

```bash
sp core skills edit nonexistent --enable
# Error: Skill 'nonexistent' not found

sp core skills delete nonexistent --yes
# Error: Skill 'nonexistent' not found
```

### Sync Errors

```bash
sp core skills sync
# Error: Failed to connect to database. Check your profile configuration.
```

---

## JSON Output

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

```bash
# Verify JSON is valid
sp --json skills list | jq .

# Extract specific fields
sp --json skills list | jq '.skills[].name'
sp --json skills status | jq '.summary'
sp --json skills list | jq '.skills[] | select(.enabled == true)'
sp --json skills status | jq '.skills[] | select(.synced == false)'
```

---

## Compliance Checklist

- [x] All `execute` functions accept `config: &CliConfig`
- [x] All commands return `CommandResult<T>` with proper artifact type
- [x] `delete` command requires `--yes` / `-y` flag
- [x] All output types derive `Serialize`, `Deserialize`, `JsonSchema`
- [x] No `println!` / `eprintln!` - uses `render_result()`
- [x] No `unwrap()` / `expect()` - uses `?` with `.context()`
- [x] JSON output supported via `--json` flag
- [x] Proper error messages for missing required flags


---

<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>