draw
draw is a small terminal canvas. It opens an alternate screen, tracks mouse input, and renders drawings as ASCII characters with optional ANSI color.
Install
go install github.com/jmcntsh/draw@latest
Run it with:
draw
If your Go bin directory is not on your PATH, add it first:
export PATH="$(go env GOPATH)/bin:$PATH"
Controls
- Drag with the left mouse button to use the current tool.
- Right-click drag to erase.
- Press
b, e, l, r, o, f, or v to choose brush, eraser, line, rectangle, ellipse, fill, or selection.
- Press
- for a smaller brush and + for a bigger brush. The footer shows this as brush 1 (+/- change size).
- Press
x to choose the drawing character.
- Press
tab to cycle colors, or press 1 through 6 to pick a color directly. The first palette color is black.
- Press
h to enter a custom hex color, such as #ff8800.
- Press
u to undo and ctrl+r to redo.
- Press
c to clear.
- Press
s to save the canvas. Enter a custom name, or leave it blank to use a timestamp.
- Press
q, esc, or ctrl+c to quit.
Saved drawings are written to the drawings/ directory:
<name>.draw.json is the editable native file.
<name>.ansi.txt is the colored terminal view.
<name>.txt is plain ASCII.
Viewing Drawings
List saved drawings:
draw list
Print a saved drawing:
draw open my-drawing
Edit a saved drawing:
draw edit my-drawing
Start with a specific canvas size:
draw --size 80x24
Export a saved drawing:
draw export my-drawing --format svg
draw export my-drawing --format ansi
draw export my-drawing --format txt