Skip to main content

Before you begin

Make sure you have:
  • Node.js 18+ installed.
  • API key from OnCall Web Studio (stored in ~/.oncall/config).
  • A project directory to run commands in.
  • Ability to run oncall cluster in a separate terminal.

Step 1: Install OnCall‑Cli

npm install -g oncall-cli

Step 2: Initialize your project

cd /path/to/your/project
oncall init -m "Describe this service" -id "<project-id>"
  • Creates oncall.yaml with id, window_id, and access flags logs_available / code_available.
  • Use the same id across services to group them into one cluster.

Step 3: Log in

oncall login <your-api-key>
  • Stores API_KEY in ~/.oncall/config.

Step 4 : Start the cluster server

Run this in a separate terminal if you have multiple services:
oncall cluster
  • Keeps a local registry so the AI can see all services sharing the same project id.

Step 5: Run your first AI‑assisted session

oncall npm run dev
# or
oncall python app.py
# or
oncall docker-compose up
What happens:
  • Command runs in a pseudo‑terminal; logs stream live.
  • CLI opens a WebSocket to the backend with your API_KEY + window_id.
  • You get a split UI: logs on the left, AI chat on the right.

Step 6: Ask your first question

Type in the chat pane:
  • “What’s causing this error?”
  • “Why are API requests failing?”
  • “What just happened?”
The CLI sends your question plus recent logs (and cluster architecture if available). The AI may call local tools:
  • Logs: tail_logsgrep_logsget_recent_errorsread_logs (requires logs_available: true)
  • Code: read_filegrep_search (requires code_available: true)

Step 7: Iterate quickly

  • Ctrl+R reset chat
  • Ctrl+D cycle views (split → full chat → full logs)
  • Tab switch focus; ↑/↓ scroll focused pane
  • Ctrl+L clear logs; Ctrl+K clear chat

Minimal “hello” run

oncall init -m "Quick test"
oncall login <your-api-key>
oncall node -e "console.log('hello from oncall')"
Then ask in chat: “What did this command output?”