Commit Graph

6 Commits (cc83802244ea1a73781fcae245488494936b0596)

Author SHA1 Message Date
mirivlad cc83802244 fix: register the forward add local-port flag
`sshkeeper forward add` could never succeed. RunE read --local-port and init()
marked it required, but the flag was never registered on forwardAddCmd. Cobra
ignores MarkFlagRequired for an unknown flag, and GetInt returns 0 for one, so
every invocation failed validation with "invalid local port 0: must be
1-65535". There was no argument combination that worked.

Register the flag so both the read and the required annotation bind to a real
option. README and the guide already documented --local-port, so the intent was
there from the start; only the registration was missing.

The existing tests missed this because they build a throwaway cobra.Command,
register the flags on it themselves, and pass it to forwardAddCmd.RunE — the
real command's flag set was never exercised. Add a test that parses argv into
forwardAddCmd's own flags, plus one pinning the required annotation. Both fail
against the unfixed command with "unknown flag: --local-port".

Present since c2edaa4, so v0.2.0 and v0.3.0 both ship it broken.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 18:46:08 +08:00
mirivlad f49a5b5a94 fix: store forward cli metadata 2026-06-06 03:28:21 +08:00
mirivlad 6991eab3c0 fix: complete forwards and search behavior 2026-06-06 03:17:26 +08:00
mirivlad 4726a6874c sshkeeper: redesign port forwarding UX
- Forward model: add Name, Description, Enabled fields
- DB migration 003: add name/description/enabled columns to forwards
- Forward type: radio selector (Local/Remote/SOCKS) instead of free text
- Forward form: dynamic fields based on type, 127.0.0.1 default, 0.0.0.0 warning
- Forward list: table view with NAME/TYPE/LISTEN/TARGET/ENABLED columns
- Forward edit: Enter/Ctrl+E opens edit form
- Human explanation and OpenSSH preview for selected forward
- Tunnel state manager: PID tracking, start/stop, state file
- Tunnel manager screen: list running tunnels, stop, refresh
- Action menu: reworked with Connect/Connect with tunnels/Start tunnels only/Start tunnels in background/Manage port forwards/Manage tunnels/Manage route/Test/Edit/Delete
- Help screen: updated with all shortcuts
- CLI: tunnel --background for detached tunnel process
- Default listen address: 127.0.0.1 instead of 0.0.0.0
- Validation: type required, ports 1-65535, target required for local/remote
2026-06-03 18:15:31 +08:00
mirivlad 77a84a487f sshkeeper: v0.2.0 stabilization (route display, forward validation, tunnel UX, README) 2026-06-03 11:23:02 +08:00
mirivlad c2edaa4224 sshkeeper: v0.2.0 — Phase 4: CLI route/forward/tunnel commands 2026-06-03 10:32:18 +08:00