feat(ssh): add --instance option to target a running instance by ID - #1123
Open
mehdi653 wants to merge 1 commit into
Open
feat(ssh): add --instance option to target a running instance by ID#1123mehdi653 wants to merge 1 commit into
mehdi653 wants to merge 1 commit into
Conversation
When several instances are running, clever ssh currently requires an interactive prompt (and fails in non-interactive mode). Accept --instance <instance-id> to select the target directly, as requested in CleverCloud#1067. Instance IDs are used rather than instance numbers, which are not stable across deployments. Fixes CleverCloud#1067
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
When several instances are running, clever ssh currently requires an interactive prompt and fails in non-interactive mode. This adds --instance instance-id so users and scripts can target a specific running instance without a prompt.
Instance IDs are used rather than instance numbers, which are not stable across deployments (per hsablonniere feedback on #1067). Support for number / any / all selection is left for a follow-up (judu).
Fixes #1067
Change
Spec notes
Test plan
E2E results (2026-08-13)
Tested against a real Clever Cloud Node app with the local CLI from this PR checkout (HOME/.local/bin clever, which exposes --instance).
App: ssh-instance-e2e-1123 (app_99596987-df36-4925-8bab-26f50b2e1ba5), scaled to 2 instances, dedicated ed25519 key registered on the account.
-> OK, exit 0, no prompt
-> clear error: Instance bogus is not a running instance of this application, exit 1
-> OK, exit 0
-> clear error: Multiple instances are running. Cannot select in non-interactive mode., exit 1
Also: validate passed on 5898785 (lint, prettier, typecheck, docs:check). Working tree clean; no docs rewrite and no force-push needed.
Test app and temporary SSH key were deleted after the run.