Public Welfare · Free · Forever Free

SamCommand

Turn any machine into a remotely controllable command-execution agent. One-line install, public URL access, cross-platform: Linux / macOS / Windows / Android.

Why SamCommand

Built on aitun.cc tunnel — no public IP or port forwarding required. Get a public HTTPS URL on startup, controllable from any device.

🌐
Public URL Access
Get https://<sub>.t.aitun.cc on startup via aitun.cc tunnel. Reachable from any device on the internet.
⚡
Remote Shell Execution
POST /exec to run any shell command (bash on Unix, cmd on Windows). Supports cwd, timeout, env overrides.
📁
Bidirectional File Transfer
POST /upload, GET /download, GET /ls, GET /stat with SHA256. Streaming, up to 200MB per file.
🔗
SSH Jump Host
POST /ssh to use the samcommand host as a jump host. Control any SSH-reachable internal machine.
🛡️
Bearer Token Auth
All mutating endpoints require a Bearer token. Auto-generated 256-bit strong token, customizable via --token.
📱
Cross-platform + 32-bit ARM
Linux amd64/arm64/arm (incl. old Android tablets), Windows amd64, macOS amd64/arm64 — all supported.

One-line Install

Auto-detects platform architecture, downloads the correct binary to /usr/local/bin or ~/.local/bin.

Linux / macOS · curl + bash
# One-line install (auto-detects amd64/arm64/arm) curl -fsSL https://samai.cc/samcommand/downloads/install.sh | bash # Re-run this same command anytime to update to the latest version
Backup install command (ModelScope mirror — click to expand if the primary source is unavailable)
macOS / Linux (Termux also supported)
curl -fsSL 'https://modelscope.cn/api/v1/models/luoyunlan168/samcommand/repo?Revision=master&FilePath=install.sh' | bash
Windows · PowerShell
# Run in PowerShell (admin installs to Program Files, otherwise %LOCALAPPDATA%) irm https://samai.cc/samcommand/downloads/install.ps1 | iex
Backup install command (ModelScope mirror — click to expand if the primary source is unavailable)
Windows (PowerShell — admin installs to Program Files, otherwise %LOCALAPPDATA%)
irm 'https://modelscope.cn/api/v1/models/luoyunlan168/samcommand/repo?Revision=master&FilePath=install.ps1' | iex
🤖 Android · SamDocker
Turn old tablets/phones into publicly reachable nodes — samcommand is built in, auto-starts on boot, no root
Download SamDocker APK

Run samcommand in your terminal after install

Get a public URL in 30 seconds.

Run samcommand in your terminal
$ samcommand [samcommand] subdomain ready: samcmd-host-a1b2c3d4e5.t.aitun.cc [samcommand] public URL: https://samcmd-host-a1b2c3d4e5.t.aitun.cc [samcommand] tunnel token (ait_): ait_x7Kd...Qm3f [samcommand] local API listening on :8090

Download Binaries

All binaries are statically linked — zero runtime dependencies. See checksums-sha256.txt for SHA256.

Platform Architecture File Size Download
🐧Linux x86-64 (amd64) samcommand-linux-amd64 7.4 MB Download
🐧Linux ARM 64-bit (arm64) samcommand-linux-arm64 6.8 MB Download
🐧Linux ARM 32-bit v7 (armv7l) samcommand-linux-arm 7.1 MB Download
🪟Windows x86-64 (amd64) samcommand-windows-amd64.exe 7.5 MB Download
🍎macOS Intel (amd64) samcommand-darwin-amd64 7.5 MB Download
🍎macOS Apple Silicon (arm64) samcommand-darwin-arm64 6.9 MB Download
📜Install script Linux / macOS install.sh 2.1 KB Download
📜Install script Windows PowerShell install.ps1 2.0 KB Download

HTTP Endpoints

All endpoints (except /health) require Authorization: Bearer <token> or X-SamCommand-Token: <token> header. Command endpoints also accept JSON, raw text/plain commands and the Samai Command Envelope body (see the Envelope section below).

MethodPathPurpose
GET/healthLiveness probe (no auth)
GET/infoHost info (OS, CPU, IP, uptime)
GET/statussamcommand version, host and process status
POST/execRun shell command (bash on Linux / cmd on Windows; JSON / raw text / envelope body)
POST/exec/asyncRun in background, returns job_id immediately (no ~120s tunnel limit)
GET/exec/streamStreaming execution, real-time output
GET/cmd?c64=...&token=...Run a command via GET (?c= plain or ?c64= base64url — built for AI agents)
POST/ps1Run PowerShell (written to a temp .ps1 file run via -File — immune to quote mangling)
POST/ps1/asyncRun PowerShell in background
GET/ps1/streamStreaming PowerShell
POST/sshRun command on remote host via SSH (jump host)
GET/jobsList all background jobs (running + recently finished)
GET/job/{id}?wait=1Poll job status / output (?wait=1 blocks until finished)
POST/job/{id}/killKill a background job
GET/serviceService autonomy: list persisted services (/start /stop /remove /log to manage)
GET/ls?path=...List directory
GET/stat?path=...File info + SHA256
POST/upload?path=...Upload file (raw body or multipart)
GET/download?path=...Download file (streaming)

Samai Command Envelope

IM/chat gateways eat quotes, strip backslashes and re-wrap lines — by arrival time the command is destroyed; the Envelope keeps the command body to base64url-safe characters only, which no gateway can mangle.

Usage: wrap the command in an envelope body and POST it straight to /exec or /ps1 (Content-Type: text/plain) — samaicmdbegin / v=1 / enc=b64url / crc=CRC32 / payload / samaicmdend.

Add ?respenc=b64url to any command endpoint and the response (stdout / stderr / command) comes back base64url-encoded too; legacy JSON bodies stay 100% backward compatible.