What problem are you trying to solve?
Adding a host entry today is done via the root command with the --add <alias> flag plus a positional user@host[:port] target (e.g. skipper --add bastion ubuntu@10.0.0.1:22). This conflates two surfaces on the same command: the default root behavior (open the TUI and connect) and a one-shot write operation. It is awkward to discover from --help, harder to grow (future options like -i/identity-file, comments, overwrite semantics), and inconsistent with the mental model users have from tools like git or gh where write operations live under their own verb.
Proposed solution
Introduce a dedicated add subcommand that replaces --add entirely:
skipper add <alias> <user@host[:port]> [flags]
<alias> and <user@host[:port]> are required positionals.
- Reuses existing
connect.ParseTarget + sshconfig.AddHost plumbing.
- Respects the existing
-c, --config persistent flag for target config path.
- Prints the same "added host …" confirmation line as today.
- Remove the
-a, --add root flag and its handling in cmd/root.go (runRoot's Changed("add") branch, the addAlias var, the addHost helper's tie-in).
- Update README flag table and any help text/examples.
Alternatives considered
- Keep
--add and also add a subcommand (deprecation alias). Rejected: the project is pre-1.0 and adding both doubles the surface and docs.
- Fold into an interactive "add" flow from the TUI. Out of scope for this issue — that can be a follow-up on top of the subcommand.
Additional context
- Existing implementation:
cmd/root.go (addHost, addAlias, flag registration in init), internal/sshconfig/writer.go (AddHost).
- Tests: add coverage for the new
add subcommand (happy path + missing alias + malformed target) and drop tests tied to the removed flag.
- Breaking change for users of
--add; call it out in the PR description and README.
What problem are you trying to solve?
Adding a host entry today is done via the root command with the
--add <alias>flag plus a positionaluser@host[:port]target (e.g.skipper --add bastion ubuntu@10.0.0.1:22). This conflates two surfaces on the same command: the default root behavior (open the TUI and connect) and a one-shot write operation. It is awkward to discover from--help, harder to grow (future options like-i/identity-file, comments, overwrite semantics), and inconsistent with the mental model users have from tools likegitorghwhere write operations live under their own verb.Proposed solution
Introduce a dedicated
addsubcommand that replaces--addentirely:<alias>and<user@host[:port]>are required positionals.connect.ParseTarget+sshconfig.AddHostplumbing.-c, --configpersistent flag for target config path.-a, --addroot flag and its handling incmd/root.go(runRoot'sChanged("add")branch, theaddAliasvar, theaddHosthelper's tie-in).Alternatives considered
--addand also add a subcommand (deprecation alias). Rejected: the project is pre-1.0 and adding both doubles the surface and docs.Additional context
cmd/root.go(addHost,addAlias, flag registration ininit),internal/sshconfig/writer.go(AddHost).addsubcommand (happy path + missing alias + malformed target) and drop tests tied to the removed flag.--add; call it out in the PR description and README.