Install
openclaw skills install richRich - Python 终端富文本和美化格式库
openclaw skills install rich本技能帮助用户使用 Rich 在 Python 终端程序中输出美观的富文本内容,支持以下场景:
GitHub: https://github.com/Textualize/rich(56k+ Stars)
AI 助手将引导你完成以下步骤:
当你向 AI 描述终端输出需求时,AI 会:
# 最简单的用法 - 使用全局 print
from rich import print
print("[bold magenta]Hello[/bold magenta], [green]World[/green]! :sparkles:")
# 使用 Console 对象
from rich.console import Console
console = Console()
console.print("[bold]Rich[/bold] is [italic green]awesome[/italic green]!")
# 美化打印 Python 对象
from rich import pretty
pretty.install()
{"name": "rich", "stars": 56000, "features": ["color", "table", "progress"]}
# 渲染表格
from rich.console import Console
from rich.table import Table
console = Console()
table = Table(title="Python 包对比")
table.add_column("名称", style="cyan", no_wrap=True)
table.add_column("Stars", style="magenta")
table.add_column("用途", style="green")
table.add_row("rich", "56k+", "终端美化")
table.add_row("click", "14k+", "命令行解析")
table.add_row("typer", "13k+", "CLI 框架")
console.print(table)
# 进度条
from rich.progress import track
for step in track(range(100), description="处理中..."):
# 执行任务
pass
MIT License