sagex
Autosage in your terminal. Build, run and watch your Autosage workflows, scripts, vaults and triggers from a full-screen terminal app or one-shot commands. Everything the web app does, minus the mouse.
$ sagex list workflow
┌──────────────────────┬──────────────────────────────────────┬──────────┐
│ name │ id │ modified │
├──────────────────────┼──────────────────────────────────────┼──────────┤
│ Nightly Disk Cleanup │ 46a2ba05-3bed-40b6-a967-2a3b0dc2b657 │ 2d ago │
│ Deploy │ 3ee4dd1f-8865-4144-bcec-5aaa36df0b30 │ 5d ago │
└──────────────────────┴──────────────────────────────────────┴──────────┘
You need an Autosage account (free).
Install
macOS / Linux
curl -LsSf https://raw.githubusercontent.com/Lagnajit09/sagex/main/scripts/install.sh | sh
Windows (PowerShell)
irm https://raw.githubusercontent.com/Lagnajit09/sagex/main/scripts/install.ps1 | iex
The installer uses uv to install sagex as an isolated tool, and fetches Python 3.11+ for you if needed. Set SAGEX_VERSION=1.1.0 before running it to pin a version.
Already have a Python tool manager? Any of these works (Python 3.11 or newer):
uv tool install sagex-cli
pipx install sagex-cli
pip install sagex-cli
Quick start
sagex auth login # approve this device in your browser
sagex # open the terminal app
sagex list workflow # or run single commands
sagex run workflow "Deploy" # run a workflow and follow it live, node by node
The terminal app
Run sagex with no arguments to open it.
- Left: your Resources: Workflows, Scripts, Vault, recent Runs (with ✓ / ✗ / ⟳ status) and Triggers (● on / ○ off). Press F3 to switch to your local Workspace folder instead.
- Right: a terminal-style transcript. Start a line with
!to run any command, such as!sagex run workflow Deployor!git status. Output streams in live, and workflow runs draw a live node graph.
| Key | Action |
|---|---|
!command |
Run a shell or sagex command |
Esc |
Stop the running command |
↑ / ↓ |
Command history |
F2 |
Switch shell (PowerShell / cmd / WSL on Windows, bash / sh elsewhere) |
F3 |
Switch between server resources and the local workspace |
F5 |
Refresh |
Ctrl+Q |
Quit |
Chatting with Autobot from the terminal is coming in sagex v2. Until then, use Autobot in the web app.
Commands
Resources can be referred to by name or id. An id prefix works for runs. Most read commands take --json for scripting. Run sagex <group> --help for every option.
| Group | Commands | What it does |
|---|---|---|
auth |
login · status · logout |
Sign in with your browser (or --with-token), see who you're signed in as, sign out |
list |
workflow · script · run · trigger · vault · server · key |
Compact tables of your resources |
show |
workflow · script · run · trigger · vault · server · key |
One resource in detail; show run --logs prints node output, show key --reveal shows secrets after confirming |
render |
workflow |
Draw a workflow as a flow tree (from the server, or a local file with --file) |
run |
script · workflow |
Run now and stream output live. Ctrl+C stops it. Pass inputs with -p NAME=VALUE |
trigger |
create · fire · poll · watch · invoke · enable · disable · regenerate |
HTTP webhooks and cron schedules: set up, fire, follow and rotate |
new |
workflow · script |
Scaffold a local file, ready to edit |
push |
workflow · script |
Create on the server from a local file, or update after confirming (scripts show a diff) |
copy |
workflow · script · run |
Download to your workspace (--all, or copy run --since 7days) |
create |
vault · server · key |
Create vault resources |
update |
vault · server · key |
Change them, or rotate a key's secret |
rename |
workflow · script · vault · server · key |
Rename in place |
delete |
workflow · script · vault · server · key · trigger |
Delete, after confirming |
workspace |
set · show |
Choose the local folder sagex reads from and writes to |
syntax |
trigger · script · email · decision · edge · decision-edge |
Print a copy-paste JSON snippet for a workflow node or edge |
A typical loop
sagex new script disk_check --lang shell # scripts/disk_check.sh
sagex push script disk_check # create it on the server
sagex run script disk_check.sh -s web-1 # run it on a vault server
sagex new workflow "Disk Check" # workflows/Disk_Check.json
sagex syntax script # snippet for an action node
sagex render workflow --file "Disk Check" # preview the flow locally
sagex push workflow "Disk Check"
sagex trigger create "Disk Check" -t schedule --cron "0 2 * * *"
sagex trigger watch "Disk Check" # wait for the next firing, then follow it
Your workspace
sagex keeps local files in one folder: your workspace. It defaults to the current directory; set it with sagex workspace set <path>.
workflows/ workflow JSON (sagex new / copy / push)
scripts/ script files (sagex new / copy / push)
runs/ run metadata + logs (sagex copy run)
logs/script/<id>/ saved by sagex run script
logs/workflow/<run_id>/ saved by sagex run workflow / trigger fire
Signing in
sagex auth login prints a one-time code and opens Autosage in your browser. Check the code matches, approve, and you're in. On a server or over SSH, open the link on any device instead.
Each sign-in is a session. Your Autosage profile lists them all, with the device, SageCode version, when it was last active, and how many commands and runs it has started, and can revoke any of them. Sessions unused for 90 days expire. sagex auth logout signs this machine out.
CI and scripts: create an access token on your profile and set it as SAGEX_API_KEY, or pipe it in with sagex auth login --with-token.
Security
- Your session key is stored in the OS keychain (Windows Credential Manager, macOS Keychain or Linux Secret Service), never in a plain file.
- Approving a sign-in, creating tokens and revoking sessions all need you signed in to Autosage in the browser; a SageCode key can't do any of them.
- Secrets are never accepted as command-line flags, so they never show up in shell history. Passwords, SSH keys and passphrases are typed at a hidden prompt or read from a file you point to.
- Vault credentials can't be copied to disk, and
show keyhides secret values unless you pass--revealand confirm. - An HTTP trigger's secret is shown once, when it's created or rotated.
Configuration
| Setting | Purpose |
|---|---|
SAGEX_API_KEY |
Use this access token instead of the keychain. For CI or machines without a keychain; create one on your Autosage profile |
SAGEX_API_URL |
Point sagex at a different Autosage server |
SAGEX_DEBUG=1 |
Add connection details to network errors |
~/.sagex/config.json |
Saved preferences (workspace, shell) |
Update or uninstall
uv tool upgrade sagex-cli # or: pipx upgrade sagex-cli / pip install -U sagex-cli
To uninstall, run sagex auth logout first (it removes your key from the keychain), then uv tool uninstall sagex-cli (or pipx uninstall / pip uninstall).
Development
git clone https://github.com/Lagnajit09/sagex && cd sagex
cp .env.example .env # then fill in the server URLs
python -m venv .venv && . .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
pytest
.env holds build settings (server URLs). They're baked into the package when it's built, so they ship publicly: never put secrets there. After editing .env, re-run pip install -e ..
Roadmap
- v1.1 (shipped): sign in with your browser, and see and revoke every session on your Autosage profile.
- v2: Autobot in the terminal: chat, generate, run and fix, with your last command's output as context.
Links
- Autosage: https://autosagex.web.app
- Documentation: https://autosagexdocs.web.app
- Issues: https://github.com/Lagnajit09/sagex/issues
- Changelog: https://github.com/Lagnajit09/sagex/blob/main/CHANGELOG.md
License
Metadata
Release files for sagex-cli 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sagex_cli-1.1.0.tar.gz | 100.4 kB | With provenance | Details for sagex_cli-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sagex_cli-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for sagex_cli-1.1.0-py3-none-any.whl |
Total release size: 200.6 kB
Release files / sagex_cli-1.1.0.tar.gz
| Download URL | sagex_cli-1.1.0.tar.gz |
|---|---|
| Size | 100.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2eea65a18f059422c511726c34017ae60ea5ed1556711f1771939e866acaba14
|
|
BLAKE2b-256 checksum How to use checksums |
54b247136ba4a6922d883da3b6f9a6821bb0d180aad7eaf189281ce36f20448a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.
Transparency logRelease files / sagex_cli-1.1.0-py3-none-any.whl
| Download URL | sagex_cli-1.1.0-py3-none-any.whl |
|---|---|
| Size | 100.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ca45ae719da6388056555b86c1bc6f942fc6d7ee6cc6bf8702b73899ac475fb
|
|
BLAKE2b-256 checksum How to use checksums |
4c50a6c5d04155570b6d5d09d627382e0a560400e9f7b7f317356782787ee9be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.
Transparency logSecurity for sagex-cli 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for sagex_cli-1.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.