prompter (generate)
The main command for generating prompts. Can be invoked as prompter or prompter generate.
Usage
prompter [base-prompt] [flags]Modes
- Interactive mode (default) prompts for a base prompt and lets you select templates
- Non-interactive mode (
--yes) uses only arguments and flags
# Interactiveprompter
# Non-interactiveprompter "explain this function" --yesInputs
Base Prompt
Passed as arguments and joined with spaces:
prompter "explain this code"prompter explain this code # Same as aboveClipboard
Append clipboard text or use it as the base prompt:
# Append clipboardprompter "explain this output" --clipboard
# Use clipboard as base prompt (if no prompt provided)prompter --clipboardPiped Input
Any stdin content is appended at the end:
# Pipe command outputgit diff | prompter "explain these changes"
# Pipe file contentcat error.log | prompter "analyze this error"
# Pipe test outputbun test | prompter "summarize this failure" --yesTemplates
By Name
prompter --template code-reviewprompter --template code-review --template securityBy Flag
Template flags are automatically generated based on the markdown file name and can also be set in template frontmatter.
More information in Templates.
# If template has flag: "code-review"prompter --code-review
# If template has shorthand: "r"prompter -rUse prompter --help to see all available template flags.
Including dynamically generated template flags.
Built-in Flags
Built-in Shorthand Flags
Because templates dynamically generate flags as a part of my primary workflows with prompter, the built-in flag shorthands are defaulted to use capital case for the root comamnd.
All shorthands can be remapped in the Config.
Help
Prompter is designed to do a lot of things. And do weird things with the flag manipulation.
You can check the builtin and dynamically generated flags with the --help flag. For any command.
prompter --helpShort form:
prompter -HContext Flags
Files
Include specific files (repeatable):
prompter "review these" --file main.goprompter "review these" --file main.go --file utils.goShort form:
prompter "review these" -F main.go -F utils.goDirectory Path
Include the current directory path:
prompter "analyze the codebase" --directoryShort form:
prompter "analyze the codebase" -DDirectory Content
Include the current directory contents:
prompter "analyze the codebase" --dir-contentWarning: this will dump top level file contents into the prompt
Directory inclusion uses directory_strategy from config:
git- Include only tracked filesfilesystem- Walk directory tree (respects .gitignore)
Output Flags
Target
Specify where to send the output:
# Copy to clipboard (default)prompter "explain this" --target clipboard
# Print to stdoutprompter "explain this" --target stdout
# Save to file (other than history)prompter "explain this" --target file:/tmp/prompt.txt
# Open in editorprompter "explain this" --target editorShort form:
prompter "explain this" -T stdoutEditor
Open the prompt in your editor:
prompter "explain this" --editorShort form:
prompter "explain this" -EHow is this different than -T editor?
Dpending on your configured editor; -T clipboard -E allows you to use your editor to draft / touch up the prompt.
While, still copying to the clipboard.
If the target is clipboard, and the editor is a terminal compatible editor like nvim the
prompt will be copied on close.
More info in Integrations
History
Tagging
Add a tag to the history entry:
prompter "fix bug #123" --tag bug-123Short form:
prompter "fix bug #123" -G bug-123Search history by tag later:
prompter history bug-123More info in History
Agents
Include local AGENTS.md in prompt if present:
prompter "explain this" --agentsShort form:
prompter "explain this" -AAgent templates are also controlled by the include_agents config setting.
Mode Control
Force Interactive
Helpful if interactive_default == false
prompter --interactive "explain this"Short form:
prompter -I "explain this"Force Non-Interactive
Helpful if interactive_default == true
prompter --yes "explain this"Short form:
prompter -Y "explain this"Template Order
Templates are applied in the order they appear on the command line. The base prompt is inserted where the first non-flag argument appears.
# Base prompt after templateprompter --template context "explain this"
# Base prompt between templatesprompter --template before "explain this" --template afterExamples
Basic Usage
# Simple promptprompter "explain this code"
# With a specific fileprompter "review this" --file src/main.go
# Include entire directoryprompter "analyze the codebase" --directoryUsing Templates
# Use a specific templateprompter --template code-review
# Use multiple templatesprompter --template code-review --template security-check
# Use template shorthand flagsprompter -r # Uses code-review template with shorthand 'r'Output Targets
# Copy to clipboard (default)prompter "explain this"
# Print to stdoutprompter "explain this" --target stdout
# Save to fileprompter "explain this" --target file:/tmp/prompt.txt
# Open in editorprompter "explain this" --editorWith Context
# Include clipboard contentprompter "explain this output" --clipboard
# Include specific filesprompter "review these files" --file src/main.go --file src/utils.go
# Include directory with agent templatesprompter "analyze the project" --directory --agentsTagged History
# Add a tag for later retrievalprompter "fix bug #123" --tag bug-123
# Search history by tag laterprompter history bug-123Piped Workflows
# Analyze test failuresnpm test 2>&1 | prompter "explain these test failures" --yes
# Review git changesgit diff | prompter --code-review --yes
# Analyze logstail -n 100 app.log | prompter "find the error" --yesConfiguration
Override config with flags:
# Use custom config fileprompter --config .prompter/custom-config.toml
# Force interactive modeprompter --interactive
# Force non-interactive modeprompter --yesReserved Short Flags
These single-letter flags are reserved by Prompter:
-A- Agents-B- Clipboard-D- Directory-E- Editor-F- File-G- Tag (history)-I- Interactive-T- Target-V- Version-Y- Yes (non-interactive)
Template shorthands cannot use these letters unless remapped in config.