Skip to content

feat(remote): install custom CLI hooks on SSH remote hosts (#192)#204

Merged
wxtsky merged 1 commit into
mainfrom
feat/remote-custom-cli
May 30, 2026
Merged

feat(remote): install custom CLI hooks on SSH remote hosts (#192)#204
wxtsky merged 1 commit into
mainfrom
feat/remote-custom-cli

Conversation

@wxtsky
Copy link
Copy Markdown
Owner

@wxtsky wxtsky commented May 30, 2026

Fixes #192.

Remote install previously only configured the five built-in CLIs (claude / codex / codebuddy / traecli / opencode) plus hermes. User-defined custom CLIs were never pushed to the remote host, so a custom CLI running over SSH got no hooks installed.

What changed

  • configureRemoteHooksScript now takes the custom CLI list (defaults to ConfigInstaller.customCLIs()), serializes it into the remote Python install script, and a new install_custom() writes their hooks alongside the built-ins.
  • Reuses the existing command_for(source) (so events route through codeisland-remote-hook.py with the right CODEISLAND_SOURCE) and remove_our_hooks for clean reinstalls.

Scope (deliberate)

Limited to the claude and nested JSON-hook formats — their stdin carries hook_event_name, so the remote hook handles them without a --event flag. These cover the Claude-fork / Codex-style CLIs that realistically run on a remote dev box.

Skipped remotely (still work locally): flat (Cursor-style, needs --event the remote hook can't supply), and the non-JSON formats (traecli YAML / copilot / kimi TOML / kiroAgent / cline).

Tests

  • New: custom claude CLI is serialized + install_custom() emitted + the whole script still compiles as Python (assertPythonCompiles); flat format is skipped (empty list); empty input is custom_clis = [].
  • swift test — 344 passing.

Note: the remote SSH link can't be exercised in CI, so this is verified via the generated-script tests + Python compile; real end-to-end on a remote host welcome.

🤖 Generated with Claude Code

Remote install only handled the five built-in CLIs (claude/codex/codebuddy/
traecli/opencode) plus hermes; user-defined custom CLIs were never pushed to
the remote, so a custom CLI running on the remote host got no hooks.

Serialize the custom CLI configs into the remote install script and write
their hooks alongside the built-ins via a new install_custom(). Limited to the
claude/nested JSON-hook formats: their stdin carries hook_event_name, so the
remote hook (codeisland-remote-hook.py) handles them with no --event flag.
Cursor-style "flat" (needs --event) and the non-JSON formats (traecli/copilot/
kimi/kiroAgent/cline) are skipped remotely; they still work locally.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@wxtsky wxtsky merged commit ef7db33 into main May 30, 2026
@wxtsky wxtsky deleted the feat/remote-custom-cli branch May 30, 2026 02:48
GeorgeDong32 pushed a commit to GeorgeDong32/CodeIsland that referenced this pull request May 31, 2026
… (wxtsky#204)

Remote install only handled the five built-in CLIs (claude/codex/codebuddy/
traecli/opencode) plus hermes; user-defined custom CLIs were never pushed to
the remote, so a custom CLI running on the remote host got no hooks.

Serialize the custom CLI configs into the remote install script and write
their hooks alongside the built-ins via a new install_custom(). Limited to the
claude/nested JSON-hook formats: their stdin carries hook_event_name, so the
remote hook (codeisland-remote-hook.py) handles them with no --event flag.
Cursor-style "flat" (needs --event) and the non-JSON formats (traecli/copilot/
kimi/kiroAgent/cline) are skipped remotely; they still work locally.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

目前支持 ssh 远程的 custom cli 吗?

1 participant