{"id":50673140,"url":"https://github.com/ybouane/dash-p","last_synced_at":"2026-06-11T16:00:59.769Z","repository":{"id":362544249,"uuid":"1259658765","full_name":"ybouane/dash-p","owner":"ybouane","description":"Make Claude Scriptable Again","archived":false,"fork":false,"pushed_at":"2026-06-04T18:35:18.000Z","size":133,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-09T14:24:22.955Z","etag":null,"topics":["agent","agent-sdk","ai","anthropic","claude","claude-code","tui"],"latest_commit_sha":null,"homepage":"https://ybouane.com/","language":"TypeScript","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/ybouane.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-04T18:19:32.000Z","updated_at":"2026-06-09T08:09:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ybouane/dash-p","commit_stats":null,"previous_names":["ybouane/dash-p"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ybouane/dash-p","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ybouane%2Fdash-p","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ybouane%2Fdash-p/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ybouane%2Fdash-p/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ybouane%2Fdash-p/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ybouane","download_url":"https://codeload.github.com/ybouane/dash-p/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ybouane%2Fdash-p/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34157453,"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-10T02:00:07.152Z","response_time":89,"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":["agent","agent-sdk","ai","anthropic","claude","claude-code","tui"],"created_at":"2026-06-08T13:30:29.344Z","updated_at":"2026-06-10T15:00:35.786Z","avatar_url":"https://github.com/ybouane.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003csub\u003e*Follow me on X [@ybouane](https://x.com/ybouane) — I'm building in public.*\u003c/sub\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/ybouane/dash-p/main/banner.png\" alt=\"dash-p — make Claude scriptable again\" width=\"640\"\u003e\n\u003c/p\u003e\n\n# Make Claude Scriptable Again\n\n### `dash-p`\n\n\u003e **If Claude can interact with apps through their interfaces, developers should be able to interact with Claude Code through theirs.**\n\n---\n\nClaude can click buttons, type into apps, read screens, and operate software through a GUI.\\\nSo why shouldn’t developers be able to automate their own Claude Code session?\n\ndash-p is a CLI and TypeScript library that makes Claude Code scriptable by driving the real Claude TUI process you already use.\n\nIt does not bypass Claude Code.\\\nIt does not fake network requests.\\\nIt does not bypass authentication.\n\nIt simply launches the official `claude` command, injects input programmatically, reads output programmatically, and exposes a clean developer interface on top.\n\nThe same Claude Code.\\\nThe same local session.\\\nThe same authentication flow.\\\nJust composable.\\\nNot a replacement for Claude Code.\n\nA bridge that makes it scriptable.\n\n\n---\n\n## Use it in one line\n\n**CLI — replace `claude -p`:**\n\n```diff\n- claude -p \"summarize this repo\"\n+ dash-p  \"summarize this repo\"\n```\n\n**SDK — replace the import:**\n\n```diff\n- import { query } from \"@anthropic-ai/claude-agent-sdk\";\n+ import { query } from \"@ybouane/dash-p\";\n```\n\nThat’s the whole idea. Same prompt in, same shape of answer out — but produced by driving the interactive TUI instead of the `-p` headless flag.\n\n---\n\n## Getting started\n\n**Prerequisite:** the official **`claude` CLI**, installed and logged in — run `claude` once interactively to sign in. dash-p drives that binary; it does not bundle or replace it. (Also: Node ≥ 20. node-pty installs a prebuilt binary on common platforms; if yours needs compiling you’ll want a C++ toolchain — macOS `xcode-select --install`, Debian/Ubuntu `apt install build-essential python3`.)\n\n**CLI — install globally:**\n\n```bash\nnpm install -g @ybouane/dash-p\n\ndash-p \"what color is the sky\"\n```\n\nThat puts a `dash-p` command on your `PATH`. Verify with `which dash-p`. If `claude` isn’t on your `PATH`, pass `--claude-path /abs/path/to/claude`.\n\n**SDK — add to a project:**\n\n```bash\nnpm install @ybouane/dash-p\n```\n\n```ts\nimport { query } from \"@ybouane/dash-p\";\n```\n\n**No install:**\n\n```bash\nnpx @ybouane/dash-p \"what color is the sky\"\n```\n\n---\n\n## CLI\n\n```bash\ndash-p \"explain this repo in two sentences\"\ndash-p -m sonnet \"summarise the CHANGELOG\"\ndash-p -o json \"what is 6 * 7? reply with just the number\"\necho \"a long prompt from a pipe\" | dash-p\ndash-p -o stream-json \"name two primary colors\"     # JSONL message stream\n```\n\nOutput formats mirror `claude -p`: `text` (default), `json`, `stream-json`.\nRun `dash-p --help` for the full flag list (model, permission mode, tools,\nworking dir, terminal size, and more).\n\n## SDK\n\nThe `query()` shape matches `@anthropic-ai/claude-agent-sdk`, so code ports over:\n\n```ts\nimport { query } from \"@ybouane/dash-p\";\n\nfor await (const msg of query({\n  prompt: \"In one sentence, what is a pseudo-terminal?\",\n  options: { model: \"sonnet\", includePartialMessages: true },\n})) {\n  if (msg.type === \"stream_event\" \u0026\u0026 msg.event.type === \"content_block_delta\")\n    process.stdout.write(msg.event.delta.text);\n  if (msg.type === \"result\") console.log(\"\\n[done]\", msg.result);\n}\n```\n\nYou get `system` / `user` / `assistant` / `stream_event` / `result` messages,\nwith structured `tool_use` + `tool_result` blocks. See\n[docs/SDK-PARITY.md](docs/SDK-PARITY.md) for exactly what’s supported.\n\n---\n\n## How it works\n\n```\n your CLI / query()  →  dash-p engine  →  spawns the real `claude` in a PTY\n```\n\n1. **Launch** — spawns the official `claude` interactive TUI inside a pseudo-terminal (so it renders its true UI, exactly as for a human).\n2. **Inject** — pastes your prompt and keystrokes into the terminal.\n3. **Read** — feeds the terminal output through a headless terminal emulator (the same engine VS Code uses) to reconstruct the screen.\n4. **Extract** — recognizes the conversation structure (assistant text, tool calls, results) and returns it as clean text or structured SDK messages.\n\nAll the Claude-specific knowledge (what the prompt box looks like, how a tool\ncall renders, etc.) lives as **data** in versioned [`profiles/`](profiles/), so a\nTUI update is a profile edit, not an engine rewrite. There’s even a\n[self-recalibration skill](recalibrate/SKILL.md) for new Claude releases.\n\nFor the full architecture, see [docs/DESIGN.md](docs/DESIGN.md).\n\n---\n\n## Good to know\n\ndash-p reads the *rendered* screen, so it’s inherently tied to how the TUI looks\n(it’s calibrated against Claude Code 2.1.x). A few things are fidelity ceilings of\nscreen-scraping — e.g. markdown syntax like code fences is rendered-then-lossy.\n\nFor byte-exact output when you need it, dash-p can read the session transcript\nClaude Code already writes to disk:\n\n```bash\ndash-p --enrich-from-session \"...\"   # exact text + token usage\ndash-p --verify-session       \"...\"   # warn if the scrape diverges from ground truth\n```\n\nThis stays read-only — dash-p still *drives* only through the TUI.\n\nThis is a research experiment, not an official product. Use your own account and\nrespect Claude Code’s terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fybouane%2Fdash-p","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fybouane%2Fdash-p","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fybouane%2Fdash-p/lists"}