lmssh
lmssh is a static executable bundling OpenSSH 10.6p1 (ssh, sftp, scp, ssh-keygen) with an embedded LMScript bytecode VM for remote fleet automation and key management. It supports direct OpenSSH CLI invocation, parallel host fan-out, SFTP transfers, SSH CA signing, and standard lmcode_std_v3 REST and CLI interfaces.
Quick reference
npm install -g @lmctl-ai/lmctl@latest
lmssh --version
lmssh ssh -V
lmssh --lmcode-schema
lmssh --lmcode-signatures
| Interface or flag | Signature or syntax | Purpose |
|---|---|---|
| CLI host bytecode | lmssh [--dry-run] --lmcode prog.dslb [-- args...] | Execute or dry-run compiled LMScript bytecode against the embedded lmssh schema. |
| CLI schema and signatures | lmssh --lmcode-schema [--json] | --lmcode-signatures | Print human-readable schema summary, raw schema JSON bytes, or all 334 canonical signatures. |
| Embedded OpenSSH tools | lmssh ssh | sftp | scp | ssh-keygen [args...] | Run unmodified OpenSSH 10.6p1 client tools directly or via symlinked argv[0] names. |
| context ssh: Ssh | ssh.connect(dest) -> Session | ssh.each(dests, cmd) -> ResultList | Configure global SSH defaults, open per-host sessions, or fan out commands in parallel across a fleet. |
| Session | s.exec(cmd) -> Result | s.put(local, remote) | s.get(remote, local) | s.sftp(batch) | Execute remote commands, transfer files and directories via SCP/SFTP, or inspect remote paths. |
| context keys: Keys | keys.generate(path, type, comment, pw) -> Key | keys.certify(...) | keys.sign(...) | Generate SSH keys, issue CA certificates, sign and verify artifacts, and manage known_hosts files. |
| context io: Io / report: Report | io.args() | io.temp_dir() | io.sha256(path) | report.add(...) | report.fail_if_any() | Read CLI arguments, manage temporary directories, hash files, and emit structured text or JSON reports. |
| Standard REST and CLI | RestGet..RestOptions, RestHandler, CliCommand, CliOption | Expose _lmcode_ functions as HTTP routes (:param) or stateless CLI flags and commands via rest_serve and rest_cli. |
p = _lmcode_ cli="lmssh" install="github:lmctl-ai/lmssh@latest";
let dir = io.temp_dir();
let k = keys.generate(dir + "/deploy_ed25519", "ed25519", "deploy@lmssh", "");
assert_eq(k.type(), "ed25519");
assert_eq(k.bits(), 256);
@"/key/fingerprint"
fn get_fp(x: RestExchange) -> void implements RestGet {
x.json("{\"type\":\"" + k.type() + "\",\"fp\":\"" + k.fingerprint() + "\"}");
}
assert_eq(str_contains(rest_cli(str_split("/key/fingerprint", " ")), "SHA256:"), true);
end _lmcode_
res = run_lmcode(p);
require(res.ok, json_stringify(res));
Documentation pages
- Skill — agent authoring rules, commands, path and askpass safety controls, exit codes, and verification steps.
- Guide — multi-main OpenSSH architecture, fork isolation, ControlMaster reuse, path hardening, and standard REST and CLI interfaces.
- Reference — complete CLI flags, Ssh/Session/Keys/Io/Report methods, standard lmcode_std_v3 interfaces, and exit codes.