mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
* feat(cli): add orca host rm for saved SSH targets orca host rm --host ssh:<target-id> calls the runtime RPC ssh.removeTarget, the same removeSshTarget the Settings UI reaches, so the tombstone keeps the passive ~/.ssh/config import from adding the alias back. Also document how the import treats Match blocks and Include files. * fix(ssh): clear a removed target's live state and rename in main for every removal path Removing an SSH target through ssh.removeTarget (orca host rm, paired clients) left open tabs with stale reconnect state and kept the host's rename, because only the Settings dialogs cleaned up after their own IPC call. The shared removal mutation now drops the display-label override and tells the renderer, which clears the target's state once for all callers. Fixes #37949 * fix(ssh): clean up after a removed target in the teardown every removal ends in A recipe VM's cleanup removes its SSH target through removeRegisteredSshTarget directly, so the window kept that target's live state. The broadcast and the rename drop now run there, after the target is gone. Fixes #37949 * test(cli): keep host rm's retarget-flag refusal next to its other cases Its old file was removed on main. Fixes #37949 * refactor(cli): give the host, managed-server and VM handler groups their own module Keeps the handler manifest under the file-length limit. Fixes #37949 --------- Co-authored-by: Florin Timbuc <florin@sowild.design>
79 lines
4.6 KiB
TypeScript
79 lines
4.6 KiB
TypeScript
import type { CommandSpec } from '../args'
|
|
import { GLOBAL_FLAGS, LOCAL_COMMAND_FLAGS } from '../args'
|
|
|
|
export const ENVIRONMENT_COMMAND_SPECS: CommandSpec[] = [
|
|
{
|
|
path: ['host', 'name'],
|
|
summary: 'Show or set the name this Orca runtime reports to connected clients',
|
|
usage: 'orca host name [--name <name>] [--json]',
|
|
allowedFlags: [...GLOBAL_FLAGS, 'name'],
|
|
notes: [
|
|
'With --name, updates the answering runtime over its authenticated connection. Use an empty value to return to the detected computer name.',
|
|
'Without --name, prints the name and platform the answering runtime reports.'
|
|
],
|
|
examples: ['orca host name', 'orca host name --name build-server']
|
|
},
|
|
{
|
|
path: ['host', 'list'],
|
|
summary: 'List every machine this Orca host can target, and how to name each one',
|
|
usage: 'orca host list [--json]',
|
|
allowedFlags: [...LOCAL_COMMAND_FLAGS],
|
|
notes: [
|
|
'Answers "what can I target and what do I pass" in one place: this machine, the SSH targets registered on it, and the Orca servers paired with it.',
|
|
'The three kinds are reached differently. A paired Orca server is a connection, selected with --environment <name>. An SSH target is a machine the connected Orca host reaches, selected with --host ssh:<id>. Passing one where the other belongs is the most common way to get an empty or missing-host answer.',
|
|
'Commands that take --host also accept any name this list prints, such as --host "this machine" or --host <ssh-target-name> (except `orca host rm`, which takes only the ssh:<target-id> form). A name two hosts share is refused with the exact flag for each.',
|
|
'SSH rows include the detected remote platform after that target has connected (linux, darwin, or win32); disconnected or older targets report platform unknown.',
|
|
'SSH rows also include whether the target is currently connected and its lifecycle status when known.',
|
|
'Paired-server rows come from the pairing store and report platform unknown; ask one server directly with `orca host name --environment <name>`.',
|
|
"SSH targets are read from this machine's own Orca runtime, so this lists that machine's targets and not another server's. Run `orca host list` on the other machine to see the targets registered there.",
|
|
'--environment and --pairing-code are rejected rather than ignored: paired servers come from this machine\u2019s pairing store, so a routed answer would describe two machines at once.'
|
|
],
|
|
examples: ['orca host list', 'orca host list --json']
|
|
},
|
|
{
|
|
path: ['host', 'rm'],
|
|
destructive: true,
|
|
summary: 'Remove one saved SSH target from this Orca host',
|
|
usage: 'orca host rm --host ssh:<target-id> [--json]',
|
|
allowedFlags: [...LOCAL_COMMAND_FLAGS, 'host'],
|
|
notes: [
|
|
'Removes the target the same way Settings does: its connection closes, and the passive ~/.ssh/config import does not add the alias back. Restore removed hosts in Settings brings it back.',
|
|
'Takes only the --host ssh:<target-id> form that `orca host list` prints. This machine and paired Orca servers are refused; remove a paired server with `orca environment rm`.',
|
|
'--environment and --pairing-code are rejected rather than ignored: SSH targets are removed from this machine\u2019s own Orca runtime.'
|
|
],
|
|
examples: [
|
|
'orca host rm --host ssh:ssh-1783599077486-fyasux',
|
|
'orca host rm --host ssh:ssh-1783599077486-fyasux --json'
|
|
]
|
|
},
|
|
{
|
|
path: ['environment', 'add'],
|
|
summary: 'Save a remote Orca runtime environment from a pairing code',
|
|
usage: 'orca environment add --name <name> --pairing-code <code> [--json]',
|
|
allowedFlags: [...LOCAL_COMMAND_FLAGS, 'pairing-code', 'name'],
|
|
examples: ['orca environment add --name work-laptop --pairing-code orca://pair?code=...']
|
|
},
|
|
{
|
|
path: ['environment', 'list'],
|
|
summary: 'List saved Orca runtime environments',
|
|
usage: 'orca environment list [--json]',
|
|
allowedFlags: [...LOCAL_COMMAND_FLAGS],
|
|
notes: [
|
|
'Answers from this machine\u2019s pairing store. --environment and --pairing-code are rejected rather than ignored, because there is no other host that could answer.'
|
|
]
|
|
},
|
|
{
|
|
path: ['environment', 'show'],
|
|
summary: 'Show one saved Orca runtime environment',
|
|
usage: 'orca environment show --environment <selector> [--json]',
|
|
allowedFlags: [...LOCAL_COMMAND_FLAGS, 'environment']
|
|
},
|
|
{
|
|
path: ['environment', 'rm'],
|
|
destructive: true,
|
|
summary: 'Remove one saved Orca runtime environment',
|
|
usage: 'orca environment rm --environment <selector> [--json]',
|
|
allowedFlags: [...LOCAL_COMMAND_FLAGS, 'environment']
|
|
}
|
|
]
|