Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Run LLM prompts from your shell
| Date | Stars |
|---|---|
| 2026-07-31 | 443 |
| 2026-08-04 | 443 |
| 2026-08-06 | 443 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# runprompt
Run LLM [.prompt](https://google.github.io/dotprompt/) files from your shell with a single-file Python script.
A [.prompt](https://google.github.io/dotprompt/) file contains the prompt and metadata (model, schema, config) in a single file. You can use it to run LLM prompts and get structured responses right in your shell. You can use it to automate AI workflows or build your own harness. Make prompts first-class artifacts. Check them into your repo and run them from the command line instead of making ad-hoc requests to AI chatbots.
[Quick start](#quick-start) | [Examples](#examples) | [Tools](#tools) | [Template syntax](#template-syntax) | [Configuration](#configuration) | [Providers](#providers) | [Caching](#caching) | [Spec compliance](#spec-compliance)
## Quick start
Download the single-file script:
```bash
curl -O https://raw.githubusercontent.com/chr15m/runprompt/main/runprompt
chmod +x runprompt
```
Or you can run it directly without installing using `uvx`:
```bash
uvx --from git+https://github.com/chr15m/runprompt runprompt hello.prompt
```
Or install it via `pip` or `uv` to use it as a library:
```bash
# Using uv (recommended)
uv pip install git+https://github.com/chr15m/runprompt
# Using pip
pip install "git+https://github.com/chr15m/runprompt.git"
```
Create `hello.prompt`:
```yaml
---
model: anthropic/claude-sonnet-4-20250514
---
Say hello to {{name}}!
```
Run it:
```bash
export ANTHROPIC_API_KEY="your-key"
./runprompt hello.prompt '{"name": "World"}'
# alternatively pass data via STDIN.
echo '{"name": "World"}' | ./runprompt hello.prompt
```
(You can get an Anthropic key from here: <https://console.anthropic.com/settings/keys> see below for other keys.)
## Examples
In addition to the following, see the [tests folder](tests/) for more example `.prompt` files.
### Basic prompt with stdin
```yaml
---
model: anthropic/claude-sonnet-4-20250514
---
Summarize this text: {{STDIN}}
```
```bash
cat article.txt | ./runprompt summarize.prompt
```
The special `{{STDIN}}` variable always contains the raw stdin as a string. Both `{{STDIN}}` and `{{ARGS}}` are always available; if input is JSON it's also parsed into individual variables.
### Inline prompts
Run a template directly from the command line without creating a `.prompt` file using `-p` or `--prompt`:
```bash
./runprompt -p "Say hello to {{name}}" --model openai/gpt-4o '{"name": "World"}'
```
### Command line arguments
Pass arguments directly on the command line:
```yaml
---
model: anthropic/claude-sonnet-4-20250514
---
Process this: {{ARGS}}
```
```bash
./runprompt process.prompt Hello world, please summarize this text.
```
The special `{{ARGS}}` variable contains all arguments after the prompt file, joined with spaces. The `{{INPUT}}` variable contains STDIN if provided, otherwise ARGS.
### Structured JSON output
Extract structured data using an output schema:
```yaml
---
model: anthropic/claude-sonnet-4-20250514
input:
schema:
text: string
output:
format: json
schema:
name?: string, the person's name
age?: number, the person's age
occupation?: string, the person's job
---
Extract info from: {{text}}
```
```bash
echo "John is a 30 year old teacher" | ./runprompt extract.prompt
# {"name": "John", "age": 30, "occupation": "teacher"}
```
Schema uses [Picoschema](https://google.github.io/dotprompt/reference/picoschema/) format. Fields ending with `?` are optional. The format is `field: type, description`.
### Chaining prompts
Pipe structured output between prompts:
```bash
echo "John is 30" | ./runprompt extract.prompt | ./runprompt generate-bio.prompt
```
The JSON output from the first prompt becomes template variables in the second.
### Pre-prompt shell commands
Execute shell commands before the prompt is sent to gather dynamic context:
```yaml
---
model: anthropic/claude-sonnet-4-20250514
before:
latest_commit: git log -1 --oneline
current_date: date
file_count: find . -name "*.py" | wc -l
Excerpt of 22,191 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:03d556bebfe9aabc, topic:llm
matched fp:03d556bebfe9aabc, topic:ai-agents
matched fp:03d556bebfe9aabc, topic:prompt-engineering