# termDRAW

> A terminal drawing editor for creating editable diagrams, UI mocks, and ASCII art without leaving the terminal.

termDRAW is an open-source, agent-friendly ASCII illustrator for the terminal, built by Ben Vinegar and licensed under MIT. It lets developers create editable diagrams, UI mocks, and text graphics entirely within a terminal environment, outputting plain text rather than SVG or bitmap graphics. The project is written in TypeScript, requires Bun 1.3+, and is actively maintained on GitHub.

## What It Is

termDRAW is a terminal-native drawing editor that fills the gap between heavyweight diagramming tools and quick ASCII sketches. It operates as an interactive, mouse-supported TUI (terminal user interface) application where users draw shapes and text, then export the result as plain text, fenced Markdown code blocks, or native `.td.json` documents that can be reopened and edited later. The tool is explicitly described as "agent-friendly," meaning it is designed to work well in AI-assisted and automated developer workflows.

## Package Architecture

termDRAW ships as a monorepo with three distinct packages:

- **`@termdraw/app`** — the standalone CLI tool, installed globally and invoked with the `termdraw` command
- **`@termdraw/opentui`** — embeddable React-style components built on OpenTUI, allowing termDRAW to be embedded inside other terminal applications
- **`@termdraw/pi`** — a Pi package that opens termDRAW as an overlay inside the Pi environment

This modular design means the drawing engine can be used as a library, not just a standalone tool.

## CLI Workflow

After installing via `npm install --global @termdraw/app`, users launch the editor with `termdraw`. Key workflow steps include:

- Draw interactively using mouse support in a compatible terminal
- Press `Enter` or `Ctrl+S` to export rendered art to stdout
- Press `Ctrl+D` to save the editable `.td.json` diagram file
- Use `--load` to reopen an existing diagram for further editing
- Use `--output` to write rendered art directly to a file
- Use `--fenced` to export a Markdown-fenced code block

The native `.td.json` format preserves object metadata for re-editing; plain-text export is a one-way render.

## Embedding in OpenTUI Apps

The `@termdraw/opentui` package exposes React-compatible components (`TermDrawApp`, `TermDrawEditor`, `TermDraw`) and renderables for embedding the drawing canvas inside custom terminal applications. Developers can wire up `onSave`, `onSaveDiagram`, and `onCancel` callbacks, pass an `initialDocument`, and control layout with `width`/`height` props — making it composable within larger TUI projects built on `@opentui/core` and `@opentui/react`.

## Update: v0.4.1

The latest release is **v0.4.1**, published in May 2026. The repository was created in April 2026 and has seen active development, accumulating 299 stars and 11 forks on GitHub as of late August 2026. The project has 8 open issues and CI is tracked via GitHub Actions on the main branch, signaling an actively maintained early-stage open-source tool.

## Features
- Interactive terminal drawing editor with mouse support
- Export to plain text, fenced Markdown, or native .td.json format
- Editable native .td.json documents for re-opening and modifying diagrams
- Standalone CLI via @termdraw/app package
- Embeddable OpenTUI React components via @termdraw/opentui
- Pi overlay integration via @termdraw/pi
- Agent-friendly ASCII illustration
- stdin/stdout pipeline support
- Ctrl+S / Enter to export, Ctrl+D to save diagram
- MIT licensed open-source

## Integrations
Bun, OpenTUI, Pi, npm, React (via @opentui/react), GitHub Actions CI

## Platforms
API, DEVELOPER_SDK, CLI

## Pricing
Open Source

## Version
v0.4.1

## Links
- Website: https://github.com/benvinegar/termdraw
- Documentation: https://github.com/benvinegar/termdraw/tree/main/packages/app
- Repository: https://github.com/benvinegar/termdraw
- EveryDev.ai: https://www.everydev.ai/tools/termdraw
