CLI Reference
Installation
Section titled “Installation”npm install -g @minions-prompts/cli# or use without installingnpx @minions-prompts/cli <command>The CLI reads configuration from minions-prompts.config.json in the current working directory when present, and falls back to sensible defaults.
Commands
Section titled “Commands”create
Section titled “create”Scaffold a new prompt template or version interactively.
minions-prompts create [options]Options
| Flag | Alias | Description | Default |
|---|---|---|---|
--type <type> | -t | Type to create: template or version | template |
--title <title> | Title of the new minion | prompted | |
--content <string> | -c | Inline content string | prompted |
--file <path> | -f | Read content from a file | — |
--follows <id> | Parent template or version ID (for versions) | — | |
--storage <path> | Path to storage file (JSON file backend) | ./prompts.json |
Examples
# Interactive scaffoldminions-prompts create
# Create a template from a fileminions-prompts create --type template --title "Email Reply" --file ./email.txt
# Create a version that follows an existing templateminions-prompts create --type version \ --title "Email Reply v2" \ --follows tpl_abc123 \ --file ./email-v2.txtversion
Section titled “version”Inspect the version chain of a prompt template.
minions-prompts version <templateId> [options]Arguments
| Argument | Description |
|---|---|
templateId | ID of the root template to inspect |
Options
| Flag | Description | Default |
|---|---|---|
--storage <path> | Path to storage file | ./prompts.json |
--json | Output raw JSON instead of formatted table | false |
--diff | Show a word diff between consecutive versions | false |
Examples
# Print the version chain as a tableminions-prompts version tpl_abc123
# Show diffs between each version pairminions-prompts version tpl_abc123 --diff
# Output JSON for scriptingminions-prompts version tpl_abc123 --json | jq '.[].fields.versionNumber'Run the test suite attached to a prompt or compare two versions.
minions-prompts test <promptId> [options]Arguments
| Argument | Description |
|---|---|
promptId | ID of the prompt or version to test |
Options
| Flag | Alias | Description | Default |
|---|---|---|---|
--against <id> | -a | Second prompt ID to run an A/B comparison | — |
--storage <path> | Path to storage file | ./prompts.json | |
--json | Emit results as JSON | false | |
--threshold <n> | Exit with code 1 if average score is below n (0–1) | 0 |
Examples
# Run tests for a single promptminions-prompts test tpl_abc123
# A/B comparison — compare two versionsminions-prompts test tpl_v1 --against tpl_v2
# Fail CI if average score drops below 0.7minions-prompts test tpl_abc123 --threshold 0.7Exit codes
| Code | Meaning |
|---|---|
0 | All tests passed (or score met threshold) |
1 | One or more tests failed, or score below threshold |
2 | Storage or config error |
export
Section titled “export”Export a prompt to LangChain, LlamaIndex, or plain string formats.
minions-prompts export <promptId> [options]Arguments
| Argument | Description |
|---|---|
promptId | ID of the prompt to export |
Options
| Flag | Alias | Description | Default |
|---|---|---|---|
--format <fmt> | -f | Output format: langchain, llamaindex, string, json | string |
--out <path> | -o | Write to file instead of stdout | stdout |
--storage <path> | Path to storage file | ./prompts.json |
Examples
# Print the raw prompt stringminions-prompts export tpl_abc123
# Export as a LangChain PromptTemplate (Python dict format)minions-prompts export tpl_abc123 --format langchain
# Export to fileminions-prompts export tpl_abc123 --format json --out ./exported-prompt.json
# Export for LlamaIndexminions-prompts export tpl_abc123 --format llamaindexList all prompts in the storage file.
minions-prompts list [options]Options
| Flag | Alias | Description | Default |
|---|---|---|---|
--type <type> | -t | Filter by type: template, version, or all | all |
--storage <path> | Path to storage file | ./prompts.json | |
--json | Output as JSON array | false | |
--sort <field> | Sort by createdAt, title, or type | createdAt |
Examples
# List all promptsminions-prompts list
# List only root templatesminions-prompts list --type template
# Machine-readable output sorted by titleminions-prompts list --json --sort titleOutput columns (table format)
| Column | Description |
|---|---|
| ID | Minion ID (truncated) |
| Type | template or version |
| Title | Human-readable label |
| Created | ISO timestamp |
Configuration file
Section titled “Configuration file”Place minions-prompts.config.json at the project root to set persistent defaults:
{ "storage": "./data/prompts.json", "defaultThreshold": 0.75}All CLI flags override the config file values when provided explicitly.