textual-screenshot
БесплатноБез исполняемых скриптовНе проверенCapture a Textual terminal UI as an SVG using its headless test harness. Use when asked to make, attach, or preview a screenshot of deepagents-code/dcode or…
от langchain-ai★ 31 724 звезды на GitHubОб этом скилле
Textual Screenshot
Render the real app with Textual's headless test harness, drive it to the requested state, and save the composed terminal as SVG. Prefer this over browser automation or OS-level screenshot tools.
Capture workflow
- Identify the
Appclass and the shortest trusted local setup that reaches the requested UI. - Write a temporary Python script outside the repository. Keep generated screenshots outside the repository unless the user explicitly requests a committed artifact.
- Start the app with a deterministic terminal size using
app.run_test(size=(columns, rows)). - Call
await pilot.pause()after startup and after every action that changes visible state. Usepilot.press(...)for a realistic interaction path when practical; direct app methods are acceptable for a focused preview. - Call
app.save_screenshot(output_path)while the desired state is visible. Use an.svgpath. - Inspect the resulting SVG and confirm its file size is reasonable before sharing it.
- Delete temporary scripts and captures when they are no longer needed.
Minimal deepagents-code example:
import asyncio
import os
from pathlib import Path
from tempfile import TemporaryDirectory
from unittest.mock import AsyncMock, MagicMock, patch
async def main() -> None:
output = Path("/tmp/dcode-ui.svg")
with TemporaryDirectory() as profile:
os.environ["DEEPAGENTS_HOME"] = profile
from deepagents_code.app import DeepAgentsApp
app = DeepAgentsApp(agent=MagicMock())
with patch.object(app, "_post_paint_init", new=AsyncMock()):
async with app.run_test(size=(110, 36)) as pilot:
await pilot.pause()
await app._handle_command("/model")
await pilot.pause()
app.save_screenshot(output)
print(output)
asyncio.run(main())
Run from libs/code so the project environment and editable package resolve:
uv run python /tmp/capture_dcode_ui.py
Adapt only the app constructor and action that opens the target state. For a standalone Textual app, import its App subclass and use the same run_test/save_screenshot sequence.
Reliability and safety
- Use trusted local application code only. A headless app can still run startup hooks, subprocesses, or network calls. For
DeepAgentsApp, setDEEPAGENTS_HOMEto a temporary directory before importingdeepagents_code, and mock_post_paint_initbefore mounting; replacing only the agent does not isolate startup side effects. - Never capture secrets, credentials, private conversation content, or unrelated user data. Seed only synthetic content needed for the preview.
- Choose a bounded terminal size; start with
(110, 36)and adjust only when the target clips or wastes substantial space. - Wait for workers, animations, and modal transitions to settle. Add another
await pilot.pause()rather than using arbitrary sleeps. - Do not treat a generated SVG as proof that interaction works. Use normal Textual tests for behavior and the screenshot for visual inspection.
- Do not hand-edit the SVG. Reproduce the intended app state and recapture it.
Установить textual-screenshot в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл textual-screenshot?
Capture a Textual terminal UI as an SVG using its headless test harness. Use when asked to make, attach, or preview a screenshot of deepagents-code/dcode or another Textual app, visually verify a TUI state, or render a modal, screen, or widget without a desktop or browser.
Как установить скилл textual-screenshot?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл textual-screenshot запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic