Witty CLI Agent Introduction
Preface
Witty CLI ships with the built-in agent witty-builtin-agent. It targets openEuler operating system scenarios and provides knowledge Q&A, command lookup, fault diagnosis, solution planning, and visual reports. It uses experience-skill as its core knowledge engine and the openEuler Portal MCP for real-time data from the official site, and it accumulates experience over time.
Default Agent
| Agent Name | Mode | Positioning |
|---|---|---|
witty-builtin-agent | primary | Knowledge Q&A, command lookup, fault diagnosis, solution planning, and visual reports |
After installing witty, witty-builtin-agent is the default agent. The prompt shows the current agent when running witty:
witty [witty-builtin-agent] >Use /agent <name> to switch to another installed agent, such as the OpenCode built-in build and plan:
/agent buildCore Capabilities
Built-in Tools
| Tool | Description |
|---|---|
bash | Runs shell commands on the user machine for system information queries, troubleshooting, and read-only checks; dangerous actions require user confirmation |
read / grep / glob | Reads and searches file contents, such as logs and configuration files |
webfetch / websearch | Retrieves information from the internet |
Core Skills
The agent relies on the following Skills for complex tasks:
| Skill | Purpose |
|---|---|
experience-skill | Core knowledge engine; queries the local experience library before answering |
manpage-skill | Looks up usage, options, and examples of Linux / openEuler commands |
log-anomaly-detector | Analyzes system logs and performance metrics for preliminary fault localization |
html-report-generator | Renders diagnostic reports and solutions as web pages |
brainstorm-beagle | Produces complete actionable solutions when user goals are unclear |
plantuml-skill | Draws flowcharts, sequence diagrams, and architecture diagrams |
openEuler Portal MCP
The agent queries real-time data from the openEuler official site through the openEuler Portal MCP, covering compatibility, CVE, packages, documents, SIGs, issues and pull requests. The related tokens (OPENEULER_TOKEN, GITCODE_TOKEN, FORUM_TOKEN) are injected through environment variables; no manual configuration is required.
witty-diagnosis-agentis an optional diagnostic capability package that injects diagnostic Skills and plugins into opencode. Runwitty server restartafter installation for it to take effect.
Usage Examples
The following shows typical interactions with the built-in agent; the GIFs record the full process.
Scenario 1: Basic System Operations
Input: create new user "demo", and set the SSH password of user demo to Demo@12345
The agent converts natural language into shell commands and asks for confirmation before execution to prevent mistakes.
Scenario 2: North-South Compatibility Analysis
Input: why is the Broadcom 9500-8i adapter not recognized on openEuler 20.03
The agent calls openEuler Portal MCP tools for forum search, documentation search, and hardware compatibility queries, searches the whole openEuler community for related cases and solutions, and quickly locates the root cause of the compatibility issue.
Working Principles
Query Experience First, Then Answer
When the user raises a technical question, a fault symptom, or a requirement, the agent proceeds in this order:
- Call
experience-skillto query the local experience library; - If local experience is insufficient, call openEuler Portal MCP for real-time official site data;
- Combine local experience and MCP results, and answer with timeliness annotations.
Timeliness Annotation
For factual content, the agent annotates:
- Local experience: the last update time;
- MCP official site data: the query time;
- Timeliness status:
valid/outdated/uncertain.
Safety First
- Read-only commands run directly: system information queries, file reads, and status checks need no extra confirmation;
- Dangerous commands require user confirmation: changing system configuration, installing software, restarting services, and deleting files require the agent to explain the risk and wait for confirmation;
- Always provide risk warnings and read-only verification suggestions when risk is involved;
- Sensitive data such as system logs and configuration is processed locally and is not uploaded without authorization.
Skill Orchestration
For complex tasks, the agent combines multiple Skills:
- Fault diagnosis:
log-anomaly-detector→experience-skill(+ MCP) →brainstorm-beagle→plantuml-skill→html-report-generator - Command consultation:
manpage-skill→experience-skill, supplementing scenarios and caveats - Solution planning:
brainstorm-beagle→experience-skill(+ MCP for documents) →plantuml-skill→html-report-generator - Compatibility and package queries:
experience-skill→ openEuler Portal MCP
Result Output
- Simple Q&A: a concise direct answer;
- Diagnosis and planning: structured Markdown, followed by a question on whether to render a web report with
html-report-generator; - Flows and architecture: drawing with
plantuml-skill.
Experience Accumulation
After solving a new problem that does not exist in the local experience library, the agent asks:
Should this problem and its solution be added to the experience-skill library for later reuse?
Using experience-skill
experience-skill is the experience skill management component. It manages the accumulation of user work experience and supports the full lifecycle of two resource types, Skill (workflow skills) and Wiki (distilled documents).
CLI Commands
| Subcommand | Purpose |
|---|---|
sync | Sync all experiences in data/ to the database |
add-experiences | Add Skill/Wiki experiences to the database |
list-experiences | List experiences with pagination, filtered by type, name, or popularity |
search-experiences | Full-text search over experiences, based on SQLite + FTS5 |
delete-by-ids / delete-by-source / delete-all | Delete experiences |
web | Start the experience management web interface, default http://127.0.0.1:8080 |
Skill / Wiki Management
- create-skill / create-wiki: turn conversations or consulted materials into standardized Skills/Wikis, with automatic duplicate checks before creation;
- eval-skill / eval-wiki: quality verification against an evaluation set;
- find-skill / find-wiki: locate resources through keyword and full-text search;
- merge-skill / merge-wiki: merge similar content and remove duplicates;
- optimize-skill / optimize-wiki: iterate and optimize based on evaluation results.


