[v0.1/SSH Review] --host フラグ名と URI/destination 表記の不一致 #37

Closed
opened 2026-09-03 16:30:48 +09:00 by natsukium · 1 comment
Owner

現状

  • CLI のグローバルフラグは --host <user@host> だが、実際は ssh が受理する任意の文字列を verbatim で渡す。user@host / ~/.ssh/config alias / ssh://user@host:port URI のいずれも受理する(cli.md "Local or remote, same verbs")。
  • proto と domain 型では同一概念が destination と命名されている: Carrier::Ssh { destination } / RetargetCarrier::Ssh { destination } / felis.proto: SshEndpoint.destination。CLI help も DESTINATION と表記(felis ssh <DESTINATION>)。
  • --host という名前は URI を渡したときに嘘になる(host ではなく URI)。--socket がパスであるのに対し、--host は「SSH が解釈する宛先」を意味しており、対称性がない。
  • window retarget では同一概念が --host として再登場しつつ、felis ssh alias では positional DESTINATION になる。三箇所で同一値に三つの呼び方。
  • proto で reserved "host", "ssh_args", "socket" とあるように、過去の bag-of-optionals からの改名残滓が schema に残っている。

問い(1.0 でしか変えられない)

--host をこのまま凍結するか? 名前を destination / remote / ssh-target 等の正確な語に直すか?

破壊的変更案

  • 案A: --host--remote (または --ssh-destination) にリネームし、--host は v0.1 のみ deprecated alias として残す。 proto/doc/CLI help の destination と統一。--ssh-arg も合わせて --ssh-opt / --ssh-arg のどちらに寄せるかを決める。
  • 案B: 現行維持。 --host は短く覚えやすく、scp/ssh の慣用に合わせたという rationale を control-surfaces.md に追記して凍結。

判定基準

  • felis --help / felis ssh --help / felis window retarget --help を並べて読んだとき、三つの carrier 指定(--host/--to-socket/default)が同一語彙で説明できること。
  • reference/cli.md / reference/ipc.md / proto / crates/.../messages.rs の命名が一致していること(現状 host vs destination の乖離を解消)。
  • 既存の ~/.ssh/config ユーザが --host myalias を直感で打てること(--remote でもこれは満たす)。

対象ファイル

  • crates/felis-cli/src/main.rs (Cli::host), crates/felis-client/src/main.rs, crates/felis-client-core/src/connector.rs, crates/felis-protocol/proto/felis.proto, docs/reference/cli.md, docs/reference/ipc.md, docs/how-to/attach-over-ssh.md

参考

  • #3 CLI 動詞・名詞階層レビューでは触れられなかったが、同根の「名前が実装の宛先概念を正確に指しているか」問題。
  • 互換性は無視してよい(本レビュー前提)。1.0 で変えるなら just check / just schema 相当の help/completions/man も同時更新。

cc @natsukium

## 現状 - CLI のグローバルフラグは `--host <user@host>` だが、実際は `ssh` が受理する任意の文字列を verbatim で渡す。`user@host` / `~/.ssh/config` alias / `ssh://user@host:port` URI のいずれも受理する(`cli.md` "Local or remote, same verbs")。 - proto と domain 型では同一概念が `destination` と命名されている: `Carrier::Ssh { destination }` / `RetargetCarrier::Ssh { destination }` / `felis.proto: SshEndpoint.destination`。CLI help も `DESTINATION` と表記(`felis ssh <DESTINATION>`)。 - `--host` という名前は URI を渡したときに嘘になる(host ではなく URI)。`--socket` がパスであるのに対し、`--host` は「SSH が解釈する宛先」を意味しており、対称性がない。 - `window retarget` では同一概念が `--host` として再登場しつつ、`felis ssh` alias では positional `DESTINATION` になる。三箇所で同一値に三つの呼び方。 - proto で `reserved "host", "ssh_args", "socket"` とあるように、過去の bag-of-optionals からの改名残滓が schema に残っている。 ## 問い(1.0 でしか変えられない) `--host` をこのまま凍結するか? 名前を `destination` / `remote` / `ssh-target` 等の正確な語に直すか? ## 破壊的変更案 - **案A: `--host` を `--remote` (または `--ssh-destination`) にリネームし、`--host` は v0.1 のみ deprecated alias として残す。** proto/doc/CLI help の `destination` と統一。`--ssh-arg` も合わせて `--ssh-opt` / `--ssh-arg` のどちらに寄せるかを決める。 - **案B: 現行維持。** `--host` は短く覚えやすく、`scp`/`ssh` の慣用に合わせたという rationale を `control-surfaces.md` に追記して凍結。 ## 判定基準 - `felis --help` / `felis ssh --help` / `felis window retarget --help` を並べて読んだとき、三つの carrier 指定(`--host`/`--to-socket`/default)が同一語彙で説明できること。 - `reference/cli.md` / `reference/ipc.md` / `proto` / `crates/.../messages.rs` の命名が一致していること(現状 `host` vs `destination` の乖離を解消)。 - 既存の `~/.ssh/config` ユーザが `--host myalias` を直感で打てること(`--remote` でもこれは満たす)。 ## 対象ファイル - `crates/felis-cli/src/main.rs` (`Cli::host`), `crates/felis-client/src/main.rs`, `crates/felis-client-core/src/connector.rs`, `crates/felis-protocol/proto/felis.proto`, `docs/reference/cli.md`, `docs/reference/ipc.md`, `docs/how-to/attach-over-ssh.md` ## 参考 - #3 CLI 動詞・名詞階層レビューでは触れられなかったが、同根の「名前が実装の宛先概念を正確に指しているか」問題。 - 互換性は無視してよい(本レビュー前提)。1.0 で変えるなら `just check` / `just schema` 相当の help/completions/man も同時更新。 cc @natsukium
Author
Owner

Triaged as duplicate of #23. That issue already owns the breaking carrier-language decision (--to-host / --to-socket, removal of felis ssh) and its help, completion, manual, schema, skill, and changelog cascade. Keeping a second implementation issue would split one CLI grammar decision across two acceptance lists.

Triaged as duplicate of #23. That issue already owns the breaking carrier-language decision (`--to-host` / `--to-socket`, removal of `felis ssh`) and its help, completion, manual, schema, skill, and changelog cascade. Keeping a second implementation issue would split one CLI grammar decision across two acceptance lists.
Sign in to join this conversation.
No description provided.