Skip to main content

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:
1

Monitors the directory

Monitors ~/.chatcli/plugins/ using fsnotify
2

Detects changes

Detects changes in real time (file creation, modification, removal)
3

Applies debounce

Applies a 500ms debounce to avoid multiple reloads
4

Validates the contract

Validates each plugin’s contract before loading it
5

Reloads automatically

Reloads automatically without needing to restart ChatCLI

Remote Plugins (Server-Side)

When connected to a server via chatcli 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. 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:
Internally, the manager normalizes automatically:

Agent Configuration

Environment Variables

Configure agent behavior through environment variables:
When CHATCLI_AGENT_PARALLEL_MODE=true, the orchestrator LLM can dispatch 12 specialist agents (FileAgent, CoderAgent, ShellAgent, GitAgent, SearchAgent, PlannerAgent, ReviewerAgent, TesterAgent, RefactorAgent, DiagnosticsAgent, FormatterAgent, DepsAgent) in parallel. See the full documentation.

The ReAct Cycle: Reasoning and Action

The AgentMode implements the ReAct (Reasoning and Acting) framework, a transparent iterative loop:
1

Reasoning (Thought)

The agent analyzes the objective and verbalizes its plan:
2

Action (Tool Call)

The AI formalizes its decision in a structured call:
The parser also accepts the shorter <tool ... /> spelling — models backed by other agent CLIs (Devin, Codex, Claude Code) often shorten the tag. ChatCLI always emits the canonical <tool_call>, but is liberal in what it accepts.
3

Execution (Plugin Invocation)

ChatCLI intercepts and executes the plugin:
4

Observation (Feedback)

The result is formatted and returned to the AI:
5

Reiteration

The cycle restarts until the objective is achieved or the turn limit is reached.

Plugin Management with /plugin

Available Commands

Usage Example

Installing Plugins

You are about to install third-party code that will be executed on your machine. Review the source code before proceeding.

Creating Plugins: The Complete Guide

The Plugin Contract

Every plugin must follow these rules:
1

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)
2

Respond to the --metadata Contract (Required)

When invoked with --metadata, the plugin MUST print valid JSON to stdout:
All fields are required:
  • name: Must start with @
  • description: Used by the AI to decide when to use the tool
  • usage: Invocation syntax
  • version: Semantic versioning
3

Implement --schema (Optional, but Recommended)

The schema helps the AI understand the plugin’s parameters:
4

Communication via Standard I/O

Golden Rule: 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

1

Compile

2

Grant execute permission (CRITICAL!)

3

Move to the plugins directory

4

Verify 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

Run /plugin list. If the plugin does not appear:
  1. Check permissions: ls -l ~/.chatcli/plugins/ — Must show -rwxr-xr-x (with ‘x’)
  2. Test the --metadata contract: ~/.chatcli/plugins/your-plugin --metadata — Must return valid JSON
  3. Enable debug logs in .env:
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
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

The agent will:
  1. Use @dockerhub redis to list tags
  2. Filter tags with “alpine”
  3. Select the most recent version
  4. Run docker run redis:<alpine-tag>
  5. 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


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 reasoning block (2 to 6 lines)
  • Then, it emits only one tool_call with JSON args
Examples of actual calls (that the AI emits in /coder):
See more at Coder Mode and Plugin @coder.

Next Steps

Plugin Examples

Explore the example plugins in the repository

Create Your First Plugin

Follow the @hello template on this page to get started

Share 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.