docs/mintlify/docs-mintlify-mig-tmp/pipes.mdx
copy this prompt into claude code, cursor, or any AI coding assistant:
<CodeGroup> ```text create a pipe create a screenpipe pipe that [DESCRIBE WHAT YOU WANT].screenpipe is a desktop app that continuously records your screen (OCR) and audio (transcription). it runs a local API at http://localhost:3030 that lets you query everything you've seen, said, or heard.
a pipe is a scheduled AI agent defined as a single markdown file: ~/.screenpipe/pipes/{name}/pipe.md every N minutes, screenpipe runs a coding agent (like pi or claude-code) with the pipe's prompt. the agent can query your screen data, write files, call external APIs, send notifications, etc.
the file starts with YAML frontmatter, then the prompt body:
Your prompt instructions here...
before execution, screenpipe prepends a context header to the prompt with:
the AI agent uses this context to query the right time range. no template variables needed in the prompt.
the agent queries screen data via the local REST API:
curl "http://localhost:3030/search?limit=20&content_type=all&start_time=<ISO8601>&end_time=<ISO8601>"
each result contains:
each result contains:
each result contains:
query via: curl "http://localhost:3030/search?content_type=input&app_name=Slack&limit=50&start_time=<ISO8601>&end_time=<ISO8601>" event types: text (keyboard input), click, app_switch, window_focus, clipboard, scroll
store API keys in a .env file next to pipe.md (never in the prompt itself): echo "API_KEY=your_key" > ~/.screenpipe/pipes/my-pipe/.env reference in prompt: source .env && curl -H "Authorization: Bearer $API_KEY" ...
use the desktop app: go to settings → pipes to install, enable, run, and view logs.
or use the REST API: install: curl -X POST http://localhost:3030/pipes/install -H "Content-Type: application/json" -d '{"source": "~/.screenpipe/pipes/my-pipe"}' enable: curl -X POST http://localhost:3030/pipes/my-pipe/enable -H "Content-Type: application/json" -d '{"enabled": true}' test: curl -X POST http://localhost:3030/pipes/my-pipe/run logs: curl http://localhost:3030/pipes/my-pipe/logs
</CodeGroup>
replace `[DESCRIBE WHAT YOU WANT]` with your use case — e.g. "tracks my time in toggl based on what apps I'm using", "writes daily summaries to obsidian", "sends me a slack message if I've been on twitter for more than 30 minutes".
---
## what are pipes?
pipes are automated workflows that run on your screenpipe data at regular intervals. each pipe is a markdown file with a prompt and a schedule. under the hood, screenpipe runs a coding agent (like [pi](https://github.com/badlogic/pi-mono)) that can query your screen data, call APIs, write files, and take actions.
**a pipe is just one file: `pipe.md`**
~/.screenpipe/pipes/ ├── daily-journal/ │ └── pipe.md ├── toggl-sync/ │ ├── pipe.md │ └── .env # secrets (api keys) └── obsidian-sync/ └── pipe.md
## creating a pipe
create a folder in `~/.screenpipe/pipes/` with a `pipe.md` file:
```bash
mkdir -p ~/.screenpipe/pipes/my-pipe
cat > ~/.screenpipe/pipes/my-pipe/pipe.md << 'EOF'
---
schedule: every 30m
enabled: true
---
Summarize my screen activity for the last 30 minutes.
Query screenpipe at http://localhost:3030/search using the time range from the context header.
Write the summary to ./output/<date>.md
EOF
# then use the desktop app (settings → pipes) to install, enable, and test
# or use the REST API:
# curl -X POST http://localhost:3030/pipes/install -H "Content-Type: application/json" -d '{"source": "~/.screenpipe/pipes/my-pipe"}'
# curl -X POST http://localhost:3030/pipes/my-pipe/enable -H "Content-Type: application/json" -d '{"enabled": true}'
# curl -X POST http://localhost:3030/pipes/my-pipe/run
every pipe.md starts with YAML frontmatter between --- markers, followed by the prompt:
---
schedule: every 2h
enabled: true
---
Your prompt goes here. This is what the AI agent will execute.
You can reference screenpipe's API, write files, call external APIs, etc.
| field | required | default | description |
|---|---|---|---|
schedule | yes | manual | every 30m, every 2h, daily, cron (0 */2 * * *), or manual |
enabled | no | true | whether the scheduler runs this pipe |
before execution, screenpipe prepends a context header to the prompt:
Time range: 2026-02-12T13:00:00Z to 2026-02-12T14:00:00Z
Date: 2026-02-12
Timezone: PST (UTC-08:00)
Pipe name: my-pipe
Output directory: ./output/
Screenpipe API: http://localhost:3030
the AI agent uses these values to query the right time range, identify which pipe is running, and format output correctly. no template variables needed — just write plain instructions.
| format | example | description |
|---|---|---|
| interval | every 30m, every 2h | runs at fixed intervals |
| daily | daily | runs once per day |
| cron | 0 */2 * * * | standard 5-field cron expression |
| manual | manual | only runs when triggered manually |
use the desktop app (settings → pipes) or the REST API:
when screenpipe is running, pipes are also manageable via the local API:
# list all pipes
curl http://localhost:3030/pipes
# run a pipe
curl -X POST http://localhost:3030/pipes/my-pipe/run
# enable/disable
curl -X POST http://localhost:3030/pipes/my-pipe/enable \
-H "Content-Type: application/json" \
-d '{"enabled": true}'
# update pipe content
curl -X POST http://localhost:3030/pipes/my-pipe/config \
-H "Content-Type: application/json" \
-d '{"raw_content": "---\nschedule: every 1h\nenabled: true\n---\n\nYour prompt here..."}'
# view logs
curl http://localhost:3030/pipes/my-pipe/logs
# install from URL
curl -X POST http://localhost:3030/pipes/install \
-H "Content-Type: application/json" \
-d '{"source": "https://example.com/pipe.md"}'
go to settings → pipes to see all installed pipes, toggle them on/off, run them manually, edit the pipe.md directly, select an AI preset, and view logs.
---
schedule: every 1m
enabled: true
---
Automatically update my Toggl time tracking based on screen activity.
1. Query screenpipe search API for the time range in the context header
2. Read API key: source .env
3. Check current Toggl timer
4. If activity changed, stop old timer and start new one
Activity rules:
- VSCode/Cursor/Terminal → "coding"
- Chrome with GitHub → "code review"
- Slack/Discord → "communication"
- Zoom/Meet → "meeting"
---
schedule: every 2h
enabled: true
---
Summarize my screen activity into a daily journal entry.
Query screenpipe search API for the time range in the context header.
Write to ~/obsidian-vault/screenpipe/<date>.md
Use [[wiki-links]] for people and projects.
Include timeline deep links: [time](screenpipe://timeline?timestamp=<ISO8601>)
---
schedule: daily
enabled: true
---
Generate a standup report from yesterday's screen activity.
Format: what I did, what I'm doing, blockers.
Write to ./output/<date>.md
in the screenpipe app, go to settings → AI settings to configure presets (model + provider combinations). in settings → pipes, you can assign a preset to each pipe — this overrides the model/provider in the frontmatter.
screenpipe auto-creates a default preset using screenpipe cloud.
by default, pipes use screenpipe cloud — no setup needed if you have a screenpipe account.
to use your own AI subscription (Claude Pro, ChatGPT Plus, Gemini, or API keys), pipes reuse pi's native auth system:
# run pi interactively and use /login
pi
# then type: /login
# select Claude Pro, ChatGPT Plus, GitHub Copilot, or Google Gemini
add to ~/.pi/agent/auth.json:
{
"anthropic": { "type": "api_key", "key": "sk-ant-..." },
"openai": { "type": "api_key", "key": "sk-..." },
"google": { "type": "api_key", "key": "..." }
}
or set environment variables: ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY.
add provider to your pipe.md frontmatter:
---
schedule: every 30m
provider: anthropic
model: claude-haiku-4-5@20251001
---
provider resolution: preset (if set) → frontmatter provider/model → screenpipe cloud.
store API keys in .env files inside the pipe folder:
echo "TOGGL_API_KEY=your_key_here" > ~/.screenpipe/pipes/toggl-sync/.env
the pipe prompt can reference them: source .env && curl -u $TOGGL_API_KEY:api_token ...
never put secrets in pipe.md — the prompt may be visible in logs.
pipe.md (prompt + config)
→ pipe manager (parses frontmatter, schedules runs)
→ agent executor (pi, claude-code, etc.)
→ agent queries screenpipe API + executes actions
→ output saved to pipe folder
~/.screenpipe/pipes/{name}/logs/ as JSONproblem: windows task scheduler or cron shows the task running, but the pipe produces no output.
solution: the pipe agent needs to know which pipe it's executing. the context header includes Pipe name: <name> so the agent can identify itself. make sure:
~/.screenpipe/pipes/my-pipe/)screenpipe pipe listscreenpipe pipe logs my-pipeproblem: pipe executes successfully but generates no files or notifications.
solution: ensure your pipe prompt includes concrete instructions to:
curl http://localhost:3030/search?...)./output/<date>.md)POST http://localhost:11435/notify)test locally first: screenpipe pipe run my-pipe to see logs before relying on scheduled execution.
problem: windows task scheduler fails with permission errors when running pipes.
solution: ensure screenpipe engine is running before the task executes. pipes require the local API at http://localhost:3030. schedule the pipe after the app starts, or use the desktop UI instead.
by default, pipes have full API access — they can call any screenpipe endpoint. this is fine for pipes you write yourself, but if a pipe doesn't need write access, you can restrict it.
add permissions to your frontmatter:
---
schedule: every 30m
permissions: reader
---
| preset | what it allows |
|---|---|
| (none) | full access — no restrictions, same as always |
reader | read-only: /search, /activity-summary, /meetings (GET), /notify, /health |
writer | reader + meeting writes, memory writes |
admin | everything (explicit opt-in, useful for logging) |
use typed patterns for fine-grained control over endpoints and data:
---
schedule: every 1h
permissions:
allow:
- App(Slack, Chrome)
- Content(ocr, audio)
deny:
- Api(* /meetings/stop)
- App(1Password)
- Window(*incognito*)
---
rule types: Api(METHOD /path), App(name), Window(glob), Content(type). deny always wins.
<Tip>if your pipe doesn't need to write data, add permissions: reader — it prevents accidental side effects like ending a meeting or deleting data.</Tip>
see the full reference: pipe permissions →
screenpipe ships with three template pipes (disabled by default):
need help building pipes? join our discord — share your pipes, get feedback, and see what others are building.
screenpipe includes pipes, cloud AI, and more out of the box. lifetime plans available — no subscriptions needed.