@kibibit/kibi
v1.9.0
Published
Local-first AI agent CLI tool with TUI and MCP integration
Readme
Kibi
A local-first AI agent CLI tool with TUI (Terminal User Interface) and MCP (Model Context Protocol) integration.
Description
Kibi is a command-line AI agent that connects to local LLM endpoints (like LM Studio, LiteLLM) or cloud providers (OpenAI-compatible APIs). It provides an interactive terminal UI for chatting with AI models and executing tools, with support for MCP servers for extensibility.
Features
- Local-First: Works with local LLM endpoints (LM Studio, LiteLLM) or cloud providers
- Interactive TUI: Beautiful terminal user interface built with Ink/React
- Tool Execution: Built-in tools (file operations, bash commands) with approval workflow
- MCP Integration: Connect to Model Context Protocol servers for extensibility
- Chat Persistence: Save and resume chat sessions
- Print Mode: Non-interactive mode for scripting and automation
- Streaming Responses: Real-time streaming of LLM responses
Installation
Prerequisites
- Node.js 18+ and npm
- TypeScript 5.0+
Install Dependencies
npm installBuild
npm run buildDevelopment
Run in watch mode during development:
npm run devUsage
Basic Usage
Start the interactive TUI:
npm start
# or
node bin/kibiPrint Mode
Run in non-interactive mode (for scripting):
node bin/kibi --print "Your prompt here"Available Commands
kibi agent [prompt]- Start AI agent (default command)kibi chat list- List saved chatskibi chat resume <chatId>- Resume a saved chatkibi mcp status- Show MCP server statuskibi login- Authenticate with API providerkibi status- Show current configuration and status
Configuration
Configuration is stored in ~/.kibi/config.json. You can configure:
- Default model and provider
- API keys (stored securely)
- MCP server connections
- Tool approval settings
- UI preferences
Project Structure
kibi/
├── src/
│ ├── cli/ # CLI command parsing and routing
│ ├── agent/ # Core agent logic and LLM integration
│ ├── tools/ # Tool execution and management
│ ├── mcp/ # MCP server integration
│ ├── chat/ # Chat persistence
│ ├── config/ # Configuration management
│ ├── output/ # Output formatters (print mode)
│ ├── tui/ # Terminal UI components
│ ├── types/ # Shared TypeScript types
│ └── utils/ # Shared utilities
├── bin/ # Executable scripts
├── tests/ # Test files
└── docs/ # DocumentationDevelopment
Scripts
npm run build- Compile TypeScript to JavaScriptnpm run dev- Run in watch mode with tsxnpm start- Run compiled codenpm test- Run tests with vitestnpm run lint- Run linter (when configured)
Architecture
Kibi follows a modular architecture with clear boundaries:
- CLI Module: Command-line interface and argument parsing
- TUI Module: Interactive terminal UI (Ink/React)
- Agent Core: LLM integration and conversation management
- Tools Module: Tool execution with approval workflow
- MCP Integration: Model Context Protocol server management
- Chat Persistence: File-based chat storage
- Configuration: Settings and credential management
- Output Formatters: Print mode output formatting
See docs/kibi-cli-agent-v1/planning/system-architecture.md for detailed architecture documentation.
License
ISC
Contributing
This project is in active development. See the documentation in docs/ for implementation specifications and architecture details.
