Skip to content

agensai disconnect

Stop the running daemon. Optionally wipe local AGENSAI state.

Usage

agensai disconnect
agensai disconnect --purge

Flags

FlagDefaultBehavior
--home <path>~/.agensaiOverride the home directory.
--purgefalseAfter stopping the daemon, wipe ~/.agensai/ (orchestrator key, agent keys, configs).
--jsonfalseEmit JSON result.
--quietfalseSuppress progress text.

What it does

  1. Reads the lockfile at ~/.agensai/serve.lock to find the active pid.
  2. Sends SIGTERM to the pid. Waits up to ~5 seconds for clean shutdown.
  3. If --purge, deletes:
    • ~/.agensai/orchestrator.key
    • ~/.agensai/orchestrator.json
    • ~/.agensai/agents/*.json
    • ~/.agensai/config.json
    • ~/.agensai/serve.lock
  4. Prints result.

What --purge does not do

  • Does not touch on-chain state. Your orchestrator's smart account, ENS subname, and any granted permissions remain on-chain.
  • Does not revoke active agent permissions. If you want to revoke before purging, run revoke from your IDE (or use the dashboard's "Delete orchestrator" flow which signs the kill-switch sweep first).
  • Does not touch your main account. Your passkey and main account are independent of ~/.agensai/.

If your goal is to fully retire an orchestrator and reclaim all funds, do this instead:

  1. From the dashboard, click Delete orchestrator. This is one biometric tap that uses the pre-signed kill-switch grant to sweep all funds back to your main account, archive the orchestrator's ENS records, and mark its children as revoked.
  2. Then agensai disconnect --purge to clean local state.

--purge alone is "I'm getting rid of this device's local install"; the dashboard delete is "I'm retiring this orchestrator entirely."

Exit codes

CodeMeaning
0Daemon stopped (and state purged if requested).
0No daemon was running; --purge may still apply.
1Daemon refused to stop within the timeout.

Re-installing on the same device

agensai disconnect --purge
agensai install <fresh-token>

Get the fresh token from a fresh dashboard ceremony.