DocsEverything is scriptable
API, CLI, and agents
Everything the upload page does, from any terminal or agent. Links expire by default, so nothing you push here is forever.
curl
Uploading needs an upload token in the Authorization header. Fetching needs nothing but the link.
# share a file curl -H "authorization: Bearer $SWX_TOKEN" \ -H "x-filename: shot.png" --data-binary @shot.png https://swx.sh/api/up # flags via headers: # x-expiry: minutes, 1 to 60 x-password: secret # x-burn: 1 x-destroy-after-fails: 3 # x-webhook-url: https://... (pinged on view, burn, destroy, delete) # fetch curl -OJ https://swx.sh/f/xxxxxx curl -H "x-pw: secret" https://swx.sh/f/xxxxxx -o file # delete early (deleteToken comes back from the upload) curl -X DELETE -H "x-delete-token: ..." https://swx.sh/api/v1/shares/xxxxxx
CLI
A single POSIX shell script wrapping the API. Download it and read it before you run it; that is the whole install.
curl -o swx https://swx.sh/cli less swx # read what you are about to trust chmod +x swx && mv swx ~/bin/ export SWX_TOKEN=... swx put shot.png -e 30m -p secret swx text "meet at 8" -b swx get xxxxxx -p secret swx del xxxxxx
Agents (MCP)
An MCP endpoint at https://swx.sh/mcp gives any agent three tools: share text, fetch a share, delete a share. Uploading tools require the same Bearer token.
claude mcp add --transport http swx https://swx.sh/mcp \ --header "Authorization: Bearer $SWX_TOKEN"