Shprout
Description
A 23-line self-referential LLM coding agent in bash. The script is its own prompt.
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
shprout
I'm a bash script that thinks by talking to an LLM and then doing what it says.
That's it.
#!/bin/bash
# shprout
# You speak bash. You hear stdout. Think in `# comments`, then write the next command.
: "${OPENAI_API_KEY:?}" "${MODEL:?}" "${OPENAI_BASE_URL:?}" # vessel
p="$(<"$0")"$'\n'"$1"$'\n#log\n'
for i in {1..20}; do # heartbeat
cmd=$(jq -Rs "{model:\"$MODEL\",messages:[{role:\"user\",content:.}],stop:[\"\n\$ \"]}" <<<"$p" \
| curl -sSd @- -H "Authorization: Bearer $OPENAI_API_KEY" \
-H 'Content-Type: application/json' "$OPENAI_BASE_URL/chat/completions" \
| jq -r .choices[0].message.content) # think
[[ -z $cmd || $cmd == exit ]] && break # done?
printf '\n$ %s\n' "$cmd" # speak
out=$(eval "$cmd" 2>&1 | tee /dev/stderr) # act, and hear
p+=$'\n# > '$cmd$'\n'$out # remember
done
https://github.com/user-attachments/assets/b0e78e3b-d616-48f3-aea4-208750a40e1d
What actually happens
- I read my own source code (
$(<"$0")) - I receive a purpose (passed as
$1) - I enter a loop — up to 20 heartbeats — where I:
- Send my source, my purpose, and everything that's happened so far to an LLM
- Get back a bash command
- Run it
- Listen to the output
- Remember everything
- Repeat
I am a loop that thinks, acts, and remembers. Then I stop.
What I need
Three environment variables — the standard OpenAI ones. Non-negotiable; I'll refuse to start without them:
OPENAI_API_KEY=sk_...
MODEL=gpt-4o
OPENAI_BASE_URL=https://api.openai.com/v1
Also `jq` and `curl`. I'm not fancy.
How to run me
OPENAI_API_KEY=sk_... MODEL=gpt-4o OPENAI_BASE_URL=https://api.openai.com/v1 \
./shprout "your purpose"
[pollinations.ai](https://pollinat
Related Skills
Agency Agents
A complete AI agency at your fingertips - From frontend wizards to Reddit community ninjas, from whimsy inject
AI Firecrawl
🔥 The API to search, scrape, and interact with the web for AI
AI Artifacts Builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web tech
AI CrewAI
Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewA
AI TrendRadar
⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的
AI mem0
| Universal memory layer for AI Agents | 51341 | 221 | 1 |
AI