Skip to content

CLI Reference

Terminal window
npm install -g @minions-prompts/cli
# or use without installing
npx @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.


Scaffold a new prompt template or version interactively.

Terminal window
minions-prompts create [options]

Options

FlagAliasDescriptionDefault
--type <type>-tType to create: template or versiontemplate
--title <title>Title of the new minionprompted
--content <string>-cInline content stringprompted
--file <path>-fRead 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

Terminal window
# Interactive scaffold
minions-prompts create
# Create a template from a file
minions-prompts create --type template --title "Email Reply" --file ./email.txt
# Create a version that follows an existing template
minions-prompts create --type version \
--title "Email Reply v2" \
--follows tpl_abc123 \
--file ./email-v2.txt

Inspect the version chain of a prompt template.

Terminal window
minions-prompts version <templateId> [options]

Arguments

ArgumentDescription
templateIdID of the root template to inspect

Options

FlagDescriptionDefault
--storage <path>Path to storage file./prompts.json
--jsonOutput raw JSON instead of formatted tablefalse
--diffShow a word diff between consecutive versionsfalse

Examples

Terminal window
# Print the version chain as a table
minions-prompts version tpl_abc123
# Show diffs between each version pair
minions-prompts version tpl_abc123 --diff
# Output JSON for scripting
minions-prompts version tpl_abc123 --json | jq '.[].fields.versionNumber'

Run the test suite attached to a prompt or compare two versions.

Terminal window
minions-prompts test <promptId> [options]

Arguments

ArgumentDescription
promptIdID of the prompt or version to test

Options

FlagAliasDescriptionDefault
--against <id>-aSecond prompt ID to run an A/B comparison
--storage <path>Path to storage file./prompts.json
--jsonEmit results as JSONfalse
--threshold <n>Exit with code 1 if average score is below n (0–1)0

Examples

Terminal window
# Run tests for a single prompt
minions-prompts test tpl_abc123
# A/B comparison — compare two versions
minions-prompts test tpl_v1 --against tpl_v2
# Fail CI if average score drops below 0.7
minions-prompts test tpl_abc123 --threshold 0.7

Exit codes

CodeMeaning
0All tests passed (or score met threshold)
1One or more tests failed, or score below threshold
2Storage or config error

Export a prompt to LangChain, LlamaIndex, or plain string formats.

Terminal window
minions-prompts export <promptId> [options]

Arguments

ArgumentDescription
promptIdID of the prompt to export

Options

FlagAliasDescriptionDefault
--format <fmt>-fOutput format: langchain, llamaindex, string, jsonstring
--out <path>-oWrite to file instead of stdoutstdout
--storage <path>Path to storage file./prompts.json

Examples

Terminal window
# Print the raw prompt string
minions-prompts export tpl_abc123
# Export as a LangChain PromptTemplate (Python dict format)
minions-prompts export tpl_abc123 --format langchain
# Export to file
minions-prompts export tpl_abc123 --format json --out ./exported-prompt.json
# Export for LlamaIndex
minions-prompts export tpl_abc123 --format llamaindex

List all prompts in the storage file.

Terminal window
minions-prompts list [options]

Options

FlagAliasDescriptionDefault
--type <type>-tFilter by type: template, version, or allall
--storage <path>Path to storage file./prompts.json
--jsonOutput as JSON arrayfalse
--sort <field>Sort by createdAt, title, or typecreatedAt

Examples

Terminal window
# List all prompts
minions-prompts list
# List only root templates
minions-prompts list --type template
# Machine-readable output sorted by title
minions-prompts list --json --sort title

Output columns (table format)

ColumnDescription
IDMinion ID (truncated)
Typetemplate or version
TitleHuman-readable label
CreatedISO timestamp

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.