{"id":50822405,"url":"https://github.com/true-async/php-claw","last_synced_at":"2026-06-13T15:03:05.408Z","repository":{"id":364002721,"uuid":"1264771182","full_name":"true-async/php-claw","owner":"true-async","description":"Minimal personal AI agent (NanoClaw-style) built entirely on PHP TrueAsync","archived":false,"fork":false,"pushed_at":"2026-06-11T08:18:15.000Z","size":81,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-11T09:21:18.243Z","etag":null,"topics":["ai-agents","async","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/true-async.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-10T07:01:19.000Z","updated_at":"2026-06-11T08:17:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/true-async/php-claw","commit_stats":null,"previous_names":["true-async/php-claw"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/true-async/php-claw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/true-async%2Fphp-claw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/true-async%2Fphp-claw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/true-async%2Fphp-claw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/true-async%2Fphp-claw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/true-async","download_url":"https://codeload.github.com/true-async/php-claw/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/true-async%2Fphp-claw/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34288666,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","async","php"],"created_at":"2026-06-13T15:03:04.792Z","updated_at":"2026-06-13T15:03:05.399Z","avatar_url":"https://github.com/true-async.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-claw\n\n[![CI](https://github.com/true-async/php-claw/actions/workflows/ci.yml/badge.svg)](https://github.com/true-async/php-claw/actions/workflows/ci.yml)\n[![Built on PHP TrueAsync](https://img.shields.io/badge/built%20on-PHP%20TrueAsync-8892BF?logo=php\u0026logoColor=white)](https://github.com/true-async/)\n[![Tested with Testo](https://img.shields.io/badge/tested%20with-Testo-2ea44f)](https://github.com/php-testo/testo)\n\nA minimal personal AI agent in the spirit of [OpenClaw](https://github.com/openclaw/openclaw) /\n[NanoClaw](https://github.com/nanocoai/nanoclaw), built **entirely on PHP\n[TrueAsync](https://github.com/true-async/)**. You chat with it; it runs a Claude (or\nDeepSeek / any OpenAI-compatible) agent loop that can take real actions on the host (run\nshell commands, read and write files) and replies in the same conversation. \"Claude Code\nwhose terminal is your chat.\"\n\n\u003e **This is a learning project.** Its purpose is to teach, and to show off, asynchronous\n\u003e PHP built into the engine (TrueAsync): a whole agent (concurrent HTTP, subprocesses, timers)\n\u003e in one process, with plain-looking code that never blocks. It is intentionally small and\n\u003e readable, not a production product. Not affiliated with Anthropic, OpenClaw or NanoClaw.\n\nThe design is documented step by step in [`ARCHITECTURE.md`](ARCHITECTURE.md) and, as a\nnarrative tutorial, in [`tutorial/ru/`](tutorial/ru) (Russian).\n\n## How it works\n\nThe core is the **agentic loop (ReAct)**: a user message goes to the agent; the agent either\nreplies with text or asks to run tools; tools run, their results go back to the agent, and it\ncontinues until a final answer. Everything the agent does is I/O-bound (HTTP to the model,\nHTTP to the chat, `bash` subprocesses), so under TrueAsync it all `await`s and costs no CPU\nwhile suspended: hundreds of conversations run concurrently in a single thread, no callbacks.\n\nLayers: **Chat** (the messenger; a console gateway today), **Agent** (decides the next move;\npluggable backend with cause-aware retries), **Tool** (runs real actions, gated later by a\nsecurity layer), and the **Session** that glues them with the loop.\n\n## Requirements\n\n- A PHP **TrueAsync** build (PHP 8.6+) with the `true_async`, `curl` and `pdo` extensions.\n- Composer (for the dev tooling and autoloader).\n\n## Quick start (console)\n\n```bash\ncomposer install\ncp .env.example .env      # then set an API key (e.g. DeepSeek or Anthropic) and CLAW_ALLOWED_CHATS\nphp bin/claw              # type a message, Ctrl+D to exit\n```\n\n`.env` configures the backend (`CLAW_AGENT` = `claude` | `openai-compatible` | `gemini`), the\nmodel, the API key, and the sandbox working directory. Secrets stay in memory and are never\nexposed to the `bash` tool's environment.\n\n## Run with Docker\n\nThe image builds on the official [TrueAsync PHP image](https://hub.docker.com/r/trueasync/php-true-async),\nso you do not need a local TrueAsync build.\n\n```bash\ndocker build -t php-claw .\ndocker run --rm -it \\\n  -v \"$PWD/.env:/app/.env\" \\\n  -v \"$PWD/workspace:/app/workspace\" \\\n  php-claw\n```\n\nThe `.env` holds your secrets and is never baked into the image, so mount it at run time.\nMounting `workspace` is optional; it lets the file and `bash` tools act on a directory you\ncan see on the host.\n\n## Development\n\nRun everything under the TrueAsync PHP binary:\n\n```bash\nphp vendor/bin/testo            # tests (Testo)\nphp vendor/bin/phpstan analyse  # static analysis (level 8)\nphp vendor/bin/php-cs-fixer fix # coding style\n```\n\nComposer shortcuts: `composer test`, `composer analyse`, `composer cs`, `composer cs-fix`,\n`composer qa` (all three).\n\n## Status\n\nConsole agent that runs end to end (Config, async HTTP with cause-aware retry, Claude \u0026\nDeepSeek backends, `bash` / `read_file` / `write_file` tools, the session loop, a periodic\nscheduler). Next: the security/permission middleware layer, per-session persistence, and a\nTelegram channel.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrue-async%2Fphp-claw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrue-async%2Fphp-claw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrue-async%2Fphp-claw/lists"}