alpacon work-session update
Update fields of an existing work session.
Only the flags you pass are changed; the rest are left untouched. Which fields the server accepts depends on the session status (e.g. --starts-at/--expires-at on a pending session; --sudo on an approved/active one). The CLI sends what you provide and surfaces the server’s validation error if a field isn’t editable for the current status (--sudo is also validated locally before the request).
--scope and --server replace the whole list (not append). --sudo adds MFA-bypass sudo command patterns to the session’s existing policies; this is the recovery path when an exec sudo was denied. The additions may require approval before they take effect.
If SESSION_ID is omitted, the effective work session is resolved from the ALPACON_WORK_SESSION environment variable, then the workspace’s active session (set via alpacon work-session use).
alpacon work-session update [SESSION_ID] [flags]
Options
--description string New session description (markdown supported)
--expires-at string New absolute expiry time (RFC3339; pending sessions only; use 'extend' for approved/active sessions)
-h, --help help for update
--scope strings Replace the session scopes. Valid: command, editor, sudo, tunnel, webftp, websh (repeatable; comma-separated values also accepted; replaces the whole list)
--server strings Replace the target servers by name (repeatable; comma-separated values also accepted; replaces the whole list)
--starts-at string New scheduled start time (RFC3339; pending sessions only)
--sudo stringArray Sudo command patterns to add as MFA-bypass policies (repeatable; each value is a comma-separated pattern list forming one policy, wildcards allowed)
--sudo-reason string Justification applied to the sudo policies added via --sudo
--title string New session title
Examples
Update the title and description:
alpacon work-session update ses-abc123 --title "deploy v2" --description "rollout"
Replace the target servers:
alpacon work-session update ses-abc123 --server web-01,db-01
Replace the scopes:
alpacon work-session update ses-abc123 --scope command,websh
Reschedule a pending session:
alpacon work-session update ses-abc123 --starts-at 2027-01-15T10:00:00Z --expires-at 2027-01-15T12:00:00Z
Add a sudo command pattern to a specific session:
alpacon work-session update ses-abc123 --sudo "systemctl restart nginx"
Add a pattern to the current effective session:
alpacon work-session update --sudo "tail -f /var/log/nginx/*.log"