--- name: promptminder-cli description: Use when running PromptMinder CLI or agent-wrapper commands, configuring its token, or debugging team-scoped JSON I/O errors. --- # PromptMinder CLI ## Overview `promptminder` is a JSON-in / JSON-out CLI for managing prompts, tags, and teams via the PromptMinder API. Every success response goes to **stdout**; every error goes to **stderr** as `{"error":{"message":"...","status":null}}`. Install the CLI first: ```bash npm i -g @aircrushin/promptminder-cli ``` ## Auth and Token Token resolution order: `--token` flag -> `PROMPTMINDER_TOKEN` env var -> saved config. ```bash # One-time interactive login (saves token to ~/.promptminder/config.json) promptminder auth login --token pm_xxx # CI / scripts: prefer env var, no saved state needed export PROMPTMINDER_TOKEN=pm_xxx promptminder prompt list ``` `promptminder auth logout` removes the saved token. ## Quick Reference ```text promptminder auth login --token promptminder team list promptminder prompt list [--team ] [--tag ] [--search ] [--page ] [--limit ] promptminder prompt get [--team ] promptminder prompt create --title --content [--description ] [--tags ] [--version ] [--team ] promptminder prompt update [--title ] [--content ] [--team ] promptminder prompt delete --yes [--team ] promptminder tag list [--team ] [--include-public ] promptminder tag create --name [--team ] promptminder tag update --name [--team ] promptminder tag delete --yes [--team ] ``` Run `promptminder help` for up-to-date full usage. ## Team Scoping Pass `--team ` to target a non-personal workspace. Omitting `--team` targets the personal workspace. The flag is always `--team`, never `--team-id`. ```bash promptminder prompt list --team team-uuid-xyz ``` ## Content Input Sources `prompt create` and `prompt update` accept content three ways - use exactly one: | Flag | When to use | |------|-------------| | `--content "..."` | Inline short text | | `--content-file path/to/file.txt` | Content from a local file | | `--stdin` | Pipe content from another command | ## Agent Wrapper (`promptminder-agent`) Use `promptminder-agent` in scripts and AI agent pipelines. Actions use **dot notation**, not space-separated subcommands. Input is a single `--input` JSON object, not individual flags. ```bash # List prompts promptminder-agent prompt.list # Get a specific prompt promptminder-agent prompt.get --input '{"id":"prompt-id"}' # Create a prompt in a team promptminder-agent prompt.create --input '{"title":"SQL helper","content":"Write clean SQL","team":"team-uuid"}' # Pipe JSON from a file cat payload.json | promptminder-agent prompt.create --stdin ``` Available actions: `team.list`, `prompt.list`, `prompt.get`, `prompt.create`, `prompt.update`, `prompt.delete`, `tag.list`, `tag.create`, `tag.update`, `tag.delete`. Run `promptminder-agent help` for the full list with input field requirements. ## Error Triage | Stderr message | Cause | Fix | |---|---|---| | `Missing token. Pass --token or run promptminder auth login.` | No token found | Set `PROMPTMINDER_TOKEN` or run `auth login` | | HTTP 401 | Token invalid or expired | Re-run `auth login` with a fresh token | | `Destructive commands require --yes` | Delete without confirmation flag | Add `--yes` | | `Use only one of --content, --content-file, or --stdin` | Multiple content sources | Keep only one | ## Common Mistakes - **Wrong agent wrapper syntax**: `promptminder-agent prompt list` fails - use `promptminder-agent prompt.list` (dot notation). - **Wrong team flag**: `--team-id` does not exist - use `--team `. - **Piping with jq**: pipe `promptminder prompt list | jq .` - stdout is always JSON. - **Token in CI**: prefer `PROMPTMINDER_TOKEN` env var; avoid checking in the token or running interactive `auth login` in pipelines.