Skip to content

openbug-ai/cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OpenBug

OpenBug

Real-time AI debugging for running applications

Beta npm License: MIT

Capture logs automatically, search your codebase in natural language, and chat with an AI that understands your entire system.

loading animation


Status

🚧 Beta - OpenBug is actively developed and maintained. We ship updates regularly and welcome feedback.


Installation

npm install -g @openbug/cli

Quick Start

First time setup:

# Terminal 1: Start the AI assistant
debug

You'll be prompted to log in and paste an API key from app.openbug.ai.

Start debugging:

# Terminal 2: Run any command with debugging
debug npm run dev
debug python app.py
debug docker-compose up

Your application runs normally with logs visible. Behind the scenes, OpenBug captures logs, accesses your codebase locally, and makes everything available to the AI assistant running in Terminal 1.


🎯 Try the Interactive Demo

New to OpenBug? See it debug 3 realistic bugs in under 5 minutesβ€”no installation required.

Try Demo in Codespaces

What's included:

  • 2 microservices with real bugs (schema drift, config errors, race conditions)
  • Step-by-step walkthroughs of OpenBug investigating each issue
  • See exactly how OpenBug correlates logs and searches code across services

Perfect for understanding OpenBug's capabilities before connecting your own services.

View demo repository β†’


Why OpenBug?

Stop context-switching between logs and code

Ask "why is the auth endpoint failing?" and get answers based on actual runtime logs plus relevant code from your codebaseβ€”not generic suggestions.

Debug across multiple services

No more grepping through logs in 5 different terminals. OpenBug sees logs from all connected services and can trace issues across your entire stack.

Understand unfamiliar codebases

Search in natural language: "where do we handle payment webhooks?" The AI searches your actual codebase, not the internet.


How It Works

Terminal 1: AI Assistant          Terminal 2: Your Service
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ $ debug                 β”‚       β”‚ $ debug npm run dev      β”‚
β”‚                         β”‚       β”‚ Server running on :3000  β”‚
β”‚ You: "Why is auth       β”‚       β”‚ [logs stream normally]   β”‚
β”‚      failing?"          β”‚       β”‚                          β”‚
β”‚                         │◄─────── Logs captured            β”‚
β”‚ AI: [analyzes logs +    β”‚       β”‚ Code accessed locally    β”‚
β”‚      searches codebase] β”‚       β”‚ Connected to cluster     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β–²                                  β–²
          β”‚                                  β”‚
          └────────── Local Cluster β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   (ws://127.0.0.1:4466)
                            β”‚
                            β”‚ WebSocket
                            ↓
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚   OpenBug AI Server        β”‚
                β”‚                            β”‚
                β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
                β”‚  β”‚   Agent Graph        β”‚  β”‚
                β”‚  β”‚  β€’ Analyze logs      β”‚  β”‚
                β”‚  β”‚  β€’ Search codebase   β”‚  β”‚
                β”‚  β”‚  β€’ Generate insights β”‚  β”‚
                β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  1. debug starts the AI assistant and connects to a local cluster server
  2. debug <command> runs your service and streams logs to the cluster
  3. Local cluster connects to OpenBug AI server via WebSocket
  4. Agent Graph processes queries, searches code, and analyzes logs
  5. Responses flow back through cluster to your terminal

Run multiple services in different terminalsβ€”they all connect to the same cluster, so the AI can debug across your entire system.


Privacy & Security

Your code stays local

Your codebase is accessed locally and never uploaded. Only specific code snippets that the AI queries are sent to the server.

Selective log sharing

Logs are streamed to the server only when the AI needs them to answer your questions. You control what runs with debug <command>.

API key authentication

All requests are authenticated with your personal API key from app.oncall.build.


Self-Hosting

To run your own OpenBug server:

  1. Clone the server repository
  2. Configure with your OpenAI API key
  3. Point the CLI to your server:
export WEB_SOCKET_URL=ws://localhost:3000/v2/ws
export API_BASE_URL=http://localhost:3000/v2/api

See the server README for full setup instructions.


Typical Workflow

Multi-service debugging:

# Terminal 1: AI Assistant
debug

# Terminal 2: Backend
cd backend
debug npm run dev

# Terminal 3: Frontend
cd frontend
debug npm start

# Back to Terminal 1 (AI)
> "Users can't log in, what's wrong?"
> "Show me logs from the last auth request"
> "Where do we validate JWT tokens?"

The AI sees logs from both services and can search code in both repos.


OpenBug vs AI Coding Assistants

Feature OpenBug Cursor/Copilot/Windsurf
Sees runtime logs βœ“ βœ—
Multi-service debugging βœ“ βœ—
Natural language log analysis βœ“ βœ—
Works with running apps βœ“ Static analysis only

OpenBug coordinates debugging agents that see what's actually happening when your code runs.


Commands

Start AI assistant:

debug

Run with debugging:

debug <any-command>

Open browser UI:

debug studio

Configuration

First-Time Project Setup

When you run debug <command> for the first time in a directory, OpenBug will:

  1. Prompt for a project description
  2. Create an openbug.yaml file
  3. Register the service with the local cluster

Example openbug.yaml:

id: "my-api-service"
name: "api-service"
description: "Express API with PostgreSQL"
logs_available: true
code_available: true

On subsequent runs, OpenBug uses the existing configuration automatically.

Environment Variables

Override defaults by setting these in ~/.openbug/config or as environment variables:

API_BASE_URL=https://api.oncall.build/v2/api
WEB_SOCKET_URL=wss://api.oncall.build/v2/ws
OPENBUG_CLUSTER_URL=ws://127.0.0.1:4466

Keyboard Shortcuts

Terminal UI:

  • Ctrl+C – Exit
  • Ctrl+D – Toggle chat/logs view
  • Ctrl+R – Reconnect/reload

Browser UI:

  • Ctrl+O – Toggle full/trimmed chat history

Current shortcuts are shown in the bottom status bar.


Requirements

  • Node.js 20+
  • npm, yarn, or bun

Documentation

For advanced usage, custom integrations, and troubleshooting:

Full Documentation β†’


Contributing

The codebase is designed to be readable and hackable:

  • Entry point: bin/openbug.js
  • TUI components: index.tsx and src/components/*
  • Utilities: helpers/* and src/utils/*

Pull requests and issues welcome!


Support


License

MIT

About

OpenBug CLI is an intelligent command-line tool that helps you debug your applications in real-time using AI assistance. Run your commands, view logs, and get AI-powered insights all in one interactive terminal interface.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors