it2 variable get

Get value of a variable

Synopsis

it2 variable get <scope> <name> [<session-id>] [flags]

Description

Get the value of a variable from a specific scope.

Scopes:
app - Application-wide variables
session - Session-specific variables (requires session-id)
tab - Tab-specific variables (requires tab-id)
window - Window-specific variables (requires window-id)

Examples

# Get app-level variable
$ it2 variable get app user.my_var
# Get session variable
$ it2 variable get session user.session_var abc123
# Get current session variable
$ it2 variable get session user.status $ITERM_SESSION_ID
# Get with JSON output
$ it2 variable get --format json app user.config
# Get tab variable
$ it2 variable get tab user.tab_var tab-123
# Get window variable
$ it2 variable get window user.window_var window-123

Options

-f, --format (default "text")
Output format (text, json, yaml)

Options inherited from parent commands

--timeout

Timeout for API operations - how long to wait for iTerm2 to respond

--url

WebSocket URL for iTerm2 API - typically ws://localhost:1912 for local iTerm2

See Also