Skip to content

Kartik-2239/cli-draw

Repository files navigation

cli-draw (Made with lightcode)

A small terminal drawing tool with mouse support.

cli-draw demo

Install

Clone the repo:

git clone https://github.com/Kartik-2239/cli-draw.git
cd cli-draw

Install with uv:

uv sync

Run it:

uv run cli-draw

Open Or Save A File

Open an existing drawing:

uv run cli-draw artwork.txt

Set the save path:

uv run cli-draw --save output.txt

Open a file and save back to another path:

uv run cli-draw artwork.txt --save output.txt

Controls

  • Left click: draw
  • Left click + drag: draw continuously
  • 0 to 7: change color
  • b: change brush character
  • c: clear
  • u: undo
  • s: save
  • y: copy ANSI-colored output to clipboard
  • q or Esc: quit

Notes

  • Files saved by the app keep ANSI colors.
  • If mouse drag does not work, use a terminal with mouse reporting enabled.

Config

The app stores config here:

~/.cli-draw/config.json

It is created automatically the first time you run cli-draw.

Example:

{
  "colors": [
    { "id": 0, "name": "black", "hex": "#000000" },
    { "id": 1, "name": "red", "hex": "#FF0000" },
    { "id": 2, "name": "green", "hex": "#00FF00" },
    { "id": 3, "name": "yellow", "hex": "#FFFF00" },
    { "id": 4, "name": "blue", "hex": "#0000FF" },
    { "id": 5, "name": "magenta", "hex": "#FF00FF" },
    { "id": 6, "name": "cyan", "hex": "#00FFFF" },
    { "id": 7, "name": "white", "hex": "#FFFFFF" }
  ],
  "brushes": ["#", "*", ".", " ", "o", "x", "@", "+"]
}

You can change:

  • colors: the 8 colors used by keys 0 to 7
  • brushes: the default brush characters available in the config

Color values should be hex strings like #FF0000.

About

draw ascii arts directly in the cli.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages