Skip to content

fix(cli): dynamic version from package.json + ForwardAgent in add wizard#54

Merged
bvisible merged 1 commit into
mainfrom
fix/cli-version-and-forward-agent-wizard
Jul 13, 2026
Merged

fix(cli): dynamic version from package.json + ForwardAgent in add wizard#54
bvisible merged 1 commit into
mainfrom
fix/cli-version-and-forward-agent-wizard

Conversation

@bvisible

Copy link
Copy Markdown
Owner

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 from package.json (using sed only — no jq dependency), resolving both:

  • in-repo: cli/../package.json
  • installed copy: package.json, which install.sh now bundles next to the CLI

Falls back to unknown if no package.json is found. Verified live: ssh-manager --version now reports v3.7.0 in both layouts.

2. SSH agent forwarding in the "Add server" wizard

Wires the per-server ForwardAgent option (added in #53 / #52) into the interactive Add server flow — a Step-4 opt-in prompt with the security warning that writes SSH_SERVER_<NAME>_FORWARD_AGENT=true. It can now be enabled from the menu instead of only by hand-editing .env.

Verification

  • ssh-manager --versionv3.7.0 (in-repo and simulated installed layout with bundled package.json); unknown fallback when absent.
  • Drove wizard_add_server end-to-end against an isolated .env (password auth, forwarding = yes) and confirmed it writes SSH_SERVER_TESTFA_FORWARD_AGENT=true, which the loader reads back as forwardAgent: true.
  • bash -n clean 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, security mode, 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.

…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.
@bvisible
bvisible merged commit 21f3c75 into main Jul 13, 2026
5 checks passed
@bvisible
bvisible deleted the fix/cli-version-and-forward-agent-wizard branch July 13, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant