DevStackBoxDevStackBox

Tauri Commands

Backend command reference for DevStackBox.

On this page

Single source of truth for all backend IPC commands. Every command registered in src-tauri/src/lib.rs (generate_handler!) is documented here. Every command name used in the frontend must match exactly what is listed here.

Rule: Before writing safeInvoke("some_command") anywhere in the frontend, check this file first. If the command is not listed here, it does not exist in the backend.


How to Use This Reference

  1. Find the command you need in the table below.
  2. Check its parameters and return type.
  3. Use the exact command name string from the "Command Name" column.
  4. If it is not already in src/lib/commands.ts:TAURI_COMMANDS, add it there.
  5. Call it via safeInvoke<ReturnType>(TAURI_COMMANDS.group.commandName, { params }).

Frontend Constants File

All command name strings are centralized in src/lib/commands.ts in the TAURI_COMMANDS constant. Do not use hardcoded command name strings in component files.

Pattern:

const result = await safeInvoke<ReturnType>(
  TAURI_COMMANDS.group.commandName,
  { paramName: value },
);

Command Reference

System Commands

Command NameSource FileParametersReturnsNotes
check_binariescommands/system.rsnoneHashMap<String, bool>Keys: mysql, apache, php
debug_pathscommands/system.rsnoneHashMap<String, String>Debug only
debug_installationcommands/system.rsnoneHashMap<String, String>Debug only
start_all_servicescommands/system.rsnoneString (summary)
stop_all_servicescommands/system.rsnoneString (summary)
create_directory_structurecommands/system.rsnoneString
get_system_infocommands/system.rsnoneSystemInfoOS, versions, paths
get_autostartcommands/system.rsnoneboolLaunch-on-login state
set_autostartcommands/system.rsenabled: boolString

Tray / Window Commands

Command NameSource FileParametersReturnsNotes
show_main_windowcommands/tray.rsnone()
hide_to_traycommands/tray.rsnone()
set_tray_tooltipcommands/tray.rstooltip: String()Called on every status poll
quit_appcommands/tray.rsnone()

MySQL Commands

Command NameSource FileParametersReturnsNotes
start_mysqlcommands/mysql.rsnonebool
stop_mysqlcommands/mysql.rsnonebool
get_mysql_statuscommands/mysql.rsnoneServiceInfo
toggle_mysqlcommands/mysql.rsnonebool (new running state)
test_mysql_configcommands/mysql.rsnoneString
backup_mysql_databasecommands/mysql.rsnoneString (path)Dumps all databases
backup_mysql_database_namedcommands/mysql.rsdatabase: StringString (path)
list_mysql_databasescommands/mysql.rsnoneString[]
list_mysql_databases_detailedcommands/mysql.rsnoneDatabaseInfo[]name + table count + size
pick_sql_restore_filecommands/mysql_import.rsnoneString | nullNative file picker for .sql
get_sql_restore_file_infocommands/mysql_import.rspath: StringSqlRestoreFileInfoSize + sniff hint for restore mode
restore_mysql_from_filecommands/mysql_import.rsfile_path, restore_mode, initial_database?, create_databaseStringStreams file to mysql stdin
apply_php_recommended_import_limitscommands/mysql_import.rsnoneStringSets recommended php.ini import limits
list_mysql_userscommands/mysql.rsnoneMySqlUser[]
create_mysql_usercommands/mysql.rsusername: String, password: String, host: StringString
drop_mysql_usercommands/mysql.rsusername: String, host: StringString
set_mysql_user_passwordcommands/mysql.rsusername: String, host: String, password: StringString

Migration Commands

Command NameSource FileParametersReturnsNotes
detect_xampp_installationscommands/migration.rsnoneXamppDetection[]Scans default XAMPP paths
import_from_xamppcommands/migration.rsxampp_root: String, copy_htdocs: boolXamppImportResultCopies htdocs into www

Apache Commands

Command NameSource FileParametersReturnsNotes
start_apachecommands/apache.rsnonebool
stop_apachecommands/apache.rsnonebool
get_apache_statuscommands/apache.rsnoneServiceInfo
toggle_apachecommands/apache.rsnonebool
test_apache_configcommands/apache.rsnoneStringRuns httpd -t

PHP Commands

Command NameSource FileParametersReturnsNotes
get_php_statuscommands/php.rsnoneServiceInfo
toggle_phpcommands/php.rsnoneboolCurrently a stub
get_php_versionscommands/php.rsnonePHPVersionInfo[]
switch_php_versioncommands/php.rsversion: StringboolCreates php/current junction via cmd
download_php_versioncommands/php.rsversion: StringboolStreams from windows.php.net; emits php-download-progress events
list_php_extensionscommands/php.rsversion: StringPHPExtension[]
toggle_php_extensioncommands/php.rsversion: String, extension: String, enabled: boolString
open_php_terminalcommands/php.rsversion: StringStringOpens Windows Terminal with PHP in PATH

Log Commands

Command NameSource FileParametersReturnsNotes
get_service_logscommands/logs.rsservice: StringString (log content)Last N lines of log file
log_crash_eventcommands/logs.rsservice: String, message: StringString

Config Commands

Command NameSource FileParametersReturnsNotes
read_configcommands/config.rsservice: StringString (file content)
update_configcommands/config.rsservice: String, content: StringString
backup_configcommands/config.rsservice: StringString (backup path)
list_config_backupscommands/config.rsservice: StringString[]
restore_config_backupcommands/config.rsservice: String, backup_name: StringString

Terminal Commands

Command NameSource FileParametersReturnsNotes
spawn_terminalcommands/terminal.rsid: String, command: String, args: String[]StringStarts PTY session
send_terminal_inputcommands/terminal.rsid: String, input: StringString
kill_terminal_sessioncommands/terminal.rsid: StringString

Security Commands

Command NameSource FileParametersReturnsNotes
analyze_securitycommands/security.rsnoneSecurityReportChecks config and file permissions

SSL Commands

CommandSourceParametersResultNotes
get_ssl_statuscommands/ssl.rsnoneSslStatusLocal trust and HTTPS status
generate_ssl_certcommands/ssl.rsnoneStringProvision with mkcert
enable_sslcommands/ssl.rsport: Option<u16>StringProvision and enable local HTTPS
trust_ssl_cacommands/ssl.rsnoneStringRequest local CA trust; Windows approval may be needed
disable_sslcommands/ssl.rsnoneStringDisable HTTPS

Virtual Host and Project Commands

Parameters below use Rust names; Tauri callers use camelCase. Failed commands return an error string.

CommandSourceParametersResult
list_vhostscommands/vhosts.rsnoneVhostEntry[]
add_vhostcommands/vhosts.rsdomain, doc_root; optional https, aliases, project_root, previous_domainunit
set_project_php_versioncommands/vhosts.rsproject_id, optional version (null inherits default)unit
remove_vhostcommands/vhosts.rsdomainunit; keeps website files
toggle_vhostcommands/vhosts.rsdomain, enabledunit
get_hosts_entriescommands/vhosts.rsnoneString[]
update_hosts_entrycommands/vhosts.rsdomain, actionString; may require elevation
get_project_diagnosticscommands/projects.rsproject_idProjectDiagnostics
get_site_configuration_warningscommands/projects.rsnoneString[]
suggest_document_rootcommands/projects.rspathString
choose_project_foldercommands/projects.rsnoneoptional String
create_project_foldercommands/projects.rsnameString

See Projects, PHP & HTTPS for the user workflow and current limitations.

Full Backup Commands

Command NameSource FileParametersReturnsNotes
create_full_backupcommands/fullbackup.rstimestamp: StringFullBackupResultIncludes config/, www/, MySQL dump when running
list_full_backupscommands/fullbackup.rsnoneBackupEntry[]Sorted newest-first
restore_full_backupcommands/fullbackup.rspath: StringStringBounded archive preflight, recovery ZIP, server-idle check; partial SQL is possible
delete_full_backupcommands/fullbackup.rspath: String()Validates path is inside backups/full/
cancel_full_backupcommands/fullbackup.rsnone()Best-effort cancellation; committed SQL is not rolled back
list_restore_recovery_recordscommands/fullbackup.rsnoneString[]Read-only retained journal names; never replays SQL or deletes a record
open_backups_foldercommands/fullbackup.rsnoneStringOpens Explorer at backups dir

install_app_update (commands/app_update.rs) accepts the update resource rid and progress onEvent channel. It owns the existing database operation lock through installer handoff/restart and requires services to be stopped. Direct frontend updater installation/process-relaunch permissions are disabled; update checks remain available. Windows clients require Windows 10 or newer for atomic Job Object assignment, and fail closed if containment cannot be established.


Shared Rust Types

These structs are serialized to JSON. TypeScript equivalents are in src/types/.

ServiceInfo (Rust) = ServiceStatus (TypeScript)

#[derive(serde::Serialize)]
struct ServiceInfo {
    running: bool,
    pid: Option<u32>,
    port: Option<u16>,
    version: Option<String>,
}

PHPVersionInfo (Rust) = PHPVersion (TypeScript)

#[derive(serde::Serialize)]
struct PHPVersionInfo {
    version: String,
    status: String,       // "installed" | "available" | "downloading"
    path: String,
    is_active: bool,
    installed: bool,
    download_url: String,
}

Valid service Parameter Values

Many commands accept a service: String parameter. Valid values:

ValueMaps to Config FileNotes
"mysql"%LOCALAPPDATA%\DevStackBox\config\my.cnf
"apache" or "httpd"%LOCALAPPDATA%\DevStackBox\config\httpd.confBoth accepted
"php"%LOCALAPPDATA%\DevStackBox\config\php.ini
"phpmyadmin"%LOCALAPPDATA%\DevStackBox\config\phpmyadmin.conf

Full generate_handler! Registration (lib.rs)

tauri::generate_handler![
    check_binaries,
    debug_paths,
    debug_installation,
    start_all_services,
    stop_all_services,
    test_apache_config,
    test_mysql_config,
    get_mysql_status,
    get_php_status,
    get_apache_status,
    start_mysql,
    stop_mysql,
    start_apache,
    stop_apache,
    get_php_versions,
    switch_php_version,
    download_php_version,
    list_php_extensions,
    toggle_php_extension,
    toggle_mysql,
    toggle_php,
    toggle_apache,
    backup_mysql_database,
    backup_mysql_database_named,
    list_mysql_databases,
    list_mysql_databases_detailed,
    pick_sql_restore_file,
    get_sql_restore_file_info,
    restore_mysql_from_file,
    apply_php_recommended_import_limits,
    list_mysql_users,
    create_mysql_user,
    drop_mysql_user,
    set_mysql_user_password,
    open_php_terminal,
    get_service_logs,
    log_crash_event,
    read_config,
    update_config,
    backup_config,
    list_config_backups,
    restore_config_backup,
    create_directory_structure,
    get_autostart,
    set_autostart,
    get_system_info,
    show_main_window,
    hide_to_tray,
    set_tray_tooltip,
    quit_app,
    spawn_terminal,
    send_terminal_input,
    kill_terminal_session,
    analyze_security,
    get_ssl_status,
    generate_ssl_cert,
    enable_ssl,
    disable_ssl,
    list_vhosts,
    add_vhost,
    remove_vhost,
    toggle_vhost,
    get_hosts_entries,
    update_hosts_entry,
    create_full_backup,
    list_full_backups,
    restore_full_backup,
    delete_full_backup,
    open_backups_folder,
]

Adding a New Command

  1. Add the Rust function in the appropriate commands/ module file:

    #[tauri::command]
    async fn my_new_command(param: String) -> Result<String, String> {
        Ok(format!("result: {}", param))
    }
  2. Register it in run() inside lib.rs under generate_handler!.

  3. Add the constant to src/lib/commands.ts:

    export const TAURI_COMMANDS = {
      someGroup: {
        myNewCommand: "my_new_command",
      },
    };
  4. Call it from the frontend:

    const result = await safeInvoke<string>(
      TAURI_COMMANDS.someGroup.myNewCommand,
      { param: "value" },
    );
  5. Update this document with the new command entry.

Unreleased database workspace commands

These commands are part of the v0.1.19 source contract. They are native IPC commands, not a public remote API or shell commands.

CommandsPurpose
database_details, database_collations, create_database_with_optionsSchema/object metadata and validated creation options
start_database_operation, database_operations, cancel_database_operationNative sequential jobs, bounded history and cancellation
pick_database_files, pick_database_destination, inspect_database_filesNative file selection and risk-review metadata
database_backups, verify_database_backup, delete_database_backupManaged backup records, checksum checks and scoped file deletion
database_grants, set_database_grantsDirect database privilege inspection and explicit additions/removals. The editor supplies the optional expected original grants to reject conflicting changes before applying edits.

Managed diagnostic logs

read_log_chunk reads a bounded increment using a server-returned cursor; clear: true captures the current end without modifying the file. archive_log verifies a GZIP archive before resetting a stopped-writer log. delete_log_contents requires the reviewed cursor and exact filename confirmation. These commands accept logical IDs, not arbitrary paths.

list_log_archives, read_log_archive, export_log_archive, delete_log_archive and open_log_archives manage recognized diagnostic archives. get_log_policy and set_log_policy control opt-in rotation/retention. run_log_maintenance applies the saved policy and reports deferred or failed operations. These commands never handle MySQL binary/relay/redo/undo logs.

Operations use DevStackBox's verified local MySQL connection. A selected initial database is not confinement for arbitrary imported SQL. Cancellation does not reverse SQL already applied. The grants editor refuses partial-revoke mode rather than changing global restrictions, and escapes database wildcard characters for ordinary database grants.