DocBot is a command-line tool designed to help you automatically document your code! It's flexible, allowing you to select different models for documentation generation, output options, and more.
- Easy to Use: Document your code with a single command.
- Model Selection: Choose different AI models for documentation.
- Customizable: Change output filenames, base URLs, and enable verbose logging.
-
TOML support: Define a
.docbot-config.toml
file in your home directory (~
) to define personalized configuration settings such as the default model, output file, base url, logging preferences, base API URLs, and output file path.
Before installing, make sure you have the following:
- Node.js (v14 or higher recommended)
-
Ollama (Optional, required if using the
gemma2
model or others from Ollama)
npm i docbot
to install as a project dependency
-
Clone the repository:
git clone git@github.com:Add00/DocBot.git cd DocBot
-
(Optional) Run Ollama with the default model:
ollama run gemma2:2b
Note: This step is only necessary if you're using the gemma2:2b model. You can select a different model manually using the -m flag during usage.
-
Run DocBot:
npm run docbot -- [files...]
npm run docbot -- [files...]
Option | Description | Type | Default |
---|---|---|---|
-m, --model |
Select a different model, make sure that it is available | string |
"gemma2:2b" |
-o, --output |
Change the name of the output file | string |
null |
-b, --base-url |
Change the base-url, defaults to localhost | string |
"http://127.0.0.1:11434" |
-V, --verbose |
Run with verbose logging | boolean |
false |
-h, --help |
Show help | boolean |
|
-v, --version |
Show version number | boolean |
You can create a TOML config file named .docbot-config.toml
that contains all your configuration for the tool and place it in your home
directory.
Here is an example TOML file you can use:
model = "gemma2:2b"
baseUrl = "http://127.0.0.1:11434"
verbose = false
tokenUsage = false
stream = false
- Basic usage with default settings:
npm run docbot -- myFile.js
- Specify a custom model and output file:
npm run docbot -- myFile.js -m llama2 -o docs.md
- Run with verbose logging:
npm run docbot -- myFile.js -V
This project is licensed under the MIT License.