| .. | ||
| files.sh | ||
| readme.md | ||
KBot Command Line Interface
Welcome to KBot CLI – a versatile command line tool designed to help you integrate and utilize AI-powered functionalities in your projects. This guide covers installation, configuration, usage, examples, and system architecture using Mermaid diagrams.
Table of Contents
Installation
Prerequisites
- Node.js (version 14 or later)
- npm (comes with Node.js) or yarn
Steps
- Clone the repository:
git clone https://github.com/yourusername/kbot-cli.git
cd kbot-cli
- Install dependencies:
npm install
# or
yarn install
- Build the project (if applicable):
npm run build
- (Optional) Run tests to verify installation:
npm test
Configuration
KBot CLI requires some configuration files to run properly. Upon initialization, it creates a hidden configuration directory (e.g., .kbot) in your project root. Important files include:
- preferences.md: Contains your personal preferences for contextual responses.
- config.json: Stores API keys and other configuration settings.
You can customize these files to suit your needs.
Usage
KBot CLI offers multiple modes:
- Completion Mode: Fetches completions based on your prompts.
- Tools Mode: Integrates with external tools for various functionalities.
- Assistant Mode: Provides conversational AI assistance.
Basic Command
Run the tool with a prompt and options:
kbot "Your prompt goes here" --mode completion --model text-davinci-003
Example: Processing a File
To process a specific file, pass the file path using the --include flag:
kbot "Summarize the following code" --include ./src/index.js
Examples
Refer to the examples section for sample commands and workflows. You can generate and view detailed examples and markdown documentation directly in your terminal.
Architecture
KBot CLI is modular with distinct components:
- Option Completion: Validates and configures task options.
- Message Aggregation: Gathers prompts, preferences, and source files.
- Parameter Construction: Prepares API request parameters.
- Request Execution: Executes API calls in different modes (completion, tools, assistant).
Below is a high-level overview of the workflow:
flowchart LR
Start[Start]
Options[Complete Options]
Messages[Gather Messages]
Params[Configure Parameters]
Client[Setup API Client]
Execute[Execute Request]
End[Display Result]
Start --> Options
Options --> Messages
Messages --> Params
Params --> Client
Client --> Execute
Execute --> End
Mermaid Diagrams
Here are some additional Mermaid diagrams to illustrate various processes without using braces in node names:
Process Flow Diagram
flowchart LR
Input[User Input]
Validate[Validate Options]
Configure[Configure API Parameters]
Call[Call API]
Output[Return Response]
Input --> Validate
Validate --> Configure
Configure --> Call
Call --> Output
File Processing Workflow
flowchart TD
ReadFile[Read Source File]
ParseFile[Parse Content]
ApplyFilters[Apply Filters]
GenerateOutput[Generate Output]
ReadFile --> ParseFile
ParseFile --> ApplyFilters
ApplyFilters --> GenerateOutput
Note: All node names in these diagrams are enclosed in square brackets to ensure no curly braces are used.
Contributing
Contributions are welcome! If you wish to enhance KBot CLI further, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Write tests for your changes.
- Open a pull request with a detailed description of your changes.
Ensure your code adheres to the established project style and best practices.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Happy coding with KBot CLI!