serial-exec is an OOB utility for command execution over a serial console.
It is written in Rust and designed for workflows like accessing vault and other
machines through serial from a host where SSH is unavailable.
- Rust 1.75+
- A serial port such as
/dev/ttyUSB0
curl -fsSL https://raw.githubusercontent.com/agoodkind/serial-exec/main/install.sh | shIf the release asset does not match your platform, run:
cargo install --git https://github.com/agoodkind/serial-exec --locked --bin serial-execserial-exec reads host definitions from TOML in this order:
--host-fileSERIAL_EXEC_CONFIGenvironment variable~/.config/serial-exec/hosts.toml
Example config:
[hosts.vault]
device = "/dev/ttyUSB0"
baud = 115200
prompt = '(?m)[#$] $'
user = "root"serial-exec list
serial-exec ping vault
serial-exec run vault "qm list"
serial-exec run vault "qm list" --json
serial-exec shell vaultGlobal flags:
--timeout 30s--host-file <path>--json
Ctrl-] exits shell mode.
cargo build-native
cargo test-all
cargo clippy-warn
cargo fmt-checkConfigured in .cargo/config.toml:
cargo build-native
cargo build-aarch64-linux-musl
cargo build-x86_64-linux-musl
cargo test-all
cargo clippy-warn
cargo fmt-checkFor local Linux musl targets on macOS, install the target and LLVM tools and use the
rust-lld linker:
rustup target add aarch64-unknown-linux-musl x86_64-unknown-linux-musl
rustup component add llvm-tools
RUSTFLAGS='-C linker=rust-lld -C linker-flavor=ld.lld' \
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=rust-lld \
cargo build --release --target aarch64-unknown-linux-musl
RUSTFLAGS='-C linker=rust-lld -C linker-flavor=ld.lld' \
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=rust-lld \
cargo build --release --target x86_64-unknown-linux-muslYou can also call the aliases after exporting the same environment:
RUSTFLAGS='-C linker=rust-lld -C linker-flavor=ld.lld' \
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=rust-lld \
cargo build-aarch64-linux-musl
RUSTFLAGS='-C linker=rust-lld -C linker-flavor=ld.lld' \
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=rust-lld \
cargo build-x86_64-linux-muslThis is the same strategy used in the CI release workflow, which currently builds all targets with
cargo directly and avoids container-emulation issues.
GitHub Actions builds and publishes:
serial-exec-linux-arm64serial-exec-linux-amd64serial-exec-darwin-arm64
README.md, .cargo/config.toml, .github/workflows/release.yml, and AGENTS.md are treated as
the active coordination points:
.cargo/config.tomlis the source of local command aliases.release.ymlis the source of build matrix and linker strategy.AGENTS.mdrecords agent-facing notes for future changes.
When release targets, artifact names, aliases, or cross-build strategy changes, update the three files
(release.yml, AGENTS.md, README.md) at the same time before merging to avoid documentation drift.