This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
make build # Build binary to ./devir
make build-all # Build for all platforms (dist/)
make test # Run tests
make lint # Run golangci-lint
make install # Build and copy to /usr/local/bin
make clean # Remove build artifactsDevir is a terminal UI for managing multiple dev services. Written in Go using Bubble Tea TUI framework.
cmd/devir/main.go # Entry point, CLI flags, mode selection (TUI vs MCP)
internal/
config/ # YAML config loading, service validation
types/ # Shared types (LogLine, LogEntry, ServiceInfo)
runner/ # Service lifecycle management, log processing
tui/ # Bubble Tea model, view rendering, keyboard handling
mcp/ # MCP server for Claude Code integration
Runner (internal/runner/runner.go):
- Manages service processes with platform-specific handling (Unix/Windows)
- Channels for log streaming:
LogChan(simple mode),LogEntryChan(TUI mode) - Log filtering via compiled regex (
filter,excludepatterns) - Port detection and process killing via
process_unix.go/process_windows.go
TUI Model (internal/tui/):
- Bubble Tea architecture: Model → Update → View cycle
- Tab-based service filtering (
activeTab: -1=all, 0+=specific) - Auto-scroll with manual override on user scroll
- 50ms tick for log collection
MCP Server (internal/mcp/mcp.go):
- Exposes 7 tools:
devir_start,devir_stop,devir_status,devir_logs,devir_restart,devir_check_ports,devir_kill_ports - Uses
go-sdk/mcpwith stdio transport - Same runner infrastructure as TUI mode
Config file: devir.yaml (searched in current dir and parents)
services:
name:
dir: relative/path # Working directory
cmd: command to run # Command to execute
port: 3000 # Port for status display
color: blue # Log prefix color
defaults:
- name # Services to start by defaultgithub.com/charmbracelet/bubbletea- TUI frameworkgithub.com/charmbracelet/bubbles- TUI components (viewport, textinput)github.com/charmbracelet/lipgloss- Stylinggithub.com/modelcontextprotocol/go-sdk- MCP servergopkg.in/yaml.v3- Config parsing