[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-80519":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":12,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":9,"rankLanguage":9,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":9,"pushedAt":9,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":15,"starSnapshotCount":15,"syncStatus":13,"lastSyncTime":26,"discoverSource":27},80519,"pie","c4pt0r\u002Fpie","c4pt0r","Rust port of the pi agent harness — coding agent + LLM runtime stack",null,"Rust",110,10,2,9,0,39,52.02,"MIT License",false,"main",true,[],"2026-06-12 04:01:28","# pie\n\n`pie` is a Rust rewrite of the original [pi](https:\u002F\u002Fgithub.com\u002Fearendil-works\u002Fpi) project (pi-coding-agent). `pie` is a terminal-based AI coding agent, run it inside a project, ask it to inspect files, make edits,\nrun shell commands, remember preferences, and continue previous sessions.\n\n## Install \u002F build\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fc4pt0r\u002Fpie.git\ncd pie\ncargo build --release\n```\n\nThe CLI binary will be at `.\u002Ftarget\u002Frelease\u002Fpie`.\n\n## Configure a model\n\n`pie` auto-detects the first available provider credential. Set an API key before starting:\n\n```bash\nexport ANTHROPIC_API_KEY=sk-ant-...\n# or: OPENAI_API_KEY, OPENROUTER_API_KEY, GROQ_API_KEY,\n#     MISTRAL_API_KEY, GEMINI_API_KEY, GOOGLE_API_KEY\n```\n\nYou can also store a key from inside `pie`:\n\n```text\n\u002Flogin anthropic sk-ant-...\n```\n\n### Local OpenAI-compatible models\n\n`pie` can also use local OpenAI-compatible servers. Add a model definition to\n`~\u002F.pie\u002Fmodels.json` (user-global) or `\u003Cproject>\u002F.pie\u002Fmodels.json` (project-local, higher\nprecedence), then select it with `--provider` and `--model`.\n\nExample for [DS4](https:\u002F\u002Fgithub.com\u002Fantirez\u002Fds4), the DeepSeek V4 Flash local\nserver. The Responses endpoint is the preferred OpenAI-compatible API for\nCodex-style clients; chat completions also works for simpler integrations.\n\n```bash\n# In the DS4 checkout:\n.\u002Fds4-server --ctx 100000 --kv-disk-dir \u002Ftmp\u002Fds4-kv --kv-disk-space-mb 8192\n# If launching from another directory, add: --chdir \u002Fpath\u002Fto\u002Fds4\n```\n\n```json\n{\n  \"models\": [\n    {\n      \"id\": \"deepseek-v4-flash\",\n      \"name\": \"DeepSeek V4 Flash (local DS4)\",\n      \"api\": \"openai-responses\",\n      \"provider\": \"ds4\",\n      \"baseUrl\": \"http:\u002F\u002F127.0.0.1:8000\u002Fv1\",\n      \"reasoning\": true,\n      \"thinkingLevelMap\": {\n        \"off\": null,\n        \"minimal\": \"low\",\n        \"low\": \"low\",\n        \"medium\": \"medium\",\n        \"high\": \"high\",\n        \"xhigh\": \"xhigh\"\n      },\n      \"input\": [\"text\"],\n      \"cost\": { \"input\": 0, \"output\": 0, \"cacheRead\": 0, \"cacheWrite\": 0 },\n      \"contextWindow\": 100000,\n      \"maxTokens\": 384000,\n      \"compat\": {\n        \"supportsStore\": false,\n        \"supportsDeveloperRole\": false,\n        \"supportsReasoningEffort\": true,\n        \"supportsUsageInStreaming\": true,\n        \"maxTokensField\": \"max_tokens\",\n        \"supportsStrictMode\": false,\n        \"thinkingFormat\": \"deepseek\",\n        \"requiresReasoningContentOnAssistantMessages\": true\n      }\n    }\n  ]\n}\n```\n\nThen run:\n\n```bash\nexport DS4_API_KEY=dsv4-local\n.\u002Ftarget\u002Frelease\u002Fpie --provider ds4 --model deepseek-v4-flash --base-url http:\u002F\u002F127.0.0.1:8000\u002Fv1\n```\n\nDS4 is local and accepts placeholder bearer tokens. You can also store the same\nlocal placeholder with `\u002Flogin ds4 dsv4-local`. Using the `ds4` provider keeps\nlocal model credentials separate from real `OPENAI_API_KEY` credentials.\n\n`--base-url`, `DS4_BASE_URL` (or `DS4_URL`) registers the conventional `ds4` \u002F\n`deepseek-v4-flash` descriptor without a `models.json` file. CLI `--base-url`\nwins for the current run. Keep `models.json` when you need different limits,\ncompatibility flags, or a project-local override.\n\n## Quick start\n\n```bash\n# Start in the current project\n.\u002Ftarget\u002Frelease\u002Fpie\n\n# Choose a specific provider\u002Fmodel\n.\u002Ftarget\u002Frelease\u002Fpie --provider anthropic --model claude-haiku-4-5\n\n# Enable extended thinking where supported\n.\u002Ftarget\u002Frelease\u002Fpie --thinking high\n\n# Resume the most recent session for this project\n.\u002Ftarget\u002Frelease\u002Fpie --resume\n```\n\nOnce the REPL opens, type a request such as:\n\n```text\nsummarize this repository\nfix the failing tests\nadd a README example and run the relevant checks\nwhen ~\u002Fbuild.done appears, run cargo test and show me the result\n```\n\n## Useful commands\n\nInside `pie`, slash commands control the session:\n\n| Command | What it does |\n|---------|--------------|\n| `\u002Fhelp` | Show all commands |\n| `\u002Fmodel [provider:model-id]` | Show or switch model |\n| `\u002Fthinking` | Show or set thinking level, off, minimal, low, medium, high, xhigh |\n| `\u002Fsessions` | List sessions for the current project |\n| `\u002Fsave [path]` | Export the transcript to Markdown |\n| `\u002Fcompact [instructions]` | Compact long context |\n| `\u002Fundo` | Remove the most recent user\u002Fassistant turn |\n| `\u002Fcost` | Show token and cost totals |\n| `\u002Flogin \u003Cprovider> \u003Capi-key>` | Store an API key |\n| `\u002Flogout \u003Cprovider>` | Remove a stored API key |\n| `\u002Ftriggers` | Show trigger rules, sources, running actions, and audit |\n| `\u002Ftriggers rules` | List dynamic trigger ids and state |\n| `\u002Ftriggers enable \u003Cid>` \u002F `\u002Ftriggers disable \u003Cid>` | Resume or pause a trigger |\n| `\u002Ftriggers remove \u003Cid>` | Delete a trigger |\n| `\u002Fcron` | List local scheduled jobs |\n| `\u002Fcron add \"\u003Cminute hour dom month dow>\" \u003Cprompt>` | Run a prompt on a local schedule |\n| `\u002Fcron enable \u003Cid>` \u002F `\u002Fcron disable \u003Cid>` | Resume or pause a scheduled job |\n| `\u002Fcron remove \u003Cid>` | Delete a scheduled job |\n| `\u002Fquit` | Exit |\n\nCLI helpers:\n\n```bash\n.\u002Ftarget\u002Frelease\u002Fpie --help\n.\u002Ftarget\u002Frelease\u002Fpie --list-sessions\n.\u002Ftarget\u002Frelease\u002Fpie --list-all-sessions\n.\u002Ftarget\u002Frelease\u002Fpie --delete-session \u003Cid>\n.\u002Ftarget\u002Frelease\u002Fpie --image screenshot.png\n```\n\n## What pie can do\n\nThe agent has tools for common coding workflows:\n\n- read, write, and edit files\n- list files and search with grep\u002Ffind\n- run shell commands\n- manage persistent memory\n- delegate focused sub-tasks\n- resume JSONL-backed sessions per project\n- attach images to the first prompt with `--image`\n- create session-scoped natural-language triggers that run actions when local checks or MCP\n  push events match\n- create session-scoped cron jobs that run prompts on a local schedule\n- run local command hooks or HTTP webhooks on agent lifecycle events; see [docs\u002Fhooks.md](docs\u002Fhooks.md)\n\n## Triggers\n\nTriggers let you describe an automation in normal chat:\n\n```text\nwhen $HOME\u002Fhelloworld exists, print its contents\n```\n\n`pie` turns that request into a dynamic trigger rule. Rules are stored next to the active\nsession, so a new session starts cleanly and `--resume` brings that session's rules back.\nDynamic triggers fire once by default; ask for a repeating trigger when you want it to keep\nrunning.\n\nTrigger actions run in a separate sub-agent. The sub-agent inherits the parent model, tools,\ntool hooks, thinking level, and skill catalog, but it does not receive the full parent\nconversation by default. Trigger output is shown in the TUI and written to trigger audit\nrecords. If you explicitly ask for the result to be visible to future turns, the rule is\ncreated with `promote_to_chat=true` and successful trigger output is inserted into the main\nchat context with a `[Trigger ...]` prefix.\n\nLocal dynamic checks poll every 10 minutes by default, and only emit checks while at least\none enabled dynamic rule exists. Configure the interval in `~\u002F.pie\u002Fconfig.toml`:\n\n```toml\n[triggers]\npoll_interval_secs = 600\n```\n\nFor one run, override it with:\n\n```bash\n.\u002Ftarget\u002Frelease\u002Fpie --trigger-poll-secs 60\n```\n\nMCP notifications are treated as trigger sources too: a configured MCP server can push an\nevent into the same trigger runtime, where the same rules, audit, deduping, and output\nbehavior apply.\n\n## Cron jobs\n\nCron jobs are time-based automations, separate from dynamic triggers. By default they are\nstored next to the active session transcript, so a new session starts cleanly and `--resume`\nbrings that session's scheduled jobs back. Cron jobs use local time and support standard\n5-field cron expressions:\n\n```text\n\u002Fcron add \"*\u002F30 * * * *\" summarize the repo state\n\u002Fcron list\n\u002Fcron disable cron-...\n```\n\nWhen a cron job is due, it enters the same serialized agent turn queue used by prompts and\ntrigger inject-and-run actions. `pie` does not backfill missed ticks after downtime. If a\njob is still running when its next tick arrives, that tick is skipped and recorded in the\njob status. Cron config stores only the schedule and action text; control-plane audit and\nUI output use bounded, redacted previews.\n\n`\u002Fcron add` and natural-language scheduled jobs are session-scoped. They do not write a\nuser-global `~\u002F.pie\u002Fcron.toml`; a global cron install must be an explicit separate user\naction rather than the default behavior.\n\n## Files and storage\n\nBy default, `pie` stores local state under `~\u002F.pie`:\n\n| Path | What |\n|------|------|\n| `~\u002F.pie\u002Fsessions\u002F\u003Ccwd-hash>\u002F\u003Cuuidv7>.jsonl` | Session history for each project |\n| `~\u002F.pie\u002Fmemory\u002F*.md` | Cross-session memory injected into future sessions |\n| `~\u002F.pie\u002Fauth.json` | Stored API keys from `\u002Flogin` |\n| `~\u002F.pie\u002Fmodels.json` | User-global local\u002Fcustom model definitions |\n| `~\u002F.pie\u002Fhistory` | Prompt history |\n| `~\u002F.pie\u002Fhooks.toml` | Optional command\u002Fwebhook hooks |\n| `~\u002F.pie\u002Fsessions\u002F\u003Ccwd-hash>\u002F\u003Cuuidv7>.cron.toml` | Session-scoped cron jobs |\n| `~\u002F.pie\u002Fconfig.toml` | Optional user config, including trigger poll interval |\n\nSet `PIE_DIR` to use a different base directory.\n\n## Development\n\n```bash\ncargo build --workspace\ncargo test --workspace\ncargo clippy --workspace --all-targets -- -D warnings\ncargo fmt --all --check\n```\n\n## License\n\n[MIT](LICENSE)\n","pie 是一个基于 Rust 语言重写的终端 AI 编码助手，它可以在项目中运行，帮助用户检查文件、编辑代码、执行 shell 命令、记住偏好设置并继续之前的会话。该项目支持多种大型语言模型（LLM）的集成，包括但不限于 Anthropic, OpenAI, 和本地部署的 OpenAI 兼容模型如 DeepSeek V4 Flash。通过简单的环境变量配置或内置命令即可切换不同的模型提供商与具体模型。适用于需要自动化编码辅助、提高开发效率的场景，尤其是在频繁进行代码审查和修改时能够显著提升工作效率。","2026-06-11 04:01:04","CREATED_QUERY"]