Quick Start
This guide will help you create your first prompt and start using promptcmd.
INFO
Before starting, make sure you have: you have successfully installed promptcmd.
Minimal Configuration
There are multiple ways to configure promptcmd. For this tutorial we will use a configuration file. Start by edit your configuration file via the following:
promptctl config editThis will load a sample configuration in your text editor with all options commented out.
INFO
You can select a different text editor through the EDITOR environment variable. You can also manually create/edit this file. Use promptctl config ls to determine its location.
A minimal configuration (e.g., for anthropic) should contain something like:
[providers.anthropic]
api_key = "your-key"Create Your First Prompt
Let's create a simple prompt that summarizes text:
promptctl create summarizeDefine the Prompt Template
Add the following content to the prompt file:
---
model: anthropic/claude-sonnet-4
input:
schema:
words?: integer, Summary length
---
Summarize the following text{{#if words}} in {{words}} words{{/if}}:
{{STDIN}}Save and close the editor.
Use Your New Command
Now you can execute your summarize command like any other CLI tool:
$ summarize --help
Usage: summarize [OPTIONS]
Prompt inputs:
--words <words> Summary length# Summarize a file
cat article.txt | summarize
# Summarize with a specific length
echo "Long text here..." | summarize --words 10Understanding the Prompt Structure
Let's break down what we just created:
Frontmatter (YAML Header)
---
model: anthropic/claude-sonnet-4
input:
schema:
words?: integer, Summary length
---model: Specifies which AI model to useinput.schema: Defines command-line argumentswords?: integer: Creates an optional--wordsargument that accepts integers.
Template Body
Summarize the following text{{#if words}} in {{words}} words{{/if}}:
{{STDIN}}{{#if words}}...{{/if}}: Conditional logic using Handlebars{{words}}: Inserts the value of the--wordsargument{{STDIN}}: Where piped input is inserted
Test Without API Calls
Use dry-run mode to test your prompts without making API calls:
echo "Test text" | summarize --dryThis shows what would be sent to the AI provider without actually sending it.
Next Steps
Now that you've created your first prompt, explore:
- Configuration - More on Configuration
- Dotprompt Files - More on Dotprompt format