{"id":"9c025392-8c1a-4579-9323-73a111ea942c","slug":"co-shell","kind":"skill","name":"co-shell","summary":"通过自然语言执行任何系统命令","owner":"idirect3d","repoUrl":"https://github.com/idirect3d/co-shell","license":"MIT","licenseTier":"permissive","trust":"community","stars":4,"match":null,"fewStars":true,"format":"skill","createdAt":"2026-04-25T06:26:28.000Z","addedAt":"2026-10-21T17:16:12.572Z","logoUrl":"https://avatars.githubusercontent.com/u/26537704?u=49ac1c9d19b8b1443039d5ad8a58a06746532579&v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["writing"],"tags":[],"runtime":"go","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-25T19:05:08.593Z","sample":false,"url":"https://conduits.dev/tools/co-shell","language":"Go","transports":["stdio"],"install":{},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"# co-shell\n\n> Intelligent Command-Line Shell — Interact with AI Agent via natural language to intelligently orchestrate and execute system commands.\n\n[![Go Version](https://img.shields.io/badge/Go-1.22+-00ADD8?logo=go)](https://golang.org)\n[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![Build](https://img.shields.io/badge/Build-00193-blue)]()\n\n[![中文](https://img.shields.io/badge/README-中文-blue)](docs/zh-CN/README.md)\n\n---\n\n## Introduction\n\n**co-shell** is a universal command — simple yet powerful.\n\nAt just ~10MB with zero external dependencies, it can orchestrate virtually every capability of your computer with a single instruction. To accomplish a task, it can call upon almost any command it knows, with virtually no limits. It's safe — every command execution requires your consent; it's transparent — every command is displayed before execution.\n\nAnd remember, it's just a command itself — it can call itself. Infinite possibilities?\n\n> **Your imagination is its fuel — the command is everything.**\n\nNo more memorizing complex command parameters. Just say what you want, and co-shell will automatically understand, orchestrate, and execute the appropriate system commands, programs, or scripts.\n\n```bash\n# Traditional way\n$ find . -type f -name \"*.go\" | xargs wc -l | tail -1\n\n# co-shell way\n❯ Count all lines of Go source code in this project\n```\n\n### ⚠️ Disclaimer\n\nco-shell is an intelligent command-line tool powered by Large Language Models (LLM). AI models may generate and execute dangerous commands including:\n\n- Deleting files or directories (e.g., `rm -rf /`)\n- Formatting disks (e.g., `mkfs`, `format`)\n- Modifying critical system configurations\n- Shutting down or rebooting the system\n- Downloading and executing untrusted programs\n- Leaking sensitive information (e.g., API keys, passwords, credentials)\n\nBy using this software, you acknowledge that you fully understand the above risks and agree to assume all responsibility for any loss or damage resulting from its use. The developers and publishers assume no liability.\n\n> The full disclaimer is shown on first launch and requires confirmation. It will not be shown again after acceptance.\n\n### Key Features\n\n- 🗣️ **Natural Language Interaction** — Describe tasks in plain English\n- 🤖 **AI Agent Driven** — Intelligent intent understanding, command orchestration, execution, and result analysis\n- 🔧 **MCP Protocol Support** — Access a rich ecosystem of MCP tools (filesystem, GitHub, databases, etc.)\n- 💾 **Persistent Memory** — Agent remembers your preferences and historical context\n- 📜 **Session History** — Browse past commands with arrow keys\n- ⚡ **Streaming Output** — Real-time display of AI thinking and command execution results\n- 🔌 **Extensible** — Custom rules, MCP Servers, multi-model switching\n\n---\n\n## Quick Start\n\n### Installation\n\n#### Option 1: Download Binary (Recommended)\n\nDownload the zip archive for your platform from the [Releases](https://github.com/idirect3d/co-shell/releases) page:\n\n| OS | Architecture | Download |\n|---|---|---|\n| macOS | Intel | [co-shell-0.7.5-darwin-amd64.zip](https://github.com/idirect3d/co-shell/releases/download/v0.7.5/co-shell-0.7.5-darwin-amd64.zip) |\n| macOS | Apple Silicon | [co-shell-0.7.5-darwin-arm64.zip](https://github.com/idirect3d/co-shell/releases/download/v0.7.5/co-shell-0.7.5-darwin-arm64.zip) |\n| Linux | x86_64 | [co-shell-0.7.5-linux-amd64.zip](https://github.com/idirect3d/co-shell/releases/download/v0.7.5/co-shell-0.7.5-linux-amd64.zip) |\n| Linux | ARM64 | [co-shell-0.7.5-linux-arm64.zip](https://github.com/idirect3d/co-shell/releases/download/v0.7.5/co-shell-0.7.5-linux-arm64.zip) |\n| Windows | x86_64 | [co-shell-0.7.5-windows-amd64.zip](https://github.com/idirect3d/co-shell/releases/download/v0.7.5/co-shell-0.7.5-windows-amd64.zip) |\n| Windows | ARM64 | [co-shell-0.7.5-windows-arm64.zip](https://github.com/idirect3d/co-shell/releases/download/v0.7.5/co-shell-0.7.5-windows-arm64.zip) |\n| 工具 | 跨平台 | [md2docx.py](https://github.com/idirect3d/co-shell/releases/download/v0.7.5/md2docx.py) — Markdown 转 Word 文档转换器 |\n| **Bridge** | macOS Intel | [co-shell-bridge-0.7.5-darwin-amd64.zip](https://github.com/idirect3d/co-shell/releases/download/v0.7.5/co-shell-bridge-0.7.5-darwin-amd64.zip) |\n| **Bridge** | macOS Apple Silicon | [co-shell-bridge-0.7.5-darwin-arm64.zip](https://github.com/idirect3d/co-shell/releases/download/v0.7.5/co-shell-bridge-0.7.5-darwin-arm64.zip) |\n| **Bridge** | Linux x86_64 | [co-shell-bridge-0.7.5-linux-amd64.zip](https://github.com/idirect3d/co-shell/releases/download/v0.7.5/co-shell-bridge-0.7.5-linux-amd64.zip) |\n| **Bridge** | Linux ARM64 | [co-shell-bridge-0.7.5-linux-arm64.zip](https://github.com/idirect3d/co-shell/releases/download/v0.7.5/co-shell-bridge-0.7.5-linux-arm64.zip) |\n| **Bridge** | Windows x86_64 | [co-shell-bridge-0.7.5-windows-amd64.zip](https://github.com/idirect3d/co-shell/releases/download/v0.7.5/co-shell-bridge-0.7.5-windows-amd64.zip) |\n| **Bridge** | Windows ARM64 | [co-shell-bridge-0.7.5-windows-arm64.zip](https://github.com/idirect3d/co-shell/releases/download/v0.7.5/co-shell-bridge-0.7.5-windows-arm64.zip) |\n\n**macOS / Linux:**\n```bash\n# curl\ncurl -L -o co-shell.zip https://github.com/idirect3d/co-shell/releases/download/v0.7.5/co-shell-0.7.5-darwin-arm64.zip\nunzip co-shell.zip && rm co-shell.zip\nchmod +x co-shell\n./co-shell\n\n# or wget\nwget https://github.com/idirect3d/co-shell/releases/download/v0.7.5/co-shell-0.7.5-darwin-arm64.zip\nunzip co-shell-0.7.5-darwin-arm64.zip && rm co-shell-0.7.5-darwin-arm64.zip\nchmod +x co-shell\n./co-shell\n```\n\n**Windows (PowerShell):**\n```powershell\n# PowerShell\nInvoke-WebRequest -Uri https://github.com/idirect3d/co-shell/releases/download/v0.5.1/co-shell-0.5.1-windows-amd64.zip -OutFile co-shell.zip\nExpand-Archive -Path co-shell.zip -DestinationPath .\n.\\co-shell.exe\n```\n\n**Windows (CMD):**\n```cmd\n:: CMD\ncurl -L -o co-shell.zip https://github.com/idirect3d/co-shell/releases/download/v0.5.1/co-shell-0.5.1-windows-amd64.zip\ntar -xf co-shell.zip\ndel co-shell.zip\nco-shell.exe\n```\n\n> **⚠️ Windows 安全提示**: co-shell 使用 Go 语言编译，是标准的原生可执行程序。由于未进行数字签名，Windows Defender 或部分杀毒软件可能会误报病毒。这是 Go 编译的 CLI 工具的常见情况（如 Hugo、Terraform 等均会遇到）。请放心，本项目完全开源，您可自行从源码编译验证。如遇到拦截，点击\"更多信息\"→\"仍要运行\"即可。\n\n> **💡 md2docx.py 工具**: 用于将 Markdown 文件转换为精美 Word 文档（支持公文格式 GB/T 9704-2012）。下载后放入 co-shell 运行目录下的 `bin/` 文件夹即可，co-shell 会自动安装依赖并调用它生成 DOCX 报告。\n\n#### Option 2: Build from Source\n\n```bash\ngit clone https://github.com/idirect3d/co-shell.git\ncd co-shell\ngo build -o co-shell .\n./co-shell\n```\n\n### Configure API\n\nThe setup wizard will launch automatically on first startup. You can also configure manually:\n\n```bash\n❯ :settings api-key sk-your-api-key-here\n❯ :settings endpoint https://api.deepseek.com/v1\n❯ :settings model deepseek-chat\n```\n\n### Start Using\n\n```bash\n❯ List all files in the current directory\n❯ Find all files larger than 100MB\n❯ Check how much disk space is left\n❯ Create a new Go project\n```\n\n---\n\n## Command-Line Options\n\n```bash\nco-shell [options]                    Start interactive REPL\nco-shell [options] <instruction>      Execute single instruction and exit\n\nOptions:\n  -w, --workspace <path>  Workspace path (default: current directory)\n  -c, --config <path>     Config file path (default: {workspace}/config.json)\n  -m, --model <name>      Temporarily override model name\n  -e, --endpoint <url>    Temporarily override API endpoint\n  -k, --api-key <key>     Temporarily override API Key\n  -n, --name <name>       Set agent name (default: co-shell)\n  -i, --image <path>      Image file path(s) for multimodal input\n      --lang <code>       Set language (zh/en, auto-detect by default)\n      --log on|off        Temporarily toggle logging\n      --max-iterations N  Max iterations (-1 for unlimited, default 1000)\n      --temperature N     Temperature (0.0 ~ 2.0)\n      --max-tokens N      Max output tokens\n      --show-thinking     Show AI thinking process (on/off)\n      --show-command      Show executed commands (on/off)\n      --show-output       Show command output (on/off)\n      --confirm-command   Confirm before executing commands (on/off)\n      --result-mode       Result mode (minimal/explain/analyze/free)\n      --description       Agent description/expertise\n      --principles        Agent core principles\n      --tool-timeout N    Tool call timeout in seconds (0=unlimited)\n      --cmd-timeout N     Command timeout in seconds (0=unlimited)\n      --llm-timeout N     LLM request timeout in seconds (0=unlimited)\n      --vision            Vision support (on/off)\n      --toolcall-enabled  Enable tool calling (on/off)\n      --toolcall-mode     Tool call mode (openai/xml)\n      --confirm-tool      Confirm before tool calls (on/off)\n      --memory-enabled    Enable persistent memory (on/off)\n      --plan-enabled      Enable task plan (on/off)\n      --subagent-enabled  Enable sub-agent (on/off)\n      --emoji-enabled     Enable emoji prefixes (on/off)\n      --show-logo         Show startup logo (on/off)\n      --token-usage       Token usage display (on/off/none)\n      --context-start     Context start mode (window/task/smart)\n      --loop-detect-enabled  Enable loop detection (on/off)\n      --dedup-enabled     Enable message deduplication (on/off)\n      --log-level         Log level (debug/info/warn/error/off)\n      --output-mode       Output mode (compact/normal/debug)\n      --top-p N           Top-P sampling (0.0~1.0)\n      --top-k N           Top-K sampling\n      --repetition-penalty N  Repetition penalty (0.0~2.0)\n      --body-add          Custom JSON body properties (key=value)\n  -v, --version           Show version info\n  -h, --help              Show help\n```\n\n---\n\n## Configuration Reference\n\nThe following table lists all configurable parameters, their CLI flags, REPL `:settings` commands, JSON config keys, default values, and descriptions.\n\n| Parameter | CLI Flag | REPL `:settings` | Config Key | Default | Description |\n|---|---|---|---|---|---|\n| **API & Model** | | | | | |\n| API Key | `-k, --api-key` | `api-key` | `api_key` | `\"\"` | LLM provider API key |\n| Endpoint | `-e, --endpoint` | `endpoint` | `endpoint` | `https://api.deepseek.com` | LLM API endpoint URL |\n| Model | `-m, --model` | `model` | `model` | `deepseek-v4-flash` | LLM model name |\n| Provider | — | — | `provider` | `deepseek` | LLM provider preset name |\n| Temperature | `--temperature` | `temperature` | `temperature` | `0.7` | LLM temperature (0.0–2.0) |\n| Max Tokens | `--max-tokens` | `max-tokens` | `max_tokens` | `393216` | Max output tokens |\n| Max Iterations | `--max-iterations` | `max-iterations` | `max_iterations` | `1000` | Max agent loop iterations (-1 = unlimited) |\n| Max Retries | — | `max-retries` | `max_retries` | `3` | Max retries for transient LLM errors |\n| Vision Support | `--vision` | `vision` | `vision_support` | `off` | Enable multimodal image input |\n| Thinking Mode | — | `thinking-enabled` | `thinking_enabled` | `off` | Enable LLM reasoning/thinking mode |\n| Reasoning Effort | — | `reasoning-effort` | `reasoning_effort` | `low` | Reasoning depth (low/medium/high) |\n| ToolCall Enabled | `--toolcall-enabled` | `toolcall-enabled` | `tool_call_enabled` | `on` | Enable tool/function calling |\n| ToolCall Mode | `--toolcall-mode` | `tool mode` | `tool_call_mode` | `openai` | Tool call mode (openai/xml) |\n| Top-P | `--top-p` | `top-p` | `top_p` | `-1` (none) | Top-P sampling (0.0~1.0, -1=don't send) |\n| Top-K | `--top-k` | `top-k` | `top_k` | `-1` (none) | Top-K sampling (-1=don't send) |\n| Repetition Penalty | `--repetition-penalty` | `repetition-penalty` | `repetition_penalty` | `-1` (none) | Repetition penalty (0.0~2.0, -1=don't send) |\n| Body Additions | `--body-add` | — | `body_additions` | `{}` | Custom JSON properties for LLM request body |\n| **Display & Output** | | | | | |\n| Show Thinking | `--show-thinking` | `show-thinking` | `show_thinking` | `off` | Display AI thinking process |\n| Show Command | `--show-command` | `show-command` | `show_command` | `on` | Display executed system commands |\n| Show Output | `--show-output` | `show-output` | `show_output` | `on` | Display command execution output |\n| Result Mode | `--result-mode` | `result-mode` | `result_mode` | `free` | Result presentation (minimal/explain/analyze/free) |\n| Output Mode | `--output-mode` | `output-mode` | `output_mode` | `normal` | LLM front-end output (compact/normal/debug) |\n| Token Usage | `--token-usage` | `token-usage` | `token_usage` | `on` | Token usage display (on/off/none) |\n| Emoji Enabled | `--emoji-enabled` | `emoji-enabled` | `emoji_enabled` | `on` | Enable emoji role prefixes |\n| Show Logo | `--show-logo` | `show-logo` | `show_logo` | `on` | Show startup ASCII logo |\n| **Safety & Timeout** | | | | | |\n| Confirm Command | `--confirm-command` | `confirm-command` | `confirm_command` | `on` | Require confirmation before executing commands |\n| Confirm Tool | `--confirm-tool` | `confirm-tool` | `confirm_tool` | `on` | Require confirmation before tool calls |\n| Tool Timeout | `--tool-timeout` | `tool-timeout` | `tool_timeout` | `0` (unlimited) | Tool call timeout in seconds |\n| Command Timeout | `--cmd-timeout` | `cmd-timeout` | `cmd_timeout` | `0` (unlimited) | System command timeout in seconds |\n| LLM Timeout | `--llm-timeout` | `llm-timeout` | `llm_timeout` | `0` (unlimited) | LLM API request timeout in seconds |\n| Error Max Single | — | `error-max-single-count` | `error_max_single_count` | `10` | Max occurrences of same error before prompt |\n| Error Max Types | — | `error-max-type-count` | `error_max_type_count` | `100` | Max distinct error types before prompt |\n| **Memory & Context** | | | | | |\n| Memory Enabled | `--memory-enabled` | `memory-enabled` | `memory_enabled` | `on` | Enable persistent memory tools |\n| Context Limit | — | `context-limit` | `context_limit` | `-1` (all) | Recent messages in LLM context (0=off, N=last N) |\n| Context Start Mode | `--context-start` | `context-start` | `context_start_mode` | `task` | Context start mode (window/task/smart) |\n| Memory Search Max Content | — | `memory-search-max-content-len` | `memory_search_max_content_len` | `512` | Max content length in memory search results |\n| Memory Search Max Results | — | `memory-search-max-results` | `memory_search_max_results` | `100` | Max results returned by memory search |\n| **Tasks & Sub-Agents** | | | | | |\n| Plan Enabled | `--plan-enabled` | `plan-enabled` | `plan_enabled` | `on` | Enable task plan tools |\n| SubAgent Enabled | `--subagent-enabled` | `subagent-enabled` | `sub_agent_enabled` | `on` | Enable sub-agent tools |\n| **Loop Detection & Dedup** | | | | | |\n| Loop Detect Enabled | `--loop-detect-enabled` | `loop-detect-enabled` | `loop_detect_enabled` | `on` | Enable LLM output loop detection |\n| Dedup Enabled | `--dedup-enabled` | `dedup-enabled` | `dedup_enabled` | `on` | Enable message deduplication |\n| **Search & Debug** | | | | | |\n| Search Max Line Length | — | `search-max-line-length` | `search_max_line_length` | `8192` | Max chars per line in search results |\n| Search Max Result Bytes | — | `search-max-result-bytes` | `search_max_result_bytes` | `65536` | Max total bytes for search results |\n| Search Context Lines | — | `search-context-lines` | `search_context_lines` | `5` | Context lines before/after each match |\n| Log Enabled | `--log` | `log` | `log_enabled` | `on` | Enable file logging |\n| Log Level | `--log-level` | `log-level` | `log_level` | `info` | Log level (debug/info/warn/error/off) |\n| **Agent Identity** | | | | | |\n| Agent Name | `-n, --name` | `name` | `agent_name` | `co-shell` | Agent name for identification |\n| Agent Description | `--description` | `description` | `agent_description` | `\"\"` | Agent expertise description |\n| Agent Principles | `--principles` | `principles` | `agent_principles` | `\"\"` | Agent core principles |\n| **Workspace** | | | | | |\n| Workspace Path | `-w, --workspace` | — | — | current dir | Workspace root directory |\n| Config Path | `-c, --config` | — | — | `{workspace}/config.json` | Config file path |\n| Language | `--lang` | — | — | auto-detect | Interface language (zh/en) |\n| Image Input | `-i, --image` | — | — | `\"\"` | Image path(s) for multimodal input |\n\n---\n\n## Built-in Commands\n\nAll built-in commands start with `:` and support Tab completion.\n\n| Command | Description |\n|---|---|\n| `:settings` / `:set` | LLM API parameter management (see Configuration Reference above) |\n| `:mcp` | MCP Server management (add / remove / list / enable / disable) |\n| `:rule` | Global rule management (add / remove / clear) |\n| `:memory` | Persistent memory management (save / get / search / delete / clear) |\n| `:context` | Context management (show / reset / set) |\n| `:image` | Multimodal image cache management (add / remove / clear / list) |\n| `:plan` | Task plan management (list / view / create / insert / remove / update) |\n| `:skill` | Skill management (list / show / add / remove) |\n| `:history` | View history tasks (`:history last` / `:history first`) |\n| `:config` | Guided configuration wizard |\n| `:model` | Model management (switch / add / remove / ...) |\n| `:db` | Database management (config / init / migrate / backup / restore) |\n| `:session` | Session management (list / switch / new / ...) |\n| `:help` | Show this help message |\n| `:exit` | Exit co-shell |\n\n---\n\n## Sample Research Reports\n\nco-shell can autonomously conduct in-depth research by searching the web, collecting data, and generating comprehensive reports.\n\n<video src=\"https://github.com/idirect3d/co-shell/releases/download/v0.3.0/co-shell.mp4\" controls width=\"800\"></video>\n\n*Demo: co-shell autonomously researching and generating a comprehensive report.*\n\nHere are some real-world examples produced entirely by co-shell:\n\n### 1. Arctic Ocean Brand Research (北冰洋品牌深度调研报告)\n\nA comprehensive brand research report on the iconic Chinese soda brand \"Arctic Ocean\" (北冰洋), tracing its history from 1936 to the present. The report covers brand evolution, product development, market competition, and strategic recommendations.\n\n> **Report**: [arctic-ocean-brand-research-report.md](samples/research/arctic-ocean-brand-research/arctic-ocean-brand-research-report.md) (14 pages) | [DOCX](samples/research/arctic-ocean-brand-research/arctic-ocean-brand-research-report.docx)\n\n### 2. Beijing Zoo Panda Latest News (北京动物园大熊猫最新动态研究报告)\n\nA timely research report on the latest developments of giant pandas at Beijing Zoo, covering facility upgrades, new arrivals, and public events from 2023 to 2026.\n\n> **Report**: [beijing-zoo-panda-latest-report.md](samples/research/beijing-zoo-panda-news/beijing-zoo-panda-latest-report.md) (13 pages) | [DOCX](samples/research/beijing-zoo-panda-news/beijing-zoo-panda-latest-report.docx)\n\n### 3. China Reinsurance Market 2026-2027 (中国再保险市场调研报告)\n\nA professional market research report analyzing the impact of the 2026 Iran war on China's reinsurance market, covering geopolitical risks, energy market turmoil, and strategic recommendations.\n\n> **Report**: [china-reinsurance-market-report-2026-2027.md](samples/research/china-reinsurance-market-2026-2027/china-reinsurance-market-report-2026-2027.md) (26 pages) | [DOCX](samples/research/china-reinsurance-market-2026-2027/china-reinsurance-market-report-2026-2027.docx)\n\n### 4. Y-10 Aircraft Research (中国运-10飞机深度调研报告)\n\nAn in-depth research report on China's first domestically developed jet airliner — the Y-10 (运-10), covering its development history, technical specifications, and historical significance.\n\n> **Report**: [Y-10-in-depth-research-report.md](samples/research/yun10/Y-10-in-depth-research-report.md) (13 pages) | [DOCX](samples/research/yun10/Y-10-in-depth-research-report.docx)\n\n---\n\n## Tech Stack\n\n- **Language**: Go 1.22+\n- **REPL**: [go-prompt](https://github.com/c-bata/go-prompt)\n- **LLM**: [go-openai](https://github.com/sashabaranov/go-openai) (OpenAI / DeepSeek / compatible models)\n- **MCP**: [mcp-go](https://github.com/mark3labs/mcp-go)\n- **Storage**: [bbolt](https://go.etcd.io/bbolt) (embedded KV database)\n\n---\n\n## Version History\n\n### v0.7.5 (Current)\n\n> **BUILD**: 00389 | **Release Date**: 2026-08-10\n\n问题判定机制完整落地（统一问题求解器）+ 视觉识别上下文隔离。\n\n**版本亮点**: 视觉识别 minimal/full 上下文模式改造（识别轮独立调用、结果回填工具返回、系统上下文隔离）；问题判定机制从\"仅循环\"扩展为**四类异常统一接入**（循环 / 工具格式错误 / 上下文溢出 / 连接错误均走 `report_problem` 结构化判定，由独立问题模型诊断并给出可执行动作）；智能体设置组只读模型摘要改名 `current-*` 消除与可配置项歧义。\n\n**Implemented Features:**\n\n- **Problem solver unified routing (FEATURE-342 + FEATURE-345)** — `report_problem` tool with forced single-tool `tool_choice`; a dedicated problem model (resolved via the priority chain: mode-bound → `default-problem-model` → `default-tool-model` → mode text model → active model) classifies suspected signals and returns a structured report with `type / reason / guidance / suggested_action`. Now wired into **loop detection, tool format (XML) errors, context overflow, and ambiguous LLM connection errors**. Actions honored: `prompt_feedback` (model guidance replaces generic template), `delete_last_msg`, `notify_user` (surface & stop). Hard-coded sufficient conditions (HTTP 401/403/404/429/5xx) skip the model; on failure it falls back to the built-in path (`problem-solver-enabled` switch, default on)\n- **Vision recognition context isolation (FEATURE-343)** — minimal mode collapses the recognition round to `[system(Identity-only), user(intent+images)]`, clears tools, and backfills the visual model output as the `visual_analysis` tool result without polluting the main session history\n- **Settings display fixes (FIX-344)** — renamed read-only summary rows to `current-tool-model` / `current-problem-model` / `current-vision-model`; fixed `:set default-tool-model` showing `%!d(string=auto)`; `:set default-problem-model/default-tool-model auto` now resets to auto-computed values\n\n### v0.5.1\n\n> **BUILD**: 00193 | **Release Date**: 2026-05-28\n\nPatch release — Bug fixes and stability improvements.\n\n**版本亮点**: 增强内容级循环检测、用户消息模板统一格式化、新增 attempt_completion 工具、修复用户消息模板未应用的问题。\n\n**Implemented Features:**\n\n- **Content-level loop detection** — enhanced `checkContentLoop` detects repetitive text blocks (full paragraph repetition, URL-encoded character repetition) in LLM streaming output using sliding window auto-matching\n- **User message template** — `formatUserMessage` now applied to all user message enqueue paths, ensuring `{TASK_TRACKING}` and `{CURRENT_TIME}` placeholders are properly filled in every user message\n- **attempt_completion tool** — registered as function calling in OpenAI mode and as XML tool in XML mode, providing the LLM with a standard way to report task completion results\n- **API URL fix** — fixed duplicate `/v1` suffix when base URL already contains `/v1`\n\n### v0.5.0 — Beta2\n\n> **BUILD**: 00190 | **Release Date**: 2026-05-22\n\nBeta2 release — feature complete, stable and usable.\n\n**版本亮点**: 可配置工具调用模式（OpenAI/XML）、XML 模式支持非 function calling 模型、PostgreSQL 持久化存储、会话自动恢复、LLM 输出循环检测与消息去重、工具调用确认机制扩展、模型管理交互体验优化、数据库配置子命令模式。\n\n**Implemented Features:**\n\n- **ToolCall mode** — configurable tool call mechanism supporting OpenAI standard API and XML embedded mode. XML mode enables tool calling for models without native function calling support, using `<tool_call>` XML tags in content. Configurable via `:settings tool mode openai|xml`, `--toolcall-mode` CLI flag, and `config.json`\n- **PostgreSQL storage** — persistent storage via PostgreSQL as an alternative to bbolt. Configurable via `:settings db` sub-commands (host/port/dbname/user/password/enabled), with connection test and bbolt data migration support\n- **Session persistence** — automatic conversation context restoration after program restart. Session data is saved after each LLM request and restored on startup\n- **Loop detection** — monitors LLM streaming output for repetitive patterns, automatically stops and sends correction prompts when detected. Configurable via `:settings loop-detect-enabled`, `--loop-detect-enabled`\n- **Message deduplication** — feature-based duplicate message detection with Jaccard similarity comparison. Configurable via `:settings dedup-enabled` and related parameters\n- **Tool call confirmation** — all tool calls (not just execute_command) require user confirmation. Each tool has independent confirm-tool control. Added \"G\" option (agree and disable confirmation for this method). Number-based approval counter is per-method, reset on task completion\n- **Model management UX** — `:model switch/remove/enable/disable/info/set-priority/set-param` commands show model list with number selection when no model ID is provided\n- **DB sub-command mode** — `:settings db enabled/host/port/dbname/user/password` sub-commands for database configuration. Interactive setup wizard on first `:settings db` run\n- **Default agent name** — program uses current working directory name (last segment) as default agent name\n- **XML mode `<item>` tag** — unified array parameter tag naming in XML tool call mode, all array elements use `<item>` tag\n- **Conversation timestamp format** — improved readability: changed from \"2026-05-12 10:15:30 - \" to \"在 2026-05-12 10:15:30 说：\"\n- **write_to_file tool enhancement** — added reminder to prefer replace_in_file over rewriting entire files to avoid introducing new issues\n- **Model switch fix** — fixed `:model add/switch` not taking effect due to ModelManager and cfg.Models desynchronization\n- **Qwen 3.6 infinite loop fix** — fixed infinite loop when writing large files with Qwen 3.6 model\n\n### v0.4.0 — RC2\n\n> **BUILD**: 00151 | **Release Date**: 2026-05-04\n\nRelease Candidate 2 — feature complete, stable and usable.\n\n**版本亮点**: LLM 自主设置系统参数、表情符号角色区分输出、日志级别控制、文件工具增强、超时时间智能预判。\n\n**Implemented Features:**\n\n- **LLM settings tool** — LLM can modify system parameters via tool calls (equivalent to `:settings`), with user confirmation for each change\n- **Emoji role indicators** — distinct emoji prefixes for different output roles: 👤 user input, 🐚 LLM response, ⚙️ tool calls/results, 🔴 command execution. Configurable via `:settings emoji-enabled`, `--emoji-enabled`, and `config.json`\n- **Log level control** — `:settings log debug/info/warn/error/off`, `--log-level` CLI flag, config.json persistence\n- **Enhanced file tools** — improved read_file and write_file for better source code manipulation\n- **Intelligent timeout** — `execute_command` requires `timeout_seconds` (0 = wait forever) and `on_timeout` (`kill` terminates the process group, `detach` returns the PID and a log file path while the process keeps running); for values > 0 the system takes max of user-configured minimum and LLM-predicted timeout\n- **Agent identity defaults** — multi-language default agent descriptions for consistent behavior\n- **Output mode refactoring** — fine-grained control: show-llm-thinking, show-llm-content, show-tool, show-tool-input, show-tool-output, show-command, show-command-output\n- **Session display improvement** — message list numbering starts from 0 (system message = 0, user message 1 = 1, etc.)\n\n### v0.3.0 — RC1\n\n> **BUILD**: 00135 | **Release Date**: 2026-05-01\n\nRelease Candidate 1 — feature complete, ready for preview.\n\n**版本亮点**: 全面对话上下文管理、持久化记忆与检索、LLM 输出模式切换、思考过程开关、Token 用量统计、错误重试智能限制、数字批量批准、小米/GLM 最新模型支持、**报告自动生成公文格式 DOCX**（GB/T 9704-2012 标准）。\n\n**Implemented Features:**\n\n- Multimodal model support (image input, visual understanding) with 👀 indicator\n- Image cache management (:image command, add_images/remove_images/clear_images tools)\n- Agent identity customization (name/description/principles via :settings)\n- Task plan management (:plan command, create_task_plan/update_task_step/insert_task_steps/remove_task_steps/view_task_plan/list_task_plans tools)\n- Task plan singleton mode — only one active plan at a time, auto-archive on completion\n- Batch command execution with \"Approve All\" inheritance for sub-agents\n- 12 new CLI flags (--temperature/--max-tokens/--show-thinking/--show-command/--show-output/--confirm-command/--result-mode/--description/--principles/--tool-timeout/--cmd-timeout/--llm-timeout)\n- Vision support auto-detection via model API\n- Enhanced help documentation with complete parameter descriptions\n- **Conversation context limit** (:settings context-limit) — control how many history messages sent to LLM\n- **Persistent memory management** (:memory command, get_memory_slice/memory_search tools)\n- **Memory toggle** (:settings memory-enabled, --memory-enabled/--memory-disabled)\n- **LLM output mode** (:settings output-mode) — compact / normal / debug modes\n- **Sub-agent toggle** (:settings subagent-enabled) — control sub-agent tool availability\n- **Thinking toggle** (:settings thinking-enabled, --thinking-enabled/--thinking-disabled) — control AI reasoning process display\n- **Reasoning effort** (:settings reasoning-effort) — control AI reasoning depth (low/medium/high)\n- **Token usage statistics** — cumulative token tracking via Agent.TokenUsage()\n- **Conversation reset** (.new command) — clear all history without restart\n- **Error retry limit** — configurable single-error and type-error max counts with user prompt\n- **Number-based approval** — enter a number to auto-approve N subsequent command executions\n- **search_files enhancement** — binary file ignore, content length protection, configurable limits\n- **Instant :settings effect** — no restart needed after parameter changes\n- **New model support** — Xiaomi (Mi), GLM (Z.ai) latest models\n- **Setup wizard enhancement** — skip endpoint for built-in providers, enhanced risk warnings\n- **Sample research reports** — added real-world usage examples\n- **Official document format output** — research reports auto-generated as GB/T 9704-2012 compliant DOCX (小标宋 title, 黑体/楷体/仿宋 headings, fixed 28pt line spacing, 2-char first-line indent). [Download samples](#sample-research-reports) to see the effect.\n\n### v0.2.0 — Beta\n\n> **BUILD**: 00087 | **Release Date**: 2026-04-27\n\nBeta release with enhanced capabilities for daily use.\n\n**Implemented Features:**\n\n- Agent built-in file operation tools (read_file, search_files, list_code_definition_names, replace_in_file, write_to_file)\n- Workspace architecture with --workspace flag and auto-created subdirectories\n- Agent system prompt multi-language support (auto-switch Chinese/English)\n- Sub-agent support: launch child co-shell processes, shared I/O, result collection\n- Scheduled task execution with crontab-like scheduling\n- Custom config file path via -c/--config flag\n- Custom agent name via --name/-n flag\n- Multi-turn conversation context management\n- System command execution sandbox\n- Command confirmation for dangerous operations\n- Config file hot-reload\n- Enhanced error handling and user prompts\n\n### v0.1.0 — Alpha\n\n> **BUILD**: 00074 | **Release Date**: 2026-04-26\n\nFirst Alpha preview with core functionality.\n\n**Implemented Features:**\n\n- REPL interactive interface (go-prompt, Tab completion)\n- LLM client abstraction (OpenAI-compatible API, streaming support)\n- Agent core loop (LLM call → tool execution → iteration)\n- Built-in command system (:settings / :mcp / :rule / :memory / :context / :history / :config)\n- Persistent storage (bbolt for memory/context)\n- MCP client manager (multi-server connection)\n- System command execution (timeout control, command confirmation)\n- Configuration management (JSON persistence to ~/.co-shell/, multi-location loading)\n- API initial setup with setup wizard (multi-provider support)\n- Direct system command execution (bypass LLM for native commands)\n- Logging system (file log, runtime toggle)\n- API Key masking (show first 4 + last 4 chars)\n- Command-line flags (--help / --version / --model / --endpoint / --api-key / --log / --max-iterations / --lang)\n- Session history (arrow key navigation, cross-session persistence, :history command)\n- Internationalization (i18n) support: Chinese and English, --lang flag, auto-detect system language\n- Multi-provider support (DeepSeek v4 / Alibaba Qwen / OpenAI-compatible fallback)\n- Result processing modes (minimal / explain / analyze / free)\n- Configurable timeouts for all operations\n- Cross-platform support (macOS / Linux / Windows)\n- Streaming output with thinking process display\n\n---\n\n## Extended Features\n\n### 🚀 co-shell-feishu-bridge — 飞书机器人集成\n\n`co-shell-feishu-bridge` 是一个独立的网关程序，将飞书（Lark）机器人连接到 co-shell。通过飞书 WebSocket 长连接，用户可以在飞书聊天中直接向 co-shell 发送自然语言指令并接收 AI 处理结果。\n\n**安全特性**：采用我方主动连接飞书 WebSocket 长链接的方式，无需暴露任何公网端口，无需配置反向代理或防火墙规则。\n\n#### 快速启动\n\n```bash\n# 编译桥接器\ngo build -o work/co-shell-feishu-bridge ./cmd/co-shell-feishu-bridge/\n\n# 启动（需先创建飞书应用并获取 App ID / App Secret）\n./work/co-shell-feishu-bridge \\\n  --app-id cli_a5b3c4d5e6f7g8h9 \\\n  --app-secret a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6\n```\n\n#### 三种工作模式\n\n| 模式 | 说明 | 适用场景 |\n|------|------|----------|\n| `sync`（默认） | 逐条执行，前一条完成后才处理下一条 | 文件操作、状态依赖的任务 |\n| `pool` | 当前任务完成后，合并队列中所有消息批量处理 | 快速连续提问 |\n| `preempt` | 新消息到达时中断当前任务，立即处理新消息 | 需要快速响应的场景 |\n\n> 详细文档：[docs/bridge/feishu.md](docs/bridge/feishu.md)\n\n### 🗄️ PostgreSQL 持久化存储\n\nco-shell 支持使用 PostgreSQL 作为持久化存储后端，替代默认的嵌入式 bbolt 数据库。适用于需要多进程共享数据、数据备份恢复、或已有 PostgreSQL 基础设施的场景。\n\n#### 安装 PostgreSQL\n\n**推荐方式：让 co-shell 自己安装！** 只需告诉它：\n\n```bash\n❯ 帮我安装 PostgreSQL 数据库\n```\n\nco-shell 会自动检测你的操作系统并执行相应的安装命令（macOS 使用 `brew install postgresql`，Ubuntu/Debian 使用 `apt install postgresql`，CentOS/RHEL 使用 `yum install postgresql-server`，Windows 使用 `winget install PostgreSQL.PostgreSQL`），安装完成后还会启动数据库服务并提示你进行后续配置。\n\n**手动安装参考：**\n\n```bash\n# macOS\nbrew install postgresql@16\nbrew services start postgresql@16\n\n# Ubuntu/Debian\nsudo apt update && sudo apt install postgresql postgresql-contrib\nsudo systemctl start postgresql\n\n# Windows (PowerShell 管理员)\nwinget install PostgreSQL.PostgreSQL\n```\n\n#### 配置方式\n\n```bash\n# 交互式配置向导（推荐）\n❯ :db config\n\n# 或直接设置参数\n❯ :settings db host localhost\n❯ :settings db port 5432\n❯ :settings db name co_shell\n❯ :settings db user postgres\n❯ :settings db password your-password\n❯ :settings db enabled on\n```\n\n#### 数据管理\n\n```bash\n❯ :db init      # 初始化数据库（重建所有表）\n❯ :db migrate   # 从本地 bbolt 迁移数据到 PostgreSQL\n❯ :db backup    # 备份所有表到 CSV 文件\n❯ :db restore   # 从备份恢复数据\n```\n\n---\n\n## Project Structure\n\n```\nco-shell/\n├── main.go              # Entry point, module initialization\n├── config/              # Configuration management (LLM/MCP/Rules)\n├── repl/                # REPL interaction layer\n├── agent/               # Agent core loop\n├── llm/                 # LLM client abstraction\n├── mcp/                 # MCP client manager\n├── store/               # Persistent storage (bbolt)\n├── cmd/                 # Built-in command handlers\n├── log/                 # Logging system\n├── i18n/                # Internationalization\n├── wizard/              # Setup wizard\n├── scheduler/           # Scheduled task scheduler\n├── subagent/            # Sub-agent management\n├── taskplan/            # Task plan management\n├── memory/              # Persistent memory management\n├── workspace/           # Workspace management\n├── samples/             # Sample research reports\n├── bin/                 # Utility scripts (md2docx, md2wechat)\n├── docs/                # Multi-language documentation\n│   ├── en/              # English documentation\n│   └── zh-CN/           # Chinese documentation\n├── CHANGELOG.md         # Changelog\n├── USAGE.md             # Detailed usage guide\n└── ROADMAP.md           # Version plan and roadmap\n```\n\n---\n\n## License\n\n[MIT](LICENSE) © 2026 L.Shuang\n\n---\n\n## Author\n\n- **L.Shuang** — [GitHub](https://github.com/idirect3d)\n"}