| .. | ||
| files.sh | ||
| readme.md | ||
KBot - Command Line AI Assistant
KBot is a powerful command line tool that leverages AI models to assist with code generation, file summarization, multi-file processing, and more.
Table of Contents
Installation
- Ensure you have Node.js installed (version 14+ recommended).
- Clone the repository:
git clone https://github.com/yourusername/kbot.git
cd kbot
- Install dependencies:
npm install
- Build the project (if applicable):
npm run build
Usage
KBot provides a rich set of commands for interacting with AI tools. Here are some common commands:
- Run a task:
kbot run --prompt "Summarize the project" --path ./src
- Fetch available models:
kbot fetch
- Modify configurations:
kbot init
Examples
Below are some usage examples:
- Summarize Project Files:
kbot run --prompt "Give me a summary of the project files" --path ./my_project --include "*.js"
- Generate Documentation:
kbot run --prompt "Generate documentation for the codebase" --dst ./docs/README.md
- Personalized Assistant:
Use your own preferences and profiles stored in ./.kbot/preferences.md for a personalized experience.
Architecture
The following Mermaid diagram illustrates the high-level architecture of KBot:
flowchart TD
Start[Start] --> Config[Load Config]
Config --> Init[Initialize Client]
Init --> Process[Process Request]
Process --> Options[Set Options]
Options --> Execute[Execute Task]
Execute --> End[Return Result]
The flow begins with startup, loads the configuration (preferences and settings), initializes the API client, gathers and processes user requests, sets task-specific options, executes the task (running the completion, tools, or assistant mode), and finally returns the result.
Configuration
KBot uses a configuration file located at ./.kbot/config.json and a preferences file at ./.kbot/preferences.md to customize behavior:
- config.json: Contains API keys and service configurations for OpenAI, OpenRouter, and more.
- preferences.md: Stores personal information to tailor the assistant responses.
Development
- Run tests:
npm test
- Build the project:
npm run build
- Lint the code:
npm run lint
Mermaid Diagrams
Mermaid diagrams are used to visually represent the various components and flows within KBot. Here is another example diagram illustrating the internal processing:
flowchart LR
User[User Input] --> CLI[Command Line Parser]
CLI --> Processor[Task Processor]
Processor --> API[API Client]
API --> Collector[Response Collector]
Collector --> Output[Display Output]
License
This project is licensed under the MIT License.