360 Secure SkillHub
360 安全技能中心

Unexpand Tool

该 Skill 通过本地脚本把文本中的空格序列转换为制表符,支持设置制表宽度、转换全部空格或仅前导空格,并可通过文件参数或标准输入使用。适合统一缩进和减小文本体积。

dinghaibin
dinghaibin
热度 37.54
最近更新 2026-05-11 17:47:44
分类:效率依赖:代码执行 / 读写文件应用场景:文件转换

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add unexpand-tool
Metadata
name
unexpand-tool
description
Convert spaces to tabs in text files. Use for consistent indentation and reducing file size by replacing spaces with tabs.

Unexpand - Space to Tab Converter

Replace sequences of spaces with tab characters. The inverse operation of expand-tool. Ideal for converting space-indented code to tab-indented format.

Usage

unexpand-tool [options] <file>

Options

  • -t N: Set tab width in spaces (default: 8)
  • -a: Convert all spaces, not just leading
  • --first-only: Only convert leading sequences

Examples

unexpand-tool -t 4 file.py
unexpand-tool -a -t 2 data.txt
cat spaces.txt | unexpand-tool