fix(cli): dynamic version from package.json + ForwardAgent in add wizard#54
Merged
Merged
Conversation
…add wizard The interactive `ssh-manager` banner was frozen at a hardcoded VERSION="3.1.0" that the release process never bumped, so it drifted far behind the package version. Derive it from package.json instead (sed only, no jq), resolving both the in-repo layout (cli/../package.json) and the installed layout — install.sh now bundles package.json next to the CLI. Falls back to "unknown" if absent. Also wire the new per-server SSH agent forwarding (#52) into the interactive "Add server" wizard: a Step-4 opt-in prompt with the security warning that writes SSH_SERVER_<NAME>_FORWARD_AGENT=true, so it can be enabled from the menu instead of only by hand-editing .env. Note: the interactive "Edit server" wizard rewrites entries via update_server_in_env, which does not preserve advanced fields (forwardAgent, mode, sudo, proxyJump, audit) — a pre-existing limitation left for a follow-up.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two CLI improvements to the interactive
ssh-manager(bash CLI):1. Version no longer hardcoded
The interactive menu banner was stuck at
VERSION="3.1.0"— a hardcoded literal the release process never bumped, so it drifted far behind the real package version (now 3.7.0). It's now derived frompackage.json(usingsedonly — nojqdependency), resolving both:cli/../package.jsonpackage.json, whichinstall.shnow bundles next to the CLIFalls back to
unknownif nopackage.jsonis found. Verified live:ssh-manager --versionnow reportsv3.7.0in both layouts.2. SSH agent forwarding in the "Add server" wizard
Wires the per-server
ForwardAgentoption (added in #53 / #52) into the interactive Add server flow — a Step-4 opt-in prompt with the security warning that writesSSH_SERVER_<NAME>_FORWARD_AGENT=true. It can now be enabled from the menu instead of only by hand-editing.env.Verification
ssh-manager --version→v3.7.0(in-repo and simulated installed layout with bundledpackage.json);unknownfallback when absent.wizard_add_serverend-to-end against an isolated.env(password auth, forwarding = yes) and confirmed it writesSSH_SERVER_TESTFA_FORWARD_AGENT=true, which the loader reads back asforwardAgent: true.bash -nclean on all three touched scripts.Known limitation (not addressed here)
The interactive Edit server wizard rewrites entries via
update_server_in_env, which does not preserve advanced fields (forwardAgent, securitymode, sudo password,proxyJump,audit_log) — a pre-existing lossy-edit bug affecting all of them, left for a dedicated follow-up.Note for users
The bash CLI is installed as a copy (via
cli/install.sh), so existing local installs must be reinstalled to pick up these changes.