Installing the Sudoji Agent
Run Sudoji directly on your Linux server — no copy-pasting logs into a browser.
What is the Sudoji Agent?
The Sudoji Agent is an installable CLI that runs on your Linux server. Instead of manually copying error messages into the web chat, you run sudoji ask and the agent automatically gathers context from your environment — Node version, git status, recent log output — and sends it to Sudoji's AI in one shot.
The Agent is built around a brain / hands split: the cloud handles reasoning (the AI model), while the local CLI handles execution (reading files, running commands). Credentials and sensitive output never leave your machine unredacted.
Quickstart — Recommended
The fastest way to get running. One command installs Node.js 20, pm2, and the Sudoji CLI, authenticates with your API key, and starts the daemon — all in one shot.
The script handles everything automatically:
- Installs
nvm, Node.js 20, andpm2if not already present - Installs
@sudoji/cliglobally - Runs
sudoji loginwith your key automatically - Starts the daemon under pm2 and registers it to survive reboots
Prefer a downloadable script?
If you'd rather inspect the script before running it (recommended for production), download it with your key pre-embedded from the dashboard, then run it manually:
Once the script finishes, your server appears as ACTIVE in the Servers page and you can start chatting from the portal immediately. The manual steps below are only needed if you prefer full control over each stage.
Prerequisites — Manual install
- Linux server — Ubuntu 20.04+, Debian 11+, or CentOS 8+
- Node.js 18 or later (
node --versionto check) - A Sudoji account with an active subscription
nvm or your package manager.Step 1 — Create an API key
The CLI authenticates with a personal API key — not your account password. Keys are scoped so you can give a server read-only access or full execute access independently.
- Open Dashboard → Settings
- Scroll to the API Keys section
- Enter a name (e.g.
prod-server), select scopes, click Create Key - Copy the key immediately — it is shown once only and cannot be retrieved again
Scope guide:
Step 2 — Install the CLI
Verify the installation:
0.1.20
Step 3 — Authenticate
Run the login command and paste the API key you created in Step 1:
You'll be prompted to paste the key interactively. For CI environments or scripting, use the --paste flag:
~/.sudoji/credentials (mode 0600) if no keychain is available.Step 4 — Verify your setup
Run sudoji doctor to confirm auth, API connectivity, settings, and redaction are all working:
✓ API key stored sudoji_sk_a1b2c3d4… ✓ Settings loaded apiBaseUrl: https://api.sudoji.io ✓ API reachable https://api.sudoji.io/healthz → HTTP 200 ✓ Redaction active "password=super$ecret…" → "password=[REDACTED]…" All checks passed.
Step 5 — Start the daemon (optional but recommended)
The daemon is a persistent background service that keeps your server connected to the Sudoji cloud hub. While it is running you can send messages directly from the web portal at sudoji.io/dashboard/sessions without needing your terminal open.
The recommended way is to run it under pm2 so it survives reboots and auto-restarts on crash — no second SSH session required.
pm2 startup, copy and run the command it prints (something like sudo env PATH=... pm2 startup systemd -u ubuntu --hp /home/ubuntu). That one-time step is what makes the daemon survive reboots automatically.Check the daemon is connected:
Once connected, your server appears as online in the portal Servers page and the Chat tab in Sessions becomes active.
sudoji ask and sudoji chat on any plan without the daemon.Your first question
The main command is sudoji ask. Describe the problem in plain English — the agent automatically gathers context (Node version, git status, recent errors) and sends it alongside your question.
The agent streams the answer directly to your terminal. It will tell you the root cause and exact commands to fix it.
Useful flags
Running fixes with sudoji do
sudoji do is shorthand for sudoji ask --mode fix. The agent reads your server, proposes the necessary commands, and runs each one after you approve it.
Each run_command call shows the exact command and prompts [y/N] before executing. Read operations (reading files, listing directories, searching) are silent and automatic.
Interactive chat: sudoji chat
sudoji chat opens a persistent, multi-turn REPL on your server. Unlike sudoji ask (one-shot), chat remembers what it read earlier in the session — useful for debugging that requires several back-and-forth steps.
Every chat session is automatically given a generated name (like Brave Falcon) and saved as a thread in your portal. You can rename it from the portal by clicking the title.
sudoji chat (default diagnose mode) when you want to plan a change with the agent before executing anything. Switch to --mode fix once you are ready to apply the fix. All modes are available — diagnose, suggest, and fix.Setting server context
sudoji context saves a persistent description of your server that is included in every request. Set it once after install so you never have to repeat "this is Ubuntu 22 running nginx…" in every question.
Analysing logs
sudoji logs fetches recent log output from pm2, systemd, or a file, redacts any secrets, then sends it to the agent for analysis.
systemd
pm2
Log file
[REDACTED].Configuration
Settings are loaded in layers — each layer can override the one above it: