Tauri Commands
ZeroLimit exposes Rust backend functionality to the frontend through Tauri commands. All commands are invoked from the frontend using Tauri’sinvoke() function.
CLI Proxy Management
start_cli_proxy
Starts the CLI Proxy server process.Absolute path to the CLI Proxy executable
Process ID of the started CLI Proxy server
src-tauri/src/commands/cli_proxy.rs:18
stop_cli_proxy
Stops the running CLI Proxy server process.Returns nothing on success
src-tauri/src/commands/cli_proxy.rs:64
Details
- On Windows: Uses
taskkill /F /Tfor reliable termination - On Unix: Uses process
kill()followed by fallbackpkillif needed - Cleans up both process ID and process name tracking
is_cli_proxy_running
Checks if the CLI Proxy server is currently running.true if CLI Proxy is running, false otherwisesrc-tauri/src/commands/cli_proxy.rs:121
Download & Installation
download_and_extract_proxy
Downloads a CLI Proxy archive (ZIP or TAR.GZ) and extracts it to the target directory.Download URL for the proxy archive (.zip, .tar.gz, or .tgz)
Target extraction directory. If
null, defaults to ~/.zerolimit/cli_proxyAbsolute path to the extracted CLI Proxy executable
src-tauri/src/commands/download.rs:47
Behavior
- Removes old proxy executables while preserving config files (
.yaml,.yml,.json,.toml,.env) - Automatically renames
config.example.yamltoconfig.yamlif it doesn’t exist - Sets executable permissions on Unix systems (0755)
- Supports both ZIP and TAR.GZ archives
- Recursively searches for the executable if not found in root directory
find_alternate_proxy_exe
Finds an alternate CLI Proxy executable in the same directory (e.g., switching between standard and plus versions).Path to the currently installed proxy executable
Target version type:
"plus" or any other string (for standard version)Path to the alternate executable, or
null if not foundsrc-tauri/src/commands/download.rs:10
Version Management
check_proxy_version
Checks the current and latest available versions of CLI Proxy.Base URL of the CLI Proxy API (e.g.,
http://localhost:25100)Management API authentication key
Currently running proxy version from
x-cpa-version or x-server-version headerBuild date from
x-cpa-build-date or x-server-build-date headerLatest available version from the
/v0/management/latest-version endpointsrc-tauri/src/commands/version.rs:15
Utility Commands
open_external_url
Opens a URL in the system default browser.URL to open in the browser
Returns nothing on success
src-tauri/src/commands/utils.rs:10
set_run_in_background
Configures whether the application should minimize to system tray instead of closing.true to run in background, false to quit on window closeReturns nothing on success
src-tauri/src/commands/utils.rs:16
Error Handling
All commands return aResult<T, CommandError> in Rust. Errors are serialized and thrown as JavaScript exceptions.
Common error types:
CommandError::General(String)- Generic error with message- Network errors from
reqwest - File system errors from
std::fs - Process spawn errors