{"id":50291604,"url":"https://github.com/autohandai/code-agent-sdk-cpp","last_synced_at":"2026-05-28T06:13:36.422Z","repository":{"id":357281202,"uuid":"1233156042","full_name":"autohandai/code-agent-sdk-cpp","owner":"autohandai","description":"Autohand Code Agent SDK for C++: C++20 CLI-backed agent orchestration with CMake targets and examples. Docs: https://autohand.ai/docs/agent-sdk/","archived":false,"fork":false,"pushed_at":"2026-05-12T05:01:38.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-12T06:28:00.271Z","etag":null,"topics":["agent-sdk","autohand","cpp"],"latest_commit_sha":null,"homepage":"https://autohand.ai/docs/agent-sdk/","language":"C++","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/autohandai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","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-05-08T16:45:53.000Z","updated_at":"2026-05-12T05:01:41.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/autohandai/code-agent-sdk-cpp","commit_stats":null,"previous_names":["autohandai/code-agent-sdk-cpp"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/autohandai/code-agent-sdk-cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autohandai%2Fcode-agent-sdk-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autohandai%2Fcode-agent-sdk-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autohandai%2Fcode-agent-sdk-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autohandai%2Fcode-agent-sdk-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/autohandai","download_url":"https://codeload.github.com/autohandai/code-agent-sdk-cpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autohandai%2Fcode-agent-sdk-cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33596441,"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-05-28T02:00:06.440Z","response_time":99,"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-sdk","autohand","cpp"],"created_at":"2026-05-28T06:13:34.104Z","updated_at":"2026-05-28T06:13:36.403Z","avatar_url":"https://github.com/autohandai.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Autohand Code Agent SDK for C++\n\nModern C++20 SDK for building applications that control Autohand code agents through the Autohand CLI JSON-RPC mode.\n\n**Documentation:** https://autohand.ai/docs/agent-sdk/\n\n**Beta:** this SDK is actively evolving while the Agent SDK APIs stabilize. Pin versions in production and review release notes before upgrading.\n\n## What It Does\n\nThe C++ SDK wraps the existing Autohand CLI process and exposes a small host-friendly API:\n\n```text\nC++ app -\u003e autohand::sdk -\u003e Autohand CLI subprocess -\u003e provider -\u003e model\n```\n\nUse it when you want Autohand inside native developer tools, editors, desktop apps, automation services, or CI utilities without reimplementing the CLI agent protocol.\n\n## Features\n\n- C++20 API with value-oriented configuration\n- CMake target: `autohand::sdk`\n- CLI subprocess transport over JSON-RPC 2.0\n- Typed event helpers for message deltas, tools, permissions, and errors\n- High-level `Agent` and `Run` workflow\n- Low-level `AutohandSdk` control methods\n- Structured JSON extraction helper\n- Example parity with the TypeScript SDK examples\n\n## Requirements\n\n- C++20 compiler\n- CMake 3.22 or later\n- POSIX runtime for the initial transport implementation\n- Autohand CLI installed and authenticated\n- A configured provider in `~/.autohand/config.json`, or environment variables accepted by the CLI\n\nSet `AUTOHAND_CLI_PATH` when you want to force a local CLI binary:\n\n```bash\nexport AUTOHAND_CLI_PATH=/path/to/autohand\n```\n\n## Installation\n\nUse the repository as a CMake dependency:\n\n```cmake\ninclude(FetchContent)\n\nFetchContent_Declare(\n  autohand_sdk\n  GIT_REPOSITORY https://github.com/autohandai/code-agent-sdk-cpp.git\n  GIT_TAG main\n)\n\nFetchContent_MakeAvailable(autohand_sdk)\n\ntarget_link_libraries(my_app PRIVATE autohand::sdk)\n```\n\n## Quick Start\n\n```cpp\n#include \u003cautohand/sdk.hpp\u003e\n#include \u003ciostream\u003e\n\nint main() {\n  autohand::Agent agent(\n      autohand::Config::from_environment()\n          .with_cwd(\".\")\n          .with_instructions(\"Review code with senior C++ judgement.\"));\n\n  auto run = agent.send(\"Review this repository for release readiness.\");\n\n  run.stream([](const autohand::SdkEvent\u0026 event) {\n    if (event.type == \"message_update\") {\n      std::cout \u003c\u003c event.text_delta();\n    } else if (event.type == \"permission_request\") {\n      std::cerr \u003c\u003c \"\\npermission requested: \" \u003c\u003c event.description() \u003c\u003c \"\\n\";\n    }\n  });\n\n  auto result = run.wait();\n  std::cout \u003c\u003c \"\\nRun \" \u003c\u003c result.id \u003c\u003c \" finished with \" \u003c\u003c result.status \u003c\u003c \"\\n\";\n}\n```\n\n## Low-Level Control\n\nUse `AutohandSdk` when your host needs direct access to the JSON-RPC control surface:\n\n```cpp\n#include \u003cautohand/sdk.hpp\u003e\n#include \u003ciostream\u003e\n\nint main() {\n  autohand::AutohandSdk sdk(autohand::Config::from_environment().with_cwd(\".\"));\n  sdk.start();\n  sdk.set_plan_mode(true);\n\n  sdk.stream_prompt(\"Create a discovery plan for this SDK change.\", [](const autohand::SdkEvent\u0026 event) {\n    std::cout \u003c\u003c event.type \u003c\u003c \"\\n\";\n  });\n\n  sdk.stop();\n}\n```\n\n## Examples\n\nThe `examples/` directory mirrors the TypeScript SDK example inventory:\n\n- `01-hello-agent.cpp`\n- `02-streaming-query.cpp`\n- `03-code-reviewer.cpp`\n- `04-bash-command.cpp`\n- `05-file-editor.cpp`\n- `06-prompt-skills.cpp`\n- `07-direct-skills.cpp`\n- `08-memory-management.cpp`\n- `10-multi-tool-reasoning.cpp`\n- `13-permissions.cpp`\n- `20-sdlc-discovery-plan.cpp`\n- `21-sdlc-gated-implementation.cpp`\n- `22-sdlc-release-readiness.cpp`\n- `23-system-prompts.cpp`\n- `24-high-level-agent.cpp`\n- `25-structured-json.cpp`\n- `basic-agent.cpp`\n- `basic-usage.cpp`\n- `loop-strategies.cpp`\n- `permission-handling.cpp`\n- `sdk-control-features.cpp`\n- `streaming.cpp`\n\nBuild and run an example:\n\n```bash\ncmake -S . -B build -DAUTOHAND_BUILD_EXAMPLES=ON\ncmake --build build --target example_01_hello_agent\n./build/example_01_hello_agent\n```\n\nLive examples require an authenticated Autohand CLI and may ask for tool permissions depending on your CLI configuration.\n\n## Documentation\n\n- [Getting Started](./docs/getting-started.md)\n- [API Reference](./docs/API_REFERENCE.md)\n- [Configuration](./docs/configuration.md)\n- [Event Streaming](./docs/event-streaming.md)\n- [Permissions](./docs/permissions.md)\n- [Plan Mode](./docs/plan-mode.md)\n- [SDLC Workflows](./docs/sdlc-workflows.md)\n- [Error Handling](./docs/error-handling.md)\n- [Examples](./docs/examples.md)\n- [Contributing](./CONTRIBUTING.md)\n- [Security](./SECURITY.md)\n\n## Development\n\n```bash\ncmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DAUTOHAND_BUILD_TESTS=ON -DAUTOHAND_BUILD_EXAMPLES=ON\ncmake --build build\nctest --test-dir build --output-on-failure\n```\n\nThe transport tests use a deterministic fake CLI, so the unit suite does not require model credentials.\n\n## Other SDKs\n\n- [TypeScript](https://github.com/autohandai/code-agent-sdk-typescript)\n- [Python](https://github.com/autohandai/code-agent-sdk-python)\n- [Go](https://github.com/autohandai/code-agent-sdk-go)\n- [Java](https://github.com/autohandai/code-agent-sdk-java)\n- [Swift](https://github.com/autohandai/code-agent-sdk-swift)\n- [Rust](https://github.com/autohandai/code-agent-sdk-rust)\n- [C#](https://github.com/autohandai/code-agent-sdk-csharp)\n\n## Support\n\n- SDK docs: https://autohand.ai/docs/agent-sdk/\n- Issues: https://github.com/autohandai/code-agent-sdk-cpp/issues\n- Security reports: security@autohand.ai\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautohandai%2Fcode-agent-sdk-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fautohandai%2Fcode-agent-sdk-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautohandai%2Fcode-agent-sdk-cpp/lists"}