Nats
@retr0h/natsv2026.04.21.1
01README
General-purpose NATS transport for swamp — exec, upload, wait for agent connection. Pairs with swamp-nats-agent (https://github.com/retr0h/swamp-nats-agent).
02Release Notes
@adam/cfgmgmt drop-in compat: exports match adam's _lib/ssh.ts byte-for-byte (exec, execSudo, writeFile, writeFileAs, scpFile, scpFileAs, shellEscape, closeAll). nats_host globalArgs mirror cfgmgmt's GlobalArgsSchema (nodeHost, nodeUser, nodePort, nodeIdentityFile, become, becomeUser, becomePassword). Sudo moves from method args to globalArgs.
03Models
nats_host.tsv2026.04.21.1
Global Arguments
| Argument | Type | Description |
|---|---|---|
| nodeUser | string | Agent-side user (SSH-era field, advisory) |
| nodePort | number | SSH port (ignored by NATS transport) |
| nodeIdentityFile? | string | SSH private key path (ignored by NATS transport) |
| becomeUser | string | User to become when sudo is true |
| becomePassword? | string | Password for sudo -S (piped via stdin) |
| natsSubjectPrefix | string | Subject prefix for multi-tenant namespace isolation |
| timeoutMs | number | Per-request timeout (ms) |
| natsUser? | string | NATS user/pass auth — username |
| natsPass? | string | NATS user/pass auth — password |
| natsToken? | string | NATS static token auth |
| natsCredsPath? | string | Path to NATS creds file (user JWT + nkey, recommended) |
| natsNKeySeed? | string | NATS nkey seed (alternative to creds file) |
| natsTlsCaFile? | string | mTLS — CA certificate file |
| natsTlsCertFile? | string | mTLS — client certificate file |
| natsTlsKeyFile? | string | mTLS — client key file |
fn exec()
Run a command on the remote host via swamp-nats-agent. Returns stdout/stderr/exitCode without throwing on non-zero exit.
fn upload()
Write file content to a remote path via swamp-nats-agent. Supports UTF-8 and base64 encoded content; atomic write under sudo via install(1).
fn waitForConnection()
Poll the swamp-nats-agent on the target host until it replies or timeout elapses.
04Previous Versions
2026.04.20.1
Initial release — NATS (JetStream) transport for swamp, pairs with swamp-nats-agent
05Stats
Downloads
2
Archive size
85.6 KB
Not yet scored.
A score will be generated the next time this extension is published. The owner can also trigger scoring manually.
Repository
https://github.com/retr0h/swamp-nats06Platforms
07Labels