Command Modules
Commands are organized into the following modules:system- System-level operations requiring elevated privilegesshell- Shell and terminal operationsregistry- Container registry managementutils- Utility functions for container commandsimages- Container image operations
System Commands
executeWithElevatedCommand
Execute a system command with elevated privileges (sudo).The command to execute (e.g., “container”, “rm”)
Array of command arguments
Example Usage
Behavior
- Automatically detects if the app is already running with elevated privileges
- On macOS, prompts for password using the system authentication dialog
- Sets the app name to “ContainerKit” in the elevation prompt
- Includes the app icon in the authentication dialog
Shell Commands
getDefaultShell
Get the default shell path for the current user.The path to the default shell (e.g., “/bin/zsh”, “/bin/bash”)
Example Usage
Behavior
- Reads the
SHELLenvironment variable - Falls back to
/bin/zshif the variable is not set (macOS default)
Registry Commands
runContainerCommandWithStdin
Execute a container command with standard input (useful for password input).Command arguments to pass to the container CLI
Input to write to the command’s standard input
Example Usage
Behavior
- Spawns the
containerCLI command - Writes the
stdinstring to the process’s standard input - Waits for the command to complete
- Flushes stdin before waiting for output
Utility Commands
streamContainerCommand
Stream output from a long-running container command (experimental).Command arguments for the container CLI
Base name for emitted events (will be suffixed with -stdout, -stderr, etc.)
Example Usage
This command is experimental and currently under development. Event emission is not fully implemented.
Type Definitions
CommandResult
The result structure returned by command execution functions.The signal that terminated the process (Unix only).
None if the process exited normally.Complete standard output from the command
Complete standard error output from the command
Exit code from the process.
None if the process was terminated by a signal. Code 0 indicates success.Frontend Bindings
All Tauri commands are automatically exposed to TypeScript via thetauri-specta code generation system.
- Full TypeScript type safety
- Automatic serialization/deserialization
- Promise-based async API
- Result type wrapping (Ok/Err pattern)
Error Handling
All commands return aResult type that must be handled: