Skip to Content
CLIAdmin & policycmdop session

cmdop session

cmdop session manages terminal sessions on this machine: it creates them, lists them, records attachment, and destroys them. A session survives the client that created it — that is the point of managing it separately from the shell you are typing in.

cmdop session create cmdop session list cmdop session destroy <session-id>

cmdop session attach records that you are attached to a session and returns its metadata. Driving a session’s terminal interactively from the CLI is not part of this command — for that, use cmdop connect <machine>, which opens an interactive terminal on another machine.

Create a session

cmdop session create cmdop session create --shell /bin/bash --cwd ~/projects/api
FlagPurpose
--shell <path>Shell to run. Defaults to your login shell (/bin/zsh on a typical macOS install).
--cwd <directory>Working directory for the session.

create prints the session ID that every other subcommand takes.

List sessions

cmdop session list

Shows every session with its status and metadata.

Attach and detach

cmdop session attach <session-id> cmdop session detach <session-id>

detach leaves the session running — detaching is not stopping.

Destroy a session

cmdop session destroy <session-id> cmdop session destroy <session-id> --force

destroy terminates the session and removes it. --force skips the confirmation prompt.

Save and restore

cmdop session save cmdop session restore

save persists every active session to disk; restore brings previously saved sessions back. Run save before a planned restart of the machine or the agent.

Last updated on