When executing a plugin binary, DevSpace provides several environment variables containing context about the current execution. These are particularly useful for hooks and custom commands.
DEVSPACE_PLUGIN_EXECUTION_ID: Unique ID for the duration of a command
DEVSPACE_PLUGIN_EVENT: The event that triggered the hook
DEVSPACE_PLUGIN_OS_ARGS: JSON encoded arguments used to call the current command
DEVSPACE_PLUGIN_CONFIG: YAML encoded loaded config (resolved profiles/vars)
DEVSPACE_PLUGIN_COMMAND: Name of the executed command (e.g., 'dev')
DEVSPACE_PLUGIN_COMMAND_LINE: Complete command name (e.g., 'devspace dev [FLAGS]')
DEVSPACE_PLUGIN_COMMAND_FLAGS: JSON encoded flags passed to the command
DEVSPACE_PLUGIN_COMMAND_ARGS: JSON encoded arguments passed to the command (excluding flags)
DEVSPACE_PLUGIN_KUBE_NAMESPACE_FLAG: The target Kubernetes namespace
DEVSPACE_PLUGIN_KUBE_CONTEXT_FLAG: The target Kubernetes context
DEVSPACE_PLUGIN_ERROR: The error that occurred (supplied in 'error' or 'restart' events)