一键导入
textual
Build sophisticated Terminal User Interfaces (TUIs) in Python using an async, CSS-inspired framework.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Build sophisticated Terminal User Interfaces (TUIs) in Python using an async, CSS-inspired framework.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Configure and operate ruff-sync to synchronize Ruff linter settings across Python projects. Use when the user wants to set up ruff-sync, sync Ruff config from an upstream source, check for configuration drift, integrate ruff-sync into CI, troubleshoot sync issues, or keep Ruff rules consistent across multiple repositories.
Handle python warnings properly by emitting them with warnings.warn, catching them in tests with catch_warnings, and translating them to errors if running in strict mode or via filterwarnings.
Use this skill to manage multiple versions of documentation for MkDocs-powered sites. Deploy new versions, update aliases (like 'latest' or 'stable'), set the default version for the site root, and manage versioned subdirectories in the deployment branch. Use this whenever the user wants to publish, version, or alias documentation, even if they don't explicitly mention "mike". Also use this when the user wants to troubleshoot or debug versioned documentation.
Generate MkDocs documentation sites with Material theme, mkdocstrings for API docs, and versioning. Use when setting up or extending project documentation.
Systematic workflows for designing types, architecting classes, and resolving static type issues in Python 3.10. Trigger on "new class," "designing," "refactoring," or "mypy errors." Prioritizes healthy design (Generics, Protocols) over narrowing.
Create or update Agent Skills to extend capabilities for specific tasks, frameworks, or domain-specific workflows. Use this when the user asks to "add a skill," "create a tool for X," or "teach the agent how to Y."
| name | textual |
| description | Build sophisticated Terminal User Interfaces (TUIs) in Python using an async, CSS-inspired framework. |
Textual is a Python framework for creating interactive, beautiful Terminal User Interfaces (TUIs). It uses an asynchronous engine and a layout system inspired by modern web development (Flexbox/Grid and CSS).
from __future__ import annotations
from textual.app import App, ComposeResult
from textual.widgets import Header, Footer, Static
class SimpleApp(App[None]):
"""A minimal Textual app."""
BINDINGS = [("q", "quit", "Quit")]
def compose(self) -> ComposeResult:
yield Header()
yield Static("Hello, [bold blue]Textual[/bold blue]!")
yield Footer()
if __name__ == "__main__":
SimpleApp().run()
compose(): Define the UI structure by yield-ing widgets.on_button_pressed).reactive attributes to automatically update the UI when data changes.pilot and App.run_test.[!WARNING]
- 8.2.2 Breaking Changes:
Static.renderableandLabel.renderableare nowStatic.contentandLabel.content.Select.BLANKis nowSelect.NULL.- Fractional Units: Use
frfor fractional units (e.g.width: 1fr). A common typo isrf, which is invalid.- Async Handlers: Event handlers can be
async defordef. Useasyncif you need toawaitI/O orpost_message.- Main Thread: Do not block the main thread with long-running synchronous code. Use
self.run_worker()for background tasks.
$success, $accent) cannot be used directly in Rich markup strings (like in DataTable cells). They must be resolved to hex strings at runtime: str(self.app.get_theme(self.app.theme).success).typing.cast is banned (e.g. by TID251), use a variable annotation with a targeted # type: ignore to resolve query_one results:
tree: MyTree = app.query_one("#tree-id") # type: ignore[assignment]