feat: add polylane setup — wire the CLI into coding agents#2
Merged
Conversation
Installs the bundled agent skill to ~/.claude/skills/polylane-cli/SKILL.md (embedded at codegen time so the published bundle stays network-free) and registers the Polylane MCP server (https://mcp.polylane.com/mcp) in ~/.claude.json. --project targets ./.claude/skills and ./.mcp.json instead. Idempotent and auth-free so the curl installer can run it as its final step. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0149UgXkD5n9z2yKrzCMgCTC
Replaces the Claude-only wiring with an agent registry grounded in the docs' supported-agent list: Claude Code, Cursor, OpenCode, and Codex CLI get the bundled skill plus MCP registration in their own config formats; Windsurf, Zed, and VS Code get MCP registration only. --agent targets specific agents; detection otherwise picks up what is installed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0149UgXkD5n9z2yKrzCMgCTC
boristane
approved these changes
Jul 23, 2026
boristane
marked this pull request as ready for review
July 23, 2026 23:45
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.
Requested by boris · Slack thread
Before
Installing the CLI leaves the agent wiring manual: users have to copy
skill/SKILL.mdinto their agent's skill directory themselves and hand-edit their MCP config to point at the Polylane MCP server — once per coding agent, each with its own config format. The curl installer has no post-install step, unlike raindrop's installer which finishes with asetupcommand.After
polylane setupdetects which coding agents are installed and wires the CLI into each one — idempotent, auth-free, and safe to run from a piped installer. The agent list is the union of the docs' supported-agent pages (platform MCP + docs MCP), with each config format verified against the agent's current documentation:https://mcp.polylane.com/mcp)~/.claudeor~/.claude.json~/.claude/skills/polylane-cli/SKILL.md~/.claude.json→mcpServers(type: http)~/.cursor~/.cursor/skills/polylane-cli/SKILL.md~/.cursor/mcp.json→mcpServers(type: http)~/.config/opencode~/.config/opencode/skills/polylane-cli/SKILL.md~/.config/opencode/opencode.json→mcp(type: remote)~/.codex~/.codex/skills/polylane-cli/SKILL.md~/.codex/config.toml→[mcp_servers.polylane]~/.codeium/windsurf~/.codeium/windsurf/mcp_config.json→mcpServers(serverUrl)~/.config/zed~/.config/zed/settings.json→context_servers(vianpx mcp-remote, per our docs)mcp.json→servers(type: http)skill/SKILL.mdremains the single source of truth). Windsurf, Zed, and VS Code have no native skill mechanism that fits (Windsurf rules are size-capped, Zed has no user-level rules file, VS Code instructions are Copilot-prompt-specific), so they get MCP registration only. Gemini CLI is not in the docs' supported list and is excluded.polylaneare left untouched (users may have added API-key headers); unrelated keys in every config file are preserved; unparseable files (e.g. Zed's commented JSON) are skipped with a manual pointer instead of clobbered. Skills are overwritten with the CLI-bundled version — they're versioned with the CLI.--agent <id>(repeatable) targets specific agents even when not detected;--projectinstalls into the current project where the agent has a project-level convention (./.claude,./.cursor,./.opencode+opencode.json,./.codex/skills,./.vscode/mcp.json);--dry-runprints what would be written.polylane auth login; never launches an interactive flow, socurl … | bashinstalls can run it as their final step.How
codegen/generate-skill.tsreadsskill/SKILL.mdand emitssrc/generated/skill.ts(SKILL_MDconstant); wired intogenerateAll()sonpm run codegenand the build both produce it.src/commands/setup.ts— top-level command (likeupdate) built on three primitives:writeSkillFile(create/update/unchanged),upsertJsonEntry(parse-merge-write with nested key paths; skip on unparseable input), andupsertTomlSection(append-once for Codex'sconfig.toml). Each agent is a small data entry (AGENTS) withdetect/user/project. MCP URL isprocess.env.POLYLANE_MCP_URL || 'https://mcp.polylane.com/mcp', following the existing build-time bake pattern forPOLYLANE_*vars.src/commands/index.ts, added toRESOURCE_ORDERinsrc/registry.tsand toNO_AUTH_COMMANDSinsrc/main.ts.test/setup.test.tscover the three primitives (including invalid-JSON and non-object skips), per-agent config shapes, detection, idempotent re-runs for every agent, and project scope.Verification:
npm run codegen+typecheck+lint+test(112 pass) +build, plus end-to-end smoke of the built bundle (all agents detected, re-run idempotency, Zed JSONC skip path,--agent,--project,--dry-run, unknown-agent usage error) against a scratch$HOME.Companion changes: the polylane.com installer runs
polylane setupas its final step (coreplanelabs/polylanedotcom#3) and the docs quickstart mentions it (coreplanelabs/nominal#171).🤖 Generated with Claude Code
https://claude.ai/code/session_0149UgXkD5n9z2yKrzCMgCTC