Skip to content

[feature] Non-interactive command to list SSH config entries #8

@JerryAgbesi

Description

@JerryAgbesi

What problem are you trying to solve?
Today the only way to see which hosts Skipper knows about is to launch the TUI. That is great for selecting and connecting, but a pain when you just want to:

  • Quickly sanity-check that a host you just added is actually in the file.
  • Pipe the list into another tool (grep, fzf, shell scripts, CI).
  • See hosts without spinning up the full-screen UI (e.g. over a flaky ssh session, in a non-TTY context).

Proposed solution
Add a list (alias ls) subcommand that reads the same config path as the TUI and prints the parsed host entries:

skipper list [flags]
skipper ls

Default output: a tab-aligned table with columns ALIAS, USER, HOSTNAME, PORT, IDENTITY — matching the fields on sshconfig.Host. Respects the existing -c, --config flag so alternate config files work the same way they do for the TUI.

Exit codes:

  • 0 with no output when the config parses cleanly but contains no hosts (matches shell conventions).
  • Non-zero when the config file is missing or unparsable, using the existing error plumbing in sshconfig.ParseHosts.

Alternatives considered

  • A -l/--list flag on the root command. Rejected for the same reason as [feature] Replace --add flag with an add subcommand #7 — read and write operations deserve their own verbs rather than piling flags on the root.
  • Only support the TUI view and document that users should cat ~/.ssh/config. Rejected: Skipper already parses and normalizes the config (including multi-pattern Host blocks), so it can show a strictly better view than raw cat.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions