Skip to content

CLI Reference

Andrew Paolucci edited this page Nov 26, 2026 · 2 revisions

CLI Reference (sys2rust)


1. Global Flags & Policy Controls

-y, --allow-mutating             Allow mutating ActionCommands (required with --confirm-destructive)
    --confirm-destructive        Explicit destructive confirmation required by MCP/action policy gates
    --dry-run                    Preview mutating actions without modifying system state
    --format <FORMAT>            csv, tsv, json, jsonl, html, html-vertical, markdown (md) [default: markdown]
    --export <EXPORT>            Write table output to file and compute custody hashes
    --custody <CUSTODY>          Write SHA-256/SHA-512 Merkle CustodyManifest JSON to path
    --filter <FILTER>            Tabular filter expression (e.g. "name ~ svchost" or "pid > 100")
    --sort <SORT>                Sort column specification (e.g. "pid:desc" or "~working_set_bytes")
    --limit <LIMIT>              Maximum rows to display/export
    --offline                    Use offline synthetic backends
    --offline-dir <OFFLINE_DIR>  Optional offline synthetic fixture directory
    --pid <PID>                  Filter live process tools by PID
-v, --verbose                    Verbose stderr logging

2. Subcommands

  • proc (13): threads, dlls, handles, open-files, activity, heap, gdi, hang, debug, list, mem, env, etw-life
  • hw (10): services, drivers, devices, tasks, wmi, firmware, battery, codecs, timezones, special-folders
  • shell (19): startup, uninstall, msi, appx, legacy-uninst, shellex, menu, menu-new, filetypes, openwith, com, url-proto, appcompat, mui-ver, ext-view, env-vars, desktop-icons, taskmgr-ext, privacy-audit
  • pe (6): exports, resources, icons, dotnet, info, gac
  • mcp: Run or inspect the JSON-RPC 2.0 (2024-11-05) stdio MCP server (mcp --tools)
  • gui: Launch the desktop GUI (sys2rust-win32 native by default, or --iced)
  • action: Execute a registered ActionCommand under policy gates
  • list: List all 48 tools across proc, hw, shell, and pe
  • diag: Print host elevation, privilege, and ETW availability diagnostics

3. Examples

# Inspect DLL exports & .NET resources in pure Rust offline
sys2rust --offline pe exports --format json
sys2rust --offline pe dotnet --format table

# List running processes filtered by name and sorted descending
sys2rust proc list --filter "name ~ svchost" --sort "pid:desc" --limit 20

# Safe dry-run preview of a mutating ActionCommand
sys2rust --dry-run action proc_terminate

Clone this wiki locally