Configuration
Setup options, local settings and scripting conventions for the Theseus CLI.
This page covers the CLI settings you can change and how to call the CLI from scripts. Each command has its own page in the CLI reference, such as theseus generate; theseus help <command> shows the help for your installed version.
Advanced setup
Link to this sectionRun theseus setup --help for the options your installed version supports.
Local configuration
Link to this sectionBy default, the CLI stores its login and local state in ~/.theseus. THESEUS_HOME moves that state to another directory; keep it private and writable by the agent. Choosing an empty directory also means there is no saved login there: sign in using the same THESEUS_HOME. Switch workspaces with theseus workspace rather than editing the state files.
THESEUS_TOKEN, when set, takes precedence over the saved login. THESEUS_API selects the API for that environment credential (default https://app.theseus.dev). A full CLI login works for agent notes and other CLI commands. Never commit login files or token values.
With an environment login, theseus login asks you to unset THESEUS_TOKEN and THESEUS_API before signing in, and workspace switching is unavailable. To repair a wrong account or workspace, update the personal credential at its source, or remove those variables and run theseus login followed by theseus workspace. Check theseus status for a full CLI login, or theseus note list for a personal token, in the agent's environment. theseus logout --revoke revokes an environment login for every instance using that credential; ordinary theseus logout does not remove it from the parent environment.
Set THESEUS_NO_UPDATE_NOTICES=1 to hide update reminders.
theseus generate with no target compares the current branch against the remote's default branch. If your main branch is a different one, set it:
git config theseus.mainBranch refs/heads/mainPush the base and head commits first: theseus generate reads the code from GitHub, not from your checkout.
Scripts
Link to this sectionCommands that take --json print structured results on stdout and progress on stderr. Check the exit code as well as the JSON:
| Exit code | Meaning |
|---|---|
0 | Success |
1 | Failure; with --json, an {"event":"error","code":…} line says why |
2 | Invalid arguments |
8 | A --timeout passed first; the run keeps going on the server |
130 | Stopped with Ctrl-C (143 for SIGTERM); a run you were waiting on keeps going |
To wait for a guide from a script:
theseus wait example/project#42 --for ready --timeout 60 --jsonIt prints one line whose outcome is ready, failed or pending, with the changeset. To check whether the latest guide covers the PR's head, read behind_head from theseus changeset status example/project#42 --json.