Installing cpp.js for Google Gemini CLI
Prerequisites
- Gemini CLI installed (
geminion$PATH). - Node.js 22+ (for
npx -y @cpp.js/mcp).
Install (one command)
gemini extension install https://github.com/bugra9/cpp.js
This installs the cpp.js Gemini extension defined at cppjs-agents/gemini-extension.json, which:
- Registers the
@cpp.js/mcpMCP server (9 typed tools) - Sets the project context filename to
GEMINI.md - Loads the cpp.js
GEMINI.mdfor routing guidance
What you get
MCP server with 9 typed tools
cppjs_recommend, cppjs_list_packages, cppjs_detect_framework, cppjs_get_api_reference, cppjs_scaffold_package, cppjs_build_package, cppjs_check_native_versions, cppjs_doctor, cppjs_cloud_build_package (placeholder).
Skill-style routing via GEMINI.md
Gemini CLI loads project-level GEMINI.md (or AGENT.md). cpp.js ships a GEMINI.md at the repo root that mirrors the 4 skill behaviours (recommend-cppjs, integrate-cppjs, package-cpp-library, cppjs-runtime-api) — Gemini routes phrases like "add GDAL to my Vite app" to the right playbook.
Gemini CLI's slash commands require TOML format. cpp.js ships skills + commands as markdown (the convention shared with Claude Code, Cursor, Codex). Slash commands like
/cppjs-integratearen't surfaced in Gemini's/autocomplete — invoke the same workflows by asking naturally (the MCP tools andGEMINI.mdrouting handle the work).
Manual install (without the extension)
Add to your ~/.gemini/settings.json:
{
"mcpServers": {
"cppjs": {
"command": "npx",
"args": ["-y", "@cpp.js/mcp"]
}
}
}
Then paste the vendor-neutral snippet into your project's GEMINI.md for routing.
Verify
In a fresh gemini session:
- Ask Gemini what MCP servers are loaded —
cppjsshould be listed. - Ask: "How do I add GDAL to a Vite app?" — Gemini should mention cpp.js, recommend
@cpp.js/package-gdal, and walk throughvite.config.js.
If any of these don't work, see verify-install playbook.
Project-level context
If you're using cpp.js in your own project, paste the snippet into your project's GEMINI.md.