Skip to content

Commit c9ff9d2

Browse files
committed
Make it pip/uv installable. Fixes #27
1 parent 7b38ce6 commit c9ff9d2

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,29 @@ Run LLM [.prompt](https://google.github.io/dotprompt/) files from your shell wit
88

99
## Quick start
1010

11+
Download the single-file script:
12+
1113
```bash
1214
curl -O https://raw.githubusercontent.com/chr15m/runprompt/main/runprompt
1315
chmod +x runprompt
1416
```
1517

18+
Or you can run it directly without installing using `uvx`:
19+
20+
```bash
21+
uvx --from github.com/chr15m/runprompt runprompt hello.prompt
22+
```
23+
24+
Or install it via `pip` or `uv` to use it as a library:
25+
26+
```bash
27+
# Using uv (recommended)
28+
uv pip install github.com/chr15m/runprompt
29+
30+
# Using pip
31+
pip install "git+https://github.com/chr15m/runprompt.git"
32+
```
33+
1634
Create `hello.prompt`:
1735

1836
```yaml
@@ -620,4 +638,19 @@ This is a minimal implementation of the [Dotprompt specification](https://google
620638
- Partials (`{{>partialName}}`)
621639
- Nested Picoschema (objects, arrays of objects, enums)
622640

623-
The YAML parser is a minimal implementation that handles only the subset of YAML needed for Dotprompt frontmatter (simple key-value pairs, nested objects, and lists). It will likely fail on complex YAML features like anchors, multi-line strings, or flow syntax. If [PyYAML](https://pyyaml.org/) is installed (`pip install pyyaml`), it will be used instead for full YAML support.
641+
The YAML parser is a minimal implementation that handles only the subset of YAML needed for Dotprompt frontmatter (simple key-value pairs, nested objects, and lists). It will likely fail on complex YAML features like anchors, multi-line strings, or flow syntax. See optional dependencies below to use pyyaml instead.
642+
643+
### Optional dependencies
644+
645+
You can install optional dependencies for enhanced features:
646+
647+
- `pyyaml`: For full YAML spec support in frontmatter.
648+
- `playwright`: For high-quality web scraping via the `builtin.fetch_clean` tool.
649+
650+
If you installed via `pip` or `uv`, you can get these with:
651+
652+
```bash
653+
pip install "runprompt[full] @ git+https://github.com/chr15m/runprompt.git"
654+
```
655+
656+
If [PyYAML](https://pyyaml.org/) is installed, it will be used automatically instead of the minimal internal parser.

pyproject.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "runprompt"
7+
version = "0.1.0"
8+
description = "Run LLM .prompt files from your shell"
9+
readme = "README.md"
10+
requires-python = ">=3.8"
11+
dependencies = []
12+
13+
[project.optional-dependencies]
14+
# Full YAML support and better web scraping
15+
full = ["pyyaml", "playwright"]
16+
17+
[project.scripts]
18+
runprompt = "runprompt:main"

runprompt.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
runprompt

0 commit comments

Comments
 (0)