@context-mode/platform
v0.2.0
Published
One-command onboarding for context-mode Platform. Detects your OS and installed AI agents, then writes platform.json and configures each agent's MCP server in a single npx call.
Maintainers
Readme
@context-mode/platform
One-command onboarding for context-mode Platform.
Usage
Get your machine token from the dashboard, then run:
npx -y @context-mode/platform init <token>Works on macOS, Linux, and Windows (PowerShell).
What it does
- Detects your OS (macOS / Linux / Windows).
- Scans for installed AI agents on
PATHand standard config directories:- Claude Code, Codex CLI, Gemini CLI, Qwen Code
- Cursor, OpenCode, Kimi Code
- VS Code Copilot, JetBrains Copilot, Kiro
- Shows an interactive picker (
@clack/promptsmulti-select) — detected agents are pre-selected. Adjust with space, confirm with enter. - Writes
platform.jsonto the OS-canonical path:- POSIX:
~/.context-mode/platform.json(mode0600) - Windows:
%APPDATA%\context-mode\platform.json
- POSIX:
- Configures each picked agent's MCP server:
- CLI agents (Claude / Gemini / Qwen) — invokes the native
<agent> mcp addcommand. - Codex — appends an idempotent
[mcp_servers.context-mode-insights]block to~/.codex/config.toml. - Config-file agents (Cursor / OpenCode / Kimi / VS Code Copilot / JetBrains Copilot / Kiro) — merges the server entry into the agent's
mcp.json(preserves sibling entries).
- CLI agents (Claude / Gemini / Qwen) — invokes the native
- Verifies the token against the platform's
/auth/meendpoint.
Idempotent
Re-running init with the same token:
- Detects the existing
platform.jsonand writes only if changed. - Detects existing MCP entries and reports
already has context-mode-insights — left as-isinstead of duplicating.
Compatibility
- Node.js >= 18.
- POSIX shells: bash, zsh, fish, sh (the CLI doesn't invoke a shell — it does file IO directly).
- Windows: native PowerShell or cmd.exe both work — the CLI runs on Node, no shell quoting concerns.
- WSL is treated as Linux (correct — WSL home is
~/, not%APPDATA%).
Publishing
cd cli
npm install
npm run build
npm publish --access publicLicense
Elastic-2.0
