SageCode
SageCode is the command line for AutoSage. Almost everything you do in the web app — building and running workflows, writing scripts, setting up webhooks and schedules, managing the Key Vault — you can also do from your terminal, with one command: sagex.
One install gives you two ways to work:
- Single commands, for everyday tasks, scripting and CI:
sagex run workflow "Deploy",sagex list run,sagex trigger fire Backup. Output is a table by default and JSON with--json. - A full-screen terminal app: run
sagexon its own for a tree of your resources beside a terminal-style transcript, with live workflow graphs, and Sage, the AutoSage assistant: type a question without!and it answers, looks things up, and with your approval makes changes for you.
sagex auth login # approve this device in your browser
sagex list workflow # your workflows, as a table
sagex run workflow "Deploy" # run one and follow it live, node by node
sagex # open the terminal app
SageCode has its own website
sagecode.web.app has the install guide, recipes and the full command reference with every flag, generated from the CLI itself. These pages cover using SageCode with your AutoSage account.
What you can do with it
| In the web app | In SageCode |
|---|---|
| Workflows list and editor | list workflow, show workflow, render workflow, and new / push workflow to build one from a JSON file |
| Script Editor | new script, push script (shows a diff before updating), show script |
| Running scripts and workflows | run script, run workflow — output streams live, and workflows draw a live node graph |
| Trigger nodes (HTTP and schedule) | trigger create, fire, poll, watch, invoke, enable, disable, regenerate |
| Key Vault | create, update, rename and delete for vaults, servers and keys |
| Execution Logs | list run, show run --logs, copy run |
| Autobot | Sage, the assistant in the terminal app: ask a question, and it looks things up and (with your approval) runs commands, edits files and runs shell commands. Conversations are saved |
| Autobot's BYO LLM keys | create, list, update, delete model and use model. Guide |
| Agent Dashboard | The Sage Today block in the terminal app, and /usage |
The Guides walk through each of these, and the Command Reference lists every command.
How it fits with your account
- Same account, no separate sign-up.
sagex auth loginshows a one-time code; you approve it in your browser while signed in to AutoSage. See Install & Sign In. - It acts as you. SageCode sees exactly what you see in the web app, and every action is scoped to your account. Runs you start from SageCode count toward your plan's monthly limits, just like runs started in the browser.
- Every sign-in is a session you can see and revoke on your profile, with what it has been doing. CI jobs use access tokens instead. See Sessions & Access Tokens.
- Secrets stay secret. Your session key lives in your OS keychain, never in a plain file. Passwords, SSH keys and webhook secrets are never accepted as command-line flags, so they never land in your shell history.
Requirements
- An AutoSage account. The Free plan works.
- macOS, Linux or Windows, with Python 3.11 or newer. The one-line installer downloads Python for you if you don't have it.
- An OS keychain to keep your session in: built into macOS and Windows; on Linux, Secret Service (GNOME Keyring or KWallet). No keychain, as on a CI runner? Use an access token.
Next steps
- Install SageCode and sign in — about a minute.
- Learn the core concepts: naming resources, your workspace, output and exit codes.
- Open the terminal app (
sagex) and ask Sage something. - Pick a guide: scripts & workflows, triggers, Key Vault, runs & logs or CI/CD.