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.comIf 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.comWith 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 searchCommon remote operations
Run a model method
swamp model method run hello execute --input 'run=echo hi' \
--server wss://swamp.example.comQuery data
swamp data get hello result --version 1 --server wss://swamp.example.com
swamp data query 'modelType == "command/shell"' --server wss://swamp.example.comSearch models
swamp model search --server wss://swamp.example.comAccess vault secrets
swamp vault get default --server wss://swamp.example.comView audit log
swamp audit --server wss://swamp.example.comView summary
swamp summary --server wss://swamp.example.comRelated
- Set Up Token Authentication — store credentials for automatic use
- Remote Execution — manage workers and the dispatch pool
- Serve Flags — SWAMP_SERVE_URL and other environment variables