Skip to main content

RUN COMMANDS ON A REMOTE SERVER

This guide shows you how to run Swamp commands against a remote swamp serve instance. This covers client-side usage of --server — for managing the worker pool and deploying workers, see Remote Execution.

Connect to a remote server

Any Swamp command that supports --server can target a remote instance:

swamp model method run hello execute --input 'run=echo hi' \
  --server wss://swamp.example.com

If you have stored a token with swamp auth server-login, authentication happens automatically.

Set SWAMP_SERVE_URL to avoid repeating --server

export SWAMP_SERVE_URL=wss://swamp.example.com

With this set, all commands use the remote server by default:

swamp model method run hello execute --input 'run=echo hi'
swamp data get hello result --version 1
swamp model search

Common remote operations

Run a model method

swamp model method run hello execute --input 'run=echo hi' \
  --server wss://swamp.example.com

Query data

swamp data get hello result --version 1 --server wss://swamp.example.com
swamp data query 'modelType == "command/shell"' --server wss://swamp.example.com

Search models

swamp model search --server wss://swamp.example.com

Access vault secrets

swamp vault get default --server wss://swamp.example.com

View audit log

swamp audit --server wss://swamp.example.com

View summary

swamp summary --server wss://swamp.example.com