Nagare is a terminal‑based AI agent built with Go. It provides an interactive TUI (Text User Interface) powered by Bubble Tea, Lipgloss, and Bubble components. Users can chat with the agent, invoke tools, and view reasoning steps in real time. The application is modular, separating the core chatbot logic, configuration, agent pooling, and the CLI/TUI front‑end.
.
├─ .git/ # Git version control
├─ .vscode/ # VS Code workspace settings
├─ cli/ # Command‑line interface
│ ├─ cmd/ # Cobra root command implementation
│ ├─ main.go # Entry point
│ └─ tui/ # Text‑based UI
│ ├─ root.go # Main TUI entry point
│ └─ pages/ # Individual pages (chat, settings, …)
├─ core/ # Core business logic
│ ├─ agent/ # Agent pool and session handling
│ ├─ config/ # Configuration structs & loader
│ ├─ context/ # Execution context for tools
│ ├─ logger/ # Simple logger wrapper
│ ├─ messages/ # Message types used by the agent
│ ├─ model/ # Model abstraction (OpenAI compatible client)
│ ├─ tool/ # Tool declarations & implementations
│ └─ chat.go # Helper to initialise the agent
├─ go.mod # Go module definition
└─ go.work # Workspace definition (if any)
- Go 1.26+ (the project specifies
go 1.26.3ingo.mod) - Access to an OpenAI‑compatible API endpoint (or another provider supporting the same schema)
# Clone the repository
git clone https://github.com/smtdfc/nagare.git
cd nagare
# Download dependencies
go mod tidy# Build the binary
go build -o nagare ./cligo run ./cliThe agent reads configuration from a YAML/JSON file (default location: $HOME/.nagare.yaml). A minimal example:
current_provider: OpenAI
providers:
OpenAI:
name: OpenAI
base_url: https://api.openai.com/v1
compatible: openai
api_key: YOUR_API_KEY
model_name: gpt-4o-mini
enabled: truePlace the file at ~/.nagare.yaml or set the NAGARE_CONFIG environment variable to point to a custom location.
The main command is nagare (defined in cli/cmd/root.go). Available sub‑commands are added via the Cobra framework. The default behaviour starts the TUI:
nagareInside the TUI you can:
- Type a message and press Enter to send it to the agent.
- Use the following shortcuts (handled in
handler.go):/exit– quit the application./settings– open the settings page where you can edit providers and plugins.
- The UI shows:
- Agent messages (green)
- Reasoning steps (italic, gray)
- Tool calls (italic, yellow)
- Implement a model that satisfies
model.ChatModel(seecore/model/openai_compatible.go). - Register the provider in
core/config/config.gowith a matchingProviderCompatiblevalue.
- Define a new tool struct implementing
tool.Toolincore/tool/. - Register the tool in
core/tool/declarations/tools.go. - The TUI will automatically display tool calls.
- Running tests (if any):
go test ./... - Linting:
golangci-lint run(recommended) - Hot‑reload: Use
airor similar tools for rapid UI iteration.
This project is licensed under the MIT License – see the LICENSE file for details.
Generated by Antigravity – your AI coding assistant.