Skip to content
Agentmart
Submit a tool

textual-screenshot

Capture a Textual terminal UI as an SVG using its headless test harness.

Skill by langchain-aiOfficial

IndexedMIT★ 30,550
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/langchain-ai-textual-screenshot

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

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.

Use cases: design, testing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/textual-screenshot

What's inside

Skill name
textual-screenshot
Description
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.
License
MIT
Compatibility
designed for deepagents-code and Textual apps
Instructions
61 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# 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

1. Identify the `App` class and the shortest trusted local setup that reaches the requested UI.
2. Write a temporary Python script outside the repository. Keep generated screenshots outside the repository unless the user explicitly requests a committed artifact.
3. Start the app with a deterministic terminal size using `app.run_test(size=(columns, rows))`.
4. Call `await pilot.pause()` after startup and after every action that changes visible state. Use `pilot.press(...)` for a realistic interaction path when practical; direct app methods are acceptable for a focused preview.
5. Call `app.save_screenshot(output_path)` while the desired state is visible. Use an `.svg` path.
6. Inspect the resulting SVG and confirm its file size is reasonable before sharing it.
7. Delete temporary scripts and captures when they are no longer needed.

Minimal deepagents-code example:

```python
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:

```bash
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`, set `DEEPAGENTS_HOME` to a temporary directory before importing `deepagents_code`, and mock `_post_paint_init` before 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.

From langchain-ai/deepagents, MIT.

More from langchain-ai/deepagents

Compare and alternatives

Featured in

Signals

Stars
30,550
Forks
4,302
Open issues
163
Last commit (this folder)
Aug 28, 2026 (2 months ago)
Last release
Oct 23, 2026 (4 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from langchain-ai

Cite this page

textual-screenshot skill. Agent Mart. https://agentmart.dev/skills/langchain-ai-textual-screenshot (last updated 2026-10-24)