Token导航 LogoToken导航TokenDH.com
研究检索执行命令clawhub未标认证来源可访问clear审计通过

openclaw-exec-truncateOpenClaw exec truncate 搜索

Agent Skill

openclaw-exec-truncate 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,856

周安装

119

GitHub Stars

公开资料未说明

下载量

952
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:openclaw-exec-truncate(OpenClaw exec truncate 搜索)
来源仓库:https://github.com/ether-btc/openclaw-exec-truncate
安装命令:
openclaw skills install openclaw-exec-truncate
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install openclaw-exec-truncate

简介

通过域感知截断压缩 shell 命令执行输出的 AI 工具。

  • 解决长文本输出超出上下文窗口时的信息保留问题。openclaw-exec-truncate 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 智能识别关键信息边界,保留核心结果忽略冗余细节。
  • 依赖预设的领域关键词库,对新领域需手动补充规则。
  • 压缩可能导致部分中间状态丢失,重要任务建议保留原始输出。

SKILL.md

name
exec-truncate
description
AI agent tool for compressing/executing shell commands with domain-aware output truncation. Use when exec tool output needs to be compressed, when running git diff/log/grep commands, or when exec output exceeds reasonable length.
location
~/.openclaw/workspace/skills/exec-truncate

Exec-Truncate Skill

Domain-aware output truncation for shell command execution. Compresses verbose output while preserving critical information.

What It Does

This skill provides intelligent truncation for common command patterns:

  • git diff — Keeps first 100 + last 20 lines, shows only additions (+)
  • git log — Condensed one-liners with short hashes (7 chars), subjects, branches
  • grep/rg/find — Caps at 50 matches, strips path prefixes
  • ls -la/ls -l — Max 100 entries, keeps filename + abbreviated size
  • build tools — Strips ANSI codes, progress bars; keeps errors/warnings only

Integration Note

This is a standalone skill, not wired into OpenClaw's exec tool. OpenClaw distributions are compiled/bundled, so this runs as a utility the AI applies manually to output it already has.

Available Functions

Individual Truncation Functions

import {
  truncateGitDiff,
  truncateGitLog,
  truncateGrepOutput,
  truncateLsOutput,
  truncateBuildOutput,
  truncateExecOutput,
} from "./mod.ts";

// Direct usage
const truncated = truncateGitDiff(rawOutput);
const condensed = truncateGitLog(rawOutput);
const matches = truncateGrepOutput(rawOutput, 50); // custom max
const listing = truncateLsOutput(rawOutput);
const build = truncateBuildOutput(rawOutput);

// Auto-dispatcher (routes based on command string)
const result = truncateExecOutput("git diff HEAD~5", rawOutput);

FilteredExecutor (Recommended for Programmatic Use)

import { createFilteredExecutor } from "./index.ts";

// Wrap your exec function
const executor = createFilteredExecutor(
  async (cmd: string) => {
    const { stdout } = await Deno.Command.output(cmd, { shell: true });
    return new TextDecoder().decode(stdout);
  }
);

// Execute with automatic truncation
const diff = await executor.run("git diff HEAD~5");
const log = await executor.run("git log --oneline -20");
const grep = await executor.run("grep -r 'TODO' src/");

Config Options (Phase 3)

const executor = createFilteredExecutor(myExecFn, {
  outputTransform: false,       // Bypass all filtering, return raw
  oversizedOutputLog: 10000,  // Log when raw output > 10KB
});

Usage Examples

Manual Truncation Pattern

When you already have exec output and want to compress it:

// 1. Run command normally
const raw = await exec("git diff HEAD~10");

// 2. Apply truncation
const compressed = truncateGitDiff(raw);

// 3. Use the compressed result
console.log(compressed);

Batch Processing

import { truncateExecOutput } from "./mod.ts";

const commands = [
  "git diff HEAD~5",
  "git log --oneline -20",
  "grep -r 'TODO' src/"
];

for (const cmd of commands) {
  const raw = await exec(cmd);
  const compressed = truncateExecOutput(cmd, raw);
  console.log(`=== ${cmd} ===\
${compressed}\
`);
}

Custom Filtering

import { FilterRegistry, FilteredExecutor } from "./index.ts";

const customRegistry = new FilterRegistry();
customRegistry.register(/^npm run /i, (_cmd, output) => {
  // Custom logic for npm scripts
  return output.split("\
").slice(0, 30).join("\
");
});

const executor = new FilteredExecutor(myExecFn, customRegistry);

Fail-Safe Behavior

All truncation functions are wrapped in truncateWithFailSafe. If ANY error occurs during processing (TypeError, RangeError, regex crash), the original output is returned unchanged with an error logged to stderr.

Module Overview

ModulePurpose
mod.tsCore truncation functions (git diff/log, grep, ls, build)
filter-registry.tsCommand pattern matching + filter composition
filtered-executor.tsWraps exec functions with configurable filtering
index.tsPublic API re-exports + createFilteredExecutor factory

See Also

  • README.md — Practical examples and copy-pasteable snippets
  • scripts/exec-truncate-wrapper.sh — Shell wrapper for CLI use
  • scripts/simple-truncater.py — Pure Python reimplementation

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

74.64%
按下载量换算711

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 openclaw skills install openclaw-exec-truncate 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills