rich-cli
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "rich-cli" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-4ce784ab9afad71e89c093553e8beb9fa944d34803f099101da65543d2d6a27d. Verify the upstream source and version against https://skillhub.cn/skills/user_2fd890c9/rich-cli before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Render rich text, syntax highlighting, and Markdown preview in the terminal to make command-line output clearer and more visually pleasing.
Introduction source: third_party · user_2fd890c9 · 1.4.1 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Audience
- Translation pending; see source documentation.
- Inputs and outputs
- Translation pending; see source documentation.
- Software, accounts and paid services
- No special environmental requirements
- Testing
- Not tested
Browse files
Frontmatter
name: rich-cli
description: 在终端中渲染富文本、语法高亮、Markdown 预览,让命令行输出更清晰美观📜 用户协议(User Agreement)
- 本 Skill 仅供学习与参考用途。使用本 Skill 产生的任何结果,由使用者自行承担全部责任;本 Skill 不提供任何明示或暗示的保证。
- 涉及法律、财务、税务、投资、医疗等专业决策时,请务必咨询持证专业人士。
- 本代码受版权法保护,未经授权复制、反向工程或商业利用将被追究法律责任。 <!-- user-agreement-injected -->
⚠️ 本内容仅供一般信息参考,不构成法律、财务、税务、投资或医疗建议。 涉及合同签署、报税、投资、诊疗等专业决策时,请务必咨询持证专业人士,并由使用者自行承担决策后果。 <!-- professional-disclaimer-injected -->
终端富文本美化
在终端中渲染富文本、语法高亮、Markdown 预览,让命令行输出更清晰美观。本 Skill 基于 Textualize/rich-cli 项目(Python),通过自动克隆、安装依赖并调用其 CLI 接口,将用户输入转化为终端富文本输出。
一、能力边界(Scope & Boundaries)
1.1 核心能力(能做什么)
| 能力项 | 说明 | 对应命令 |
|---|---|---|
| 语法高亮 | 对 6+ 种编程语言(Python、JavaScript、Go、Rust、Java、C++ 等)进行彩色高亮 | rich |
| Markdown 渲染 | 将 Markdown 文件渲染为终端友好格式 | rich-markdown |
| 日志美化 | 对日志文件进行着色和格式化,突出错误与警告 | rich |
| 管道输入 | 支持从标准输入读取内容并格式化 | rich - |
| 批量处理 | 支持同时处理多个文件 | rich file1.py file2.py |
| 主题切换 | 支持多种内置主题(如 monokai、solarized-dark) |
--theme |
| 行号显示 | 为代码块添加行号 | --line-numbers |
| 软换行 | 在指定宽度处自动换行 | --soft-wrap |
1.2 能力边界(不能做什么)
| 场景 | 说明 | 替代方案 |
|---|---|---|
| 非文本文件 | 不支持二进制文件(如图片、PDF) | 使用 file 命令确认类型 |
| 交互式编辑器 | 不支持交互式编辑,仅支持一次性渲染 | 使用 vim 或 code |
| 图形界面 | 不支持 GUI 输出,仅限终端 | 使用 rich Python 库 |
| 网络请求 | 不主动发起网络请求 | 使用 curl 或 wget |
| 文件修改 | 不修改源文件,仅输出到 stdout | 使用 > 重定向 |
1.3 适用对象
| 用户类型 | 适用场景 | 推荐级别 |
|---|---|---|
| 开发者 | 代码审查、日志分析、文档预览 | Level 1-3 |
| 运维人员 | 日志监控、CI/CD 输出美化 | Level 1-2 |
| 数据分析师 | 数据文件预览、报告生成 | Level 1-2 |
| 技术写作人员 | Markdown 文档预览 | Level 1 |
二、触发方式(Trigger Mechanism)
2.1 触发词与匹配逻辑
匹配逻辑说明:当用户输入包含以下任一触发词(或其同义词、近义词)时,Skill 被激活。匹配采用模糊匹配策略,即触发词出现在用户消息的任何位置(开头、中间、结尾)均视为命中。若用户输入包含多个触发词,以第一个命中的触发词为准,并优先匹配更具体的触发词(如"语法高亮"优先于"终端美化")。
| 触发词 | 同义词/近义词 | 场景标注 | 匹配优先级 |
|---|---|---|---|
| rich-cli | rich, rich-cli 命令 | 直接指定工具 | 高 |
| 终端美化 | 终端格式化、命令行美化、输出美化 | 通用美化需求 | 中 |
| 语法高亮 | 代码高亮、高亮显示、着色 | 代码文件处理 | 高 |
| markdown预览 | markdown渲染、md预览、md渲染 | Markdown 文件处理 | 高 |
| 代码高亮 | 语法着色、代码着色 | 代码文件处理 | 高 |
| 日志美化 | 日志格式化、日志着色、日志高亮 | 日志文件处理 | 中 |
| 终端格式化 | 输出格式化、文本排版 | 通用格式化需求 | 中 |
| 命令行排版 | 终端排版、命令行美化 | 通用美化需求 | 低 |
2.2 用户原话到触发动作映射表
| 用户原话(示例) | 触发动作 | 执行命令 |
|---|---|---|
| "帮我把这个 Python 文件高亮一下" | 语法高亮 | rich script.py |
| "用 rich 渲染这个 Markdown 文件" | Markdown 渲染 | rich-markdown README.md |
| "这个日志文件太乱了,美化一下" | 日志美化 | rich app.log |
| "终端输出太单调,帮我美化" | 通用美化 | rich -(从 stdin 读取) |
| "给这段代码加上行号显示" | 语法高亮 + 行号 | rich script.py --line-numbers |
| "用深色主题高亮这个 Go 文件" | 语法高亮 + 主题 | rich main.go --theme monokai |
| "批量美化这几个文件" | 批量处理 | rich file1.py file2.js file3.go |
| "把 ls 的输出美化一下" | 管道输入 | ls \| rich - |
2.3 高级场景触发条件
| 高级场景 | 触发条件 | 示例命令 |
|---|---|---|
| 管道输入 | 用户输入包含"管道"、"stdin"、"从标准输入" | cat file.py \| rich - |
| 批量处理 | 用户输入包含"批量"、"多个文件"、"同时处理" | rich a.py b.py c.py |
| 主题切换 | 用户输入包含"主题"、"配色"、"颜色方案" | rich file.py --theme solarized-dark |
| 行号显示 | 用户输入包含"行号"、"编号" | rich file.py --line-numbers |
| 软换行 | 用户输入包含"换行"、"宽度"、"折行" | rich file.py --soft-wrap --line-width 80 |
| 输出重定向 | 用户输入包含"保存"、"输出到文件"、"重定向" | rich file.py > output.txt |
三、标准流程(Standard Workflow)
3.1 执行流程
失败处理
- 输入不符合预期 → 返回错误说明与正确的输入格式示例
- 执行中异常 → 保留中间结果,报告失败原因与已处理进度
- 依赖缺失 → 给出安装命令并重试一次
前置条件
- 无特殊环境要求
输出
- 结构化文本结果,附处理说明
许可证(License)
失败处理
- 输入不符合预期 → 返回错误说明与正确的输入格式示例
- 执行中异常 → 保留中间结果,报告失败原因与已处理进度
- 依赖缺失 → 给出安装命令并重试一次
前置条件
- 无特殊环境要求
执行步骤
- 收集用户输入并确认格式
- 按功能逻辑处理输入内容
- 生成结果并校验完整性
输出
- 结构化文本结果,附处理说明
Current listing version
1.4.1
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 精准定位开发者、运维等技术人员的高频需求
- 提供语法高亮、Markdown预览、日志美化等实用功能
- 能力边界清晰,适用场景明确
Highlights
- 触发词覆盖全面,包含核心功能关键词及同义词
- 提供用户原话到触发动作的完整映射表
- 高级场景触发条件设计合理
Areas to improve
-
结构混乱,Phase未闭合 Reported severity: Major
文档中段突然插入重复的「失败处理」「前置条件」等内容,且Phase 1未正常闭合
Recommendation: 重构文档结构,确保Phase/步骤清晰完整,移除重复内容
-
Document is too long Reported severity: Minor
文档内容约1800字,超出推荐长度
Recommendation: 精简内容,将详细说明移至独立文档或示例文件
-
缺少端到端示例 Reported severity: Minor
缺少完整的端到端使用示例
Recommendation: 添加从输入到输出的完整示例流程
Highlights
- frontmatter完整规范
- 能力边界说明清晰
Highlights
- 工具来源明确(Textualize/rich-cli)
- 参数说明完整,覆盖主要使用场景
- 异常处理机制设计合理
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
No special environmental requirements
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.