Skip to main content

Nats

@retr0h/natsv2026.04.21.1· 6mo agoBEHAVIORS
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.

03Behaviors1
nats_host.tsv2026.04.21.1

Global Arguments

ArgumentTypeDescription
nodeUserstringAgent-side user (SSH-era field, advisory)
nodePortnumberSSH port (ignored by NATS transport)
nodeIdentityFile?stringSSH private key path (ignored by NATS transport)
becomeUserstringUser to become when sudo is true
becomePassword?stringPassword for sudo -S (piped via stdin)
natsSubjectPrefixstringSubject prefix for multi-tenant namespace isolation
timeoutMsnumberPer-request timeout (ms)
natsUser?stringNATS user/pass auth — username
natsPass?stringNATS user/pass auth — password
natsToken?stringNATS static token auth
natsCredsPath?stringPath to NATS creds file (user JWT + nkey, recommended)
natsNKeySeed?stringNATS nkey seed (alternative to creds file)
natsTlsCaFile?stringmTLS — CA certificate file
natsTlsCertFile?stringmTLS — client certificate file
natsTlsKeyFile?stringmTLS — 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 Versions1
2026.04.20.1

Initial release — NATS (JetStream) transport for swamp, pairs with swamp-nats-agent

05Stats
D
53 / 100
Downloads
30
Archive size
85.6 KB
  • Has README or module doc0/2missing
  • README has a code example0/1missing
  • README is substantive0/1missing
  • Most symbols documented0/1missing
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License0/2missing

    no SPDX license declared; no LICENSE file

  • Verified public repository2/2earned
06Platforms
07Labels