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 list hello --server wss://swamp.example.com
swamp data query 'modelType == "command/shell"' --server wss://swamp.example.com
swamp data search --type resource --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
swamp vault list-keys default --server wss://swamp.example.com
swamp vault search --server wss://swamp.example.com
swamp vault read-secret default api-key --yes --server wss://swamp.example.com
swamp vault audit-trail --vault default --server wss://swamp.example.com

Manage vault configuration

swamp vault create local_encryption staging --server wss://swamp.example.com
swamp vault edit staging --server wss://swamp.example.com
swamp vault type search --server wss://swamp.example.com

Run workflows

swamp workflow run deploy --server wss://swamp.example.com
swamp workflow approve deploy gate-step --server wss://swamp.example.com
swamp workflow resume deploy --server wss://swamp.example.com

Manage workflows

swamp workflow create deploy --server wss://swamp.example.com
swamp workflow edit deploy --server wss://swamp.example.com
swamp workflow delete deploy --yes --server wss://swamp.example.com
swamp workflow validate deploy --server wss://swamp.example.com
swamp workflow evaluate deploy --server wss://swamp.example.com

Check repository health

swamp doctor secrets --server wss://swamp.example.com
swamp doctor vaults --server wss://swamp.example.com
swamp doctor workflows --server wss://swamp.example.com

Reload extensions

swamp serve reload --server wss://swamp.example.com

Manage extensions

swamp extension list --server wss://swamp.example.com
swamp extension info @swamp/gcp/run --server wss://swamp.example.com
swamp extension pull @swamp/s3-datastore --server wss://swamp.example.com
swamp extension update --server wss://swamp.example.com

Manage models

swamp model edit hello --server wss://swamp.example.com
swamp model type describe command/shell --server wss://swamp.example.com
swamp model type search shell --server wss://swamp.example.com

Manage access tokens

swamp access token list --server wss://swamp.example.com
swamp access token revoke ci-token --server wss://swamp.example.com
swamp access token rotate ci-token --server wss://swamp.example.com

Manage worker tokens

swamp worker token create ci-runner --duration 24h --server wss://swamp.example.com
swamp worker token list --server wss://swamp.example.com
swamp worker token revoke ci-runner --server wss://swamp.example.com

Housekeeping

swamp data gc --server wss://swamp.example.com
swamp data prune --dry-run --server wss://swamp.example.com
swamp run gc --server wss://swamp.example.com
swamp datastore namespace list --server wss://swamp.example.com

Configure the datastore

swamp datastore setup extension @swamp/s3-datastore \
  --config '{"bucket":"my-bucket","region":"us-east-1"}' \
  --server wss://swamp.example.com

Migrate vaults

swamp vault migrate my-secrets --to-type @swamp/aws-sm \
  --config '{"region":"us-east-1"}' --yes \
  --server wss://swamp.example.com

View audit log

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

View summary

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