TopRank Skills

Home / Claw Skills / API 集成 / terminal-killer
Official OpenClaw rules 36%

terminal-killer

Intelligent shell command detector and executor for OpenClaw. Automatically identifies terminal commands (system builtins, $PATH executables, history matches, command patterns) and executes directly without LLM overhead. Cross-platform support (macOS/Linux/Windows). Use when user input appears to be a shell command to skip AI processing and run immediately.

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 terminal-killer 技能。 若已安装,则直接安装 terminal-killer 技能。

Overview

Skill Key
cosperypf/terminal-killer
Author
Cosper
Source Repo
openclaw/skills
Version
-
Source Path
skills/cosperypf/terminal-killer
Latest Commit SHA
73c62a9d7b376437f86ff7c6d0bbafa6bae2513c

Extracted Content

SKILL.md excerpt

# Terminal Killer

🚀 Smart command router that executes shell commands directly, bypassing LLM for instant terminal operations.

## Quick Start

Terminal Killer automatically activates when user input matches command patterns. No special syntax needed — just type commands naturally:

```
ls -la              # → Direct exec
git status          # → Direct exec  
npm install         # → Direct exec
"help me code"      # → LLM handles normally
```

## How It Works

### Detection Pipeline

```
User Input → Command Detector → Decision
                                      ├── Command → exec (direct)
                                      └── Task → LLM (normal)
```

### Environment Loading

Terminal Killer automatically loads your shell environment before executing commands:

1. **Detects your shell** (zsh, bash, etc.)
2. **Sources init files** (`~/.zshrc`, `~/.bash_profile`, `~/.bashrc`, etc.)
3. **Inherits full PATH** - including custom paths like Android SDK, Homebrew, etc.
4. **Preserves environment variables** - all your `export VAR=value` settings

This ensures commands like `adb`, `kubectl`, `docker`, etc. work exactly as they do in your terminal!

### Detection Rules (in order)

1. **System Builtins** - Check against OS-specific builtin commands
2. **PATH Executables** - Scan `$PATH` for matching executables
3. **History Match** - Compare against recent shell history
4. **Command Pattern** - Heuristic analysis (operators, paths, etc.)
5. **Confidence Score** - Combine signals for final decision

## Detection Details

### 1. System Builtins

Checks input against known builtin commands for the current OS:

| macOS/Linux | Windows (PowerShell) | Windows (CMD) |
|-------------|---------------------|---------------|
| `cd`, `pwd`, `ls` | `cd`, `pwd`, `ls` | `cd`, `dir`, `cls` |
| `echo`, `cat` | `echo`, `cat` | `echo`, `type` |
| `mkdir`, `rm`, `cp` | `mkdir`, `rm`, `cp` | `mkdir`, `del`, `copy` |
| `grep`, `find` | `grep`, `find` | `findstr` |
| `git`, `npm`, `node` |...

README excerpt

# Terminal Killer - 集成指南

**Version:** 1.2.0  
**Last Updated:** 2026-03-02

## 🔒 安全说明

> **⚠️ VirusTotal 警告说明**
> 
> 本技能可能被 VirusTotal 标记为"可疑",原因是使用了 `execSync` 执行 shell 命令。**这是误报**。
> 
> - ✅ **这是核心功能**:本技能的设计目的就是智能检测并执行用户输入的 shell 命令
> - ✅ **无外部 API 调用**:所有操作都在本地完成,不向任何外部服务器发送数据
> - ✅ **无数据外传**:不收集、不上传任何用户信息
> - ✅ **透明开源**:所有源码可见,作者 Cosper (cosperypf@163.com)
> 
> VirusTotal 的自动检测将 `execSync`、读取配置文件等行为标记为风险模式,但这些对于本技能的功能是必需的。

## 快速开始

Terminal Killer 是一个智能命令路由器,自动判断用户输入是 shell 命令还是 AI 任务。

## 📝 更新日志

### v1.2.0 (2026-03-02)

**安全说明更新:**
- 在 `clawhub.json` 中添加 `securityNote` 字段,说明 VirusTotal 误报原因
- 在 `README.md` 中添加详细安全说明
- 明确声明:无外部 API 调用、无数据外传、本地执行

### v1.1.0 (2026-02-28)

**核心改进:**

1. **✅ 忠实执行原命令**
   - 命令原样执行,不做任何修改
   - 不添加参数、不优化、不截断
   - 保留原始输出(包括进度条、特殊字符等)

2. **🪟 交互式命令检测**
   - 自动识别交互式命令(`adb shell`、`ssh`、`docker exec -it` 等)
   - 自动打开新 Terminal 窗口执行
   - 主会话保持空闲
   - 加载完整 shell 环境(~/.zshrc 等)

3. **📜 长输出处理**
   - 检测超过 2000 字节的输出
   - 显示 200 字符预览
   - 提示用户是否在新 Terminal 窗口查看
   - 避免界面渲染问题

### v1.0.0 (2026-02-28)

**初始版本:**
- 智能命令检测
- 跨平台支持
- 环境变量加载
- 危险命令检测

## 工作原理

```
用户输入 → detectCommand() → 决策
                              ↓
            ┌─────────────────┼─────────────────┐
            ↓                 ↓                 ↓
        EXECUTE            ASK              LLM
        (直接执行)      (询问确认)      (交给 AI)
```

## 检测规则

| 规则 | 说明 | 分值 |
|------|------|------|
| 系统内置命令 | 匹配平台内置命令列表 | +3 |
| 常见开发工具 | adb, git, docker, kubectl 等 | +2 |
| PATH 可执行文件 | 检查 `$PAT...

Related Claw Skills