Skip to content

smtdfc/nagare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nagare AI Agent

Overview

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.

Repository Structure

.
├─ .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)

Prerequisites

  • Go 1.26+ (the project specifies go 1.26.3 in go.mod)
  • Access to an OpenAI‑compatible API endpoint (or another provider supporting the same schema)

Installation

# Clone the repository
git clone https://github.com/smtdfc/nagare.git
cd nagare

# Download dependencies
go mod tidy

Build

# Build the binary
go build -o nagare ./cli

Run directly (development)

go run ./cli

Configuration

The 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: true

Place the file at ~/.nagare.yaml or set the NAGARE_CONFIG environment variable to point to a custom location.

Usage

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:

nagare

Inside 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)

Extending the Agent

Adding a New Provider

  1. Implement a model that satisfies model.ChatModel (see core/model/openai_compatible.go).
  2. Register the provider in core/config/config.go with a matching ProviderCompatible value.

Adding a New Tool

  1. Define a new tool struct implementing tool.Tool in core/tool/.
  2. Register the tool in core/tool/declarations/tools.go.
  3. The TUI will automatically display tool calls.

Development

  • Running tests (if any): go test ./...
  • Linting: golangci-lint run (recommended)
  • Hot‑reload: Use air or similar tools for rapid UI iteration.

License

This project is licensed under the MIT License – see the LICENSE file for details.


Generated by Antigravity – your AI coding assistant.

About

My assistant

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages