From Assistant to Agent: A Paradigm Shift
Most AI tools for the command line work as assistants: you ask, they answer. ChatCLI goes further, transforming the AI into an autonomous agent that doesn’t just respond, but acts. The Plugin System and Agentic AI bring this vision to life:- You: Define the objective and provide the tools (plugins)
- The Agent: Orchestrates execution, connecting perception, reasoning, and action to solve complex problems
This is not just a feature — it is the foundation for a new way of interacting with your development environment.
Plugin System Architecture
Automatic Discovery and Loading
ChatCLI uses an intelligent plugin manager that:Remote Plugins (Server-Side)
When connected to a server viachatcli connect, the client automatically discovers plugins available on the server. These plugins appear in /plugin list with the [remote] tag and are executed on the server via gRPC — no need to install anything locally.
The agent can use remote plugins the same way as local plugins — execution is transparent. When disconnecting, remote plugins are automatically removed from the listing.
Builtin Plugins
Some essential plugins come embedded in the ChatCLI binary and appear with the[builtin] tag. The main one is @coder, which provides the engineering suite for the /coder mode. Builtin plugins require no installation and cannot be uninstalled. If you install a custom version in ~/.chatcli/plugins/ with the same name, it takes precedence over the builtin.
Flexible Plugin Lookup
The system accepts both invocation forms:- With @ (canonical form)
- Without @ (convenient shortcut)
Agent Configuration
Environment Variables
Configure agent behavior through environment variables:| Variable | Type | Default | Description |
|---|---|---|---|
CHATCLI_AGENT_PLUGIN_MAX_TURNS | integer | 50 | Maximum number of ReAct cycle iterations. Prevents infinite loops (max: 200). |
CHATCLI_AGENT_PLUGIN_TIMEOUT | duration | 15m | Time limit for each plugin execution. Accepts Go format (30s, 5m, 1h). |
CHATCLI_AGENT_CMD_TIMEOUT | duration | 10m | Timeout for shell commands executed via @command (max: 1h). |
CHATCLI_AGENT_DENYLIST | string | - | Regular expressions separated by ; to block dangerous commands. |
CHATCLI_AGENT_ALLOW_SUDO | boolean | false | Allows sudo commands without automatic blocking (use with caution). |
CHATCLI_AGENT_PARALLEL_MODE | boolean | false | Enables multi-agent orchestration with parallel agents. |
CHATCLI_AGENT_MAX_WORKERS | integer | 4 | Maximum workers (goroutines) running agents in parallel. |
CHATCLI_AGENT_WORKER_MAX_TURNS | integer | 10 | Maximum turns of the mini ReAct loop for each worker agent. |
CHATCLI_AGENT_WORKER_TIMEOUT | duration | 5m | Timeout per individual worker agent. |
The ReAct Cycle: Reasoning and Action
The AgentMode implements the ReAct (Reasoning and Acting) framework, a transparent iterative loop:Plugin Management with /plugin
Available Commands
| Command | Description |
|---|---|
/plugin list | Lists all installed plugins with metadata |
/plugin install <url> | Installs a plugin from a Git repository (compiled languages) |
/plugin show <name> | Displays description and usage syntax |
/plugin inspect <name> | Shows raw metadata, path, and permissions |
/plugin uninstall <name> | Removes a plugin from the system |
/plugin reload | Forces a manual reload (rarely needed) |
Usage Example
- List plugins
- View details
- Inspect metadata
Installing Plugins
Creating Plugins: The Complete Guide
The Plugin Contract
Every plugin must follow these rules:Be an Executable
- Compiled binary (Go, Rust, C++) or
- Script with shebang (
#!/usr/bin/env python3,#!/bin/bash) - Located in
~/.chatcli/plugins/ - Execute permission required (
chmod +x)
Respond to the --metadata Contract (Required)
When invoked with All fields are required:
--metadata, the plugin MUST print valid JSON to stdout:name: Must start with@description: Used by the AI to decide when to use the toolusage: Invocation syntaxversion: Semantic versioning
Implement --schema (Optional, but Recommended)
The schema helps the AI understand the plugin’s parameters:
Communication via Standard I/O
| Channel | Usage | Description |
|---|---|---|
stdout | Result | Main output sent to the AI |
stderr | Logs/Progress | Status messages, warnings, and errors |
stdin | Data input | Large text blocks (e.g., generated code) |
args | Parameters | Command-line arguments |
stdout for the final result only, stderr for everything else (logs, progress, errors).Complete Example: @hello Plugin in Go
This example demonstrates all best practices:
Compilation and Installation
Testing the Plugin
The AI responds based on the plugin’s stdout. Example: “The plugin returned: Hello, Edilson! The current time is Mon, 02 Jan 2024 14:30:00 UTC.”
Debugging Plugins
Check if the Plugin Was Loaded
Check if the Plugin Was Loaded
Run
/plugin list. If the plugin does not appear:- Check permissions:
ls -l ~/.chatcli/plugins/— Must show-rwxr-xr-x(with ‘x’) - Test the
--metadatacontract:~/.chatcli/plugins/your-plugin --metadata— Must return valid JSON - Enable debug logs in
.env:
Test Plugin Manually
Test Plugin Manually
Before using in the agent, test directly:
- Test metadata:
~/.chatcli/plugins/your-plugin --metadata - Test schema:
~/.chatcli/plugins/your-plugin --schema - Test execution:
~/.chatcli/plugins/your-plugin arg1 arg2
Resolve Timeout Issues
Resolve Timeout Issues
If the plugin is being interrupted:
- Increase timeout globally:
export CHATCLI_AGENT_PLUGIN_TIMEOUT=30m - Or in
.env:CHATCLI_AGENT_PLUGIN_TIMEOUT=30m
Advanced Example: Docker Hub Plugin
This example demonstrates integration with an external API:Use Case
- Use
@dockerhub redisto list tags - Filter tags with “alpine”
- Select the most recent version
- Run
docker run redis:<alpine-tag> - Validate that the container is running
Supported Languages
Any language that can create an executable, interact with standard I/O (stdin/stdout/stderr), and process command-line arguments.Recommendations by Use Case
| Language | Best For | Advantages |
|---|---|---|
| Go | Production plugins | Static binaries, fast, portable |
| Rust | Critical performance | Memory safety, speed |
| Python | Rapid prototyping | Rich ecosystem, easy debugging |
| Bash | System scripts | Native shell integration |
| Node.js | API integrations | NPM, async/await |
Security and Best Practices
Input Validation
Always validate arguments before processing. Use
os.Exit(1) to signal errors to ChatCLI.Error Handling
A non-zero exit code signals an error to ChatCLI. Send error messages via
stderr.Internal Timeouts
Use
context.WithTimeout to prevent external operations from blocking the plugin indefinitely.Informative Logs
Send progress via
stderr so the user can follow the plugin’s execution in real time.Plugins in /coder Mode
The /coder mode is specialized in software engineering and uses the @coder plugin to execute its actions.@coder is a builtin plugin — it comes embedded in ChatCLI and works without installation.
In /coder, the AI emits tool calls in a strict format:
- First, it writes a short
reasoningblock (2 to 6 lines) - Then, it emits only one
tool_callwith JSON args
Next Steps
Plugin Examples
Explore the example plugins in the repository
Create Your First Plugin
Follow the
@hello template on this page to get startedShare with the Community
Publish plugins on GitHub for the ChatCLI ecosystem
Contribute
Contribute plugins to the ChatCLI ecosystem
The plugin system is your gateway to true automation. Start building your tools and transform your terminal into a teammate.