feat: add openclaw-cpp — C++20 port of the OpenClaw CLI#1
Draft
Copilot wants to merge 2 commits into
Draft
Conversation
Co-authored-by: daeinki <67304+daeinki@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Convert project to C++ while maintaining structure
feat: add openclaw-cpp — C++20 port of the OpenClaw CLI
Mar 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
openclaw-cpp/, a C++20 port of the TypeScript OpenClaw project that mirrors the same folder structure, file names, and CLI usage as the originalsrc/tree.Summary
openclaw-cpp/directory with CMake build system, fully implemented core modules, stub pairs for all remaining subsystems, and unit tests mirroring the*.test.tspattern.Core modules (fully implemented)
src/version.cpp/hppsrc/version.ts— version resolution from package.json/build-info.jsonsrc/infra/env.cpp/hppsrc/infra/env.ts—isTruthyEnvValue,normalizeEnvsrc/infra/errors.cpp/hppsrc/infra/errors.ts—ErrnoException,formatUncaughtError,collectErrorChainsrc/infra/is-main.cpp/hppsrc/infra/is-main.ts— argv[0]/PM2/wrapper-pair detectionsrc/infra/ports.cpp/hppsrc/infra/ports.ts—PortInUseError,ensurePortAvailablesrc/utils.cpp/hppsrc/utils.ts—clamp,escapeRegExp,assertWebChannel,normalizeE164src/globals.cpp/hppsrc/globals.ts— verbose/yes flags, ANSI colour themesrc/runtime.cpp/hppsrc/runtime.ts—RuntimeEnv,defaultRuntime,createNonExitingRuntimesrc/cli/argv.cpp/hppsrc/cli/argv.ts— full argument parsingsrc/cli/program.cpp/hppsrc/cli/program/— CLI builder with all 17 top-level commandssrc/entry.cppsrc/entry.ts— binary entry point68+ stub
.hpp/.cpppairs cover every remaining sub-module (acp, agents, channels, commands, config, gateway, providers, etc.) with matching public API signatures ready to fill in.Build
Dependency mapping:
commander→ CLI11,JSON.parse→ nlohmann/json,node-fetch→ cpp-httplib,pino→ spdlog,fs/path→std::filesystem. All vendored as header-only;cmakedownloads them automatically on first configure.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
New
openclawnative binary buildable fromopenclaw-cpp/via CMake. CLI surface (commands, flags, help text) is identical to the TypeScript version. No changes to the existing TypeScript CLI.Security Impact (required)
NoNoNoNoNoRepro + Verification
Environment
Steps
cd openclaw-cpp && cmake -B build && cmake --build build./build/bin/openclaw -v./build/bin/openclaw --help./build/bin/openclaw agentExpected
-v/-Vprints version string--helplists all 17 commandsagentdispatches to stub handlerActual
Evidence
-Wall -Wextra -Wpedanticversion,argv,utils,infra/env,infra/errors,infra/portsHuman Verification (required)
--help,-v,-V,agent,config set, unknown command,--no-colorshouldForceReadOnlyAuthStorewithsecrets auditCompatibility / Migration
Yes— additive only, no existing files changedNoNoFailure Recovery (if this breaks)
openclaw-cpp/directory entirely; no other files were modified.Risks and Mitigations
"not yet implemented in C++ port"to stdout so it is obvious at runtime.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.