|
1 | 1 | # Codebolt CLI Tool
|
2 | 2 |
|
3 | 3 | ## Description
|
4 |
| -Codebolt is a CLI tool created using Node.js. It allows users to check the application version and upload folders to a specified server. |
| 4 | +Codebolt is a comprehensive CLI tool created using Node.js. It allows developers to create, manage, and publish AI agents and MCP (Model Context Protocol) tools, along with various utility functions for development. |
5 | 5 |
|
6 | 6 | ## Installation
|
7 |
| -To install Codebolt CLI tool locally, ensure you have Node.js and npm installed, then run: |
| 7 | +To install Codebolt CLI tool globally, ensure you have Node.js and npm installed, then run: |
8 | 8 |
|
| 9 | +```bash |
9 | 10 | npm install -g codebolt-cli
|
| 11 | +``` |
10 | 12 |
|
11 |
| -## Usage |
| 13 | +## Authentication |
| 14 | +Before using most features, you'll need to authenticate: |
12 | 15 |
|
13 |
| -### Check Version |
14 |
| -To check the application version, run: |
15 |
| -codebolt version |
| 16 | +```bash |
| 17 | +codebolt-cli login |
| 18 | +``` |
16 | 19 |
|
17 |
| -### Upload Folder |
18 |
| -To upload a folder to the server, run: |
19 |
| -codebolt upload <folderPath> |
| 20 | +To logout: |
| 21 | +```bash |
| 22 | +codebolt-cli logout |
| 23 | +``` |
20 | 24 |
|
21 |
| -Replace `<folderPath>` with the path to the folder you want to upload. |
| 25 | +## Commands |
| 26 | + |
| 27 | +### Version |
| 28 | +Check the application version: |
| 29 | +```bash |
| 30 | +codebolt-cli version |
| 31 | +``` |
| 32 | + |
| 33 | +### Agent Management |
| 34 | + |
| 35 | +#### Create Agent |
| 36 | +Create a new Codebolt Agent: |
| 37 | +```bash |
| 38 | +codebolt-cli createagent |
| 39 | +codebolt-cli createagent -n "MyAgent" --quick |
| 40 | +``` |
| 41 | + |
| 42 | +#### Publish Agent |
| 43 | +Publish an agent to the registry: |
| 44 | +```bash |
| 45 | +codebolt-cli publishagent [folderPath] |
| 46 | +``` |
| 47 | + |
| 48 | +#### List Agents |
| 49 | +List all agents created and uploaded by you: |
| 50 | +```bash |
| 51 | +codebolt-cli listagents |
| 52 | +``` |
| 53 | + |
| 54 | +#### Start Agent |
| 55 | +Start an agent in the specified working directory: |
| 56 | +```bash |
| 57 | +codebolt-cli startagent [workingDir] |
| 58 | +``` |
| 59 | + |
| 60 | +#### Pull Agent |
| 61 | +Pull the latest agent configuration from server: |
| 62 | +```bash |
| 63 | +codebolt-cli pullagent [workingDir] |
| 64 | +``` |
| 65 | + |
| 66 | +#### Clone Agent |
| 67 | +Clone an agent using its unique_id: |
| 68 | +```bash |
| 69 | +codebolt-cli cloneagent <unique_id> [targetDir] |
| 70 | +``` |
| 71 | + |
| 72 | +### MCP Tool Management |
| 73 | + |
| 74 | +#### Create Tool |
| 75 | +Create a new MCP (Model Context Protocol) tool: |
| 76 | +```bash |
| 77 | +codebolt-cli createtool |
| 78 | +codebolt-cli createtool -n "MyTool" -i "my-tool-id" -d "Tool description" |
| 79 | +``` |
| 80 | + |
| 81 | +Options: |
| 82 | +- `-n, --name <name>`: Name of the tool |
| 83 | +- `-i, --id <unique-id>`: Unique identifier (no spaces) |
| 84 | +- `-d, --description <description>`: Description of the tool |
| 85 | +- `-p, --parameters <json>`: Tool parameters in JSON format |
| 86 | + |
| 87 | +#### Publish Tool |
| 88 | +Publish an MCP tool to the registry: |
| 89 | +```bash |
| 90 | +codebolt-cli publishtool [folderPath] |
| 91 | +``` |
| 92 | + |
| 93 | +This command will: |
| 94 | +- Read the `codebolttool.yaml` configuration file |
| 95 | +- Package and upload the tool's source code |
| 96 | +- Register the tool in the MCP registry |
| 97 | +- Handle both new tool creation and updates |
| 98 | + |
| 99 | +**Requirements for publishing:** |
| 100 | +- A `codebolttool.yaml` file must be present in the tool directory |
| 101 | +- Required fields in `codebolttool.yaml`: `name`, `uniqueName`, `description` |
| 102 | + |
| 103 | +**Interactive prompts for new tools:** |
| 104 | +- GitHub repository URL (optional) |
| 105 | +- Category selection |
| 106 | +- Tags (comma-separated) |
| 107 | +- API key requirement |
| 108 | + |
| 109 | +#### List Tools |
| 110 | +List all MCP tools published by you: |
| 111 | +```bash |
| 112 | +codebolt-cli listtools |
| 113 | +``` |
| 114 | + |
| 115 | +#### Pull Tools |
| 116 | +Pull the latest MCP tool configuration from server: |
| 117 | +```bash |
| 118 | +codebolt-cli pulltools [workingDir] |
| 119 | +``` |
| 120 | + |
| 121 | +This command will: |
| 122 | +- Read your local `codebolttool.yaml` file |
| 123 | +- Fetch the latest configuration from the server |
| 124 | +- Compare versions and prompt for confirmation if needed |
| 125 | +- Update your local configuration file |
| 126 | + |
| 127 | +#### Run Tool |
| 128 | +Run a specified tool with a file: |
| 129 | +```bash |
| 130 | +codebolt-cli runtool <command> <file> |
| 131 | +``` |
| 132 | + |
| 133 | +#### Inspect Tool |
| 134 | +Inspect a server file using the MCP inspector: |
| 135 | +```bash |
| 136 | +codebolt-cli inspecttool <file> |
| 137 | +``` |
| 138 | + |
| 139 | +## MCP Tool Configuration |
| 140 | + |
| 141 | +When creating or publishing MCP tools, ensure your `codebolttool.yaml` file contains: |
| 142 | + |
| 143 | +```yaml |
| 144 | +name: "My MCP Tool" |
| 145 | +uniqueName: "my-mcp-tool" |
| 146 | +description: "Description of what this tool does" |
| 147 | +version: "1.0.0" |
| 148 | +parameters: |
| 149 | + param1: "value1" |
| 150 | + param2: "value2" |
| 151 | +``` |
| 152 | +
|
| 153 | +## File Structure |
| 154 | +
|
| 155 | +### For Agents |
| 156 | +Agents should contain a `codeboltagent.yaml` configuration file. |
| 157 | + |
| 158 | +### For MCP Tools |
| 159 | +MCP tools should contain a `codebolttool.yaml` configuration file and follow the MCP protocol standards. |
| 160 | + |
| 161 | +## Examples |
| 162 | + |
| 163 | +### Publishing a new MCP tool: |
| 164 | +```bash |
| 165 | +cd my-mcp-tool-directory |
| 166 | +codebolt-cli publishtool |
| 167 | +``` |
| 168 | + |
| 169 | +### Updating an existing MCP tool: |
| 170 | +```bash |
| 171 | +cd my-existing-tool |
| 172 | +codebolt-cli publishtool |
| 173 | +``` |
| 174 | + |
| 175 | +The CLI will automatically detect if it's an update based on the `uniqueName` in your configuration. |
| 176 | + |
| 177 | +## Error Handling |
| 178 | +The CLI provides detailed error messages and colored output for better user experience. Make sure you're authenticated and have the required configuration files before running publish commands. |
22 | 179 |
|
23 | 180 | ## Author
|
24 |
| -Your Name |
| 181 | +Codebolt Team |
25 | 182 |
|
26 | 183 | ## License
|
27 | 184 | ISC
|
0 commit comments