blob: 9df90e982c43e8cdcda300cc20d97fa6312438d2 [file] [log] [blame] [view]
Pokey Rule9007dd92025-05-15 14:38:55 +01001<div align="center">
2
3<img src="https://storage.googleapis.com/sketch-assets/sketch-logo.png" alt="Sketch Logo" width="300"/>
4
Earl Lee2e463fb2025-04-17 11:22:22 -07005# Sketch
6
Pokey Rule9007dd92025-05-15 14:38:55 +01007[![Go Reference](https://pkg.go.dev/badge/sketch.dev.svg)](https://pkg.go.dev/sketch.dev)
Pokey Rule124c9422025-05-15 19:07:50 +01008[![Discord](https://img.shields.io/discord/1362869091156758752?logo=discord&logoColor=white&label=Discord)](https://discord.gg/6w9qNRUDzS)
Pokey Rule9007dd92025-05-15 14:38:55 +01009[![GitHub Workflow Status](https://github.com/boldsoftware/sketch/actions/workflows/go_test.yml/badge.svg)](https://github.com/boldsoftware/sketch/actions/workflows/go_test.yml)
10[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/boldsoftware/sketch/blob/main/LICENSE)
11
12**Sketch is an agentic coding tool. It draws the 🦉**
13
14</div>
15
16## 🚀 Overview
Philip Zeyliger3b279a52025-05-07 21:02:03 -070017
18Sketch runs in your terminal, has a web UI, understands your code, and helps
19you get work done. To keep your environment pristine, sketch starts a docker
20container and outputs its work onto a branch in your host git repository.
21
Josh Bleecher Snyder39ed5a52025-05-12 17:34:45 -070022Sketch helps with most programming environments, but Sketch has extra goodies for Go.
Earl Lee2e463fb2025-04-17 11:22:22 -070023
Pokey Rule9007dd92025-05-15 14:38:55 +010024<img src="https://storage.googleapis.com/sketch-assets/screenshot.jpg" alt="Sketch Screenshot" width="800"/>
25
26## 📋 Quick Start
Earl Lee2e463fb2025-04-17 11:22:22 -070027
Josh Bleecher Snyderf3d739f2025-07-16 18:06:38 +000028### Install via GitHub Releases
29
Josh Bleecher Snyder1c18ec92025-07-08 10:55:54 -070030Grab the most recent [nightly release](https://github.com/boldsoftware/sketch/releases).
31
Josh Bleecher Snyderf3d739f2025-07-16 18:06:38 +000032Update by running `sketch -update`.
33
34### Build from source
35
36Clone this repo, and then run:
Josh Bleecher Snyder1c18ec92025-07-08 10:55:54 -070037
Earl Lee2e463fb2025-04-17 11:22:22 -070038```sh
Josh Bleecher Snyder1c18ec92025-07-08 10:55:54 -070039$ make
40$ ./sketch
Earl Lee2e463fb2025-04-17 11:22:22 -070041```
David Crawshaw64d32992025-04-21 09:14:36 -070042
Pokey Rule9007dd92025-05-15 14:38:55 +010043## 🔧 Requirements
David Crawshaw64d32992025-04-21 09:14:36 -070044
Philip Zeyligerbe0da442025-06-20 15:14:24 -070045Currently, Sketch runs on MacOS and Linux. It uses Docker for containers.
Josh Bleecher Snyder5cef9db2025-04-22 16:44:13 -070046
Pokey Rule9007dd92025-05-15 14:38:55 +010047| Platform | Installation |
48| -------- | -------------------------------------------------------------------------- |
Josh Bleecher Snyderf3d739f2025-07-16 18:06:38 +000049| MacOS | `brew install colima` (or [OrbStack](https://orbstack.dev/) or [Docker Desktop](https://www.docker.com/products/docker-desktop/)) |
Pokey Rule9007dd92025-05-15 14:38:55 +010050| Linux | `apt install docker.io` (or equivalent for your distro) |
51| WSL2 | Install Docker Desktop for Windows (docker entirely inside WSL2 is tricky) |
David Crawshaw64d32992025-04-21 09:14:36 -070052
53The [sketch.dev](https://sketch.dev) service is used to provide access
54to an LLM service and give you a way to access the web UI from anywhere.
55
Pokey Rule9007dd92025-05-15 14:38:55 +010056## 🤝 Community & Feedback
David Crawshaw64d32992025-04-21 09:14:36 -070057
Pokey Rule9007dd92025-05-15 14:38:55 +010058- **Discord**: Join our community at [https://discord.gg/6w9qNRUDzS](https://discord.gg/6w9qNRUDzS)
59- **GitHub Issues**: Submit feedback at [https://github.com/boldsoftware/sketch/issues](https://github.com/boldsoftware/sketch/issues)
David Crawshaw64d32992025-04-21 09:14:36 -070060
Pokey Rule9007dd92025-05-15 14:38:55 +010061## 📖 User Guide
David Crawshaw64d32992025-04-21 09:14:36 -070062
Pokey Rule9007dd92025-05-15 14:38:55 +010063### Getting Started
Josh Bleecher Snyder39ed5a52025-05-12 17:34:45 -070064
Pokey Rule9007dd92025-05-15 14:38:55 +010065Start Sketch by running `sketch` in a Git repository. It will open your browser to the Sketch chat interface, but you can also use the CLI interface. Use `-open=false` if you want to use just the CLI interface.
Philip Zeyliger5ebdbb82025-05-10 17:20:29 -070066
Pokey Rule9007dd92025-05-15 14:38:55 +010067Ask Sketch about your codebase or ask it to implement a feature. It may take a little while for Sketch to do its work, so hit the bell (🔔) icon to enable browser notifications. We won't spam you or anything; it will notify you
Philip Zeyliger5ebdbb82025-05-10 17:20:29 -070068when the Sketch agent's turn is done, and there's something to look at.
69
70### How Sketch Works
71
72<!-- TODO: innie/outtie picture -->
73
Pokey Rule9007dd92025-05-15 14:38:55 +010074When you start Sketch, it:
Philip Zeyliger5ebdbb82025-05-10 17:20:29 -070075
Pokey Rule9007dd92025-05-15 14:38:55 +0100761. Creates a Dockerfile
772. Builds it
783. Copies your repository into it
794. Starts a Docker container with the "inside" Sketch running
80
81This design lets you **run multiple sketches in parallel** since they each have their own sandbox. It also lets Sketch work without worry: it can trash its own container, but it can't trash your machine.
82
83Sketch's agentic loop uses tool calls (mostly shell commands, but also a handful of other important tools) to allow the LLM to interact with your codebase.
Philip Zeyliger5ebdbb82025-05-10 17:20:29 -070084
85### Getting Your Git Changes Out
86
87<!-- TODO: git picture -->
88
Pokey Rule9007dd92025-05-15 14:38:55 +010089Sketch is trained to make Git commits. When those happen, they are
Philip Zeyliger5ebdbb82025-05-10 17:20:29 -070090automatically pushed to the git repository where you started sketch with branch
Pokey Rule9007dd92025-05-15 14:38:55 +010091names `sketch/*`.
Philip Zeyliger5ebdbb82025-05-10 17:20:29 -070092
Pokey Rule9007dd92025-05-15 14:38:55 +010093**Finding Sketch branches:**
Philip Zeyliger5ebdbb82025-05-10 17:20:29 -070094
Pokey Rule9007dd92025-05-15 14:38:55 +010095```sh
96git branch -a --sort=creatordate | grep sketch/ | tail
97```
98
99The UI keeps track of the latest branch it pushed and displays it prominently. You can use standard Git workflows to pull those branches into your workspace:
100
101```sh
102git cherry-pick $(git merge-base origin/main sketch/foo)
103```
104
105or merge the branch
106
107```sh
108git merge sketch/foo
109```
110
111or reset to the branch
112
113```sh
114git reset --hard sketch/foo
115```
116
117Ie use the same workflows you would if you were pulling in a friend's Pull Request.
118
119**Advanced:** You can ask Sketch to `git fetch sketch-host` and rebase onto another commit. This will also fetch where you started Sketch, and we do a bit of "git fetch refspec configuration" to make `origin/main` work as a git reference.
120
121Don't be afraid of asking Sketch to help you rebase, merge/squash commits, rewrite commit messages, and so forth; it's good at it!
Philip Zeyliger5ebdbb82025-05-10 17:20:29 -0700122
123### Reviewing Diffs
124
125The diff view shows you changes since Sketch started. Leaving comments on lines
Josh Bleecher Snyder39ed5a52025-05-12 17:34:45 -0700126adds them to the chat box, and, when you hit Send (at the bottom of the page), Sketch goes to work addressing your
Philip Zeyliger5ebdbb82025-05-10 17:20:29 -0700127comments.
128
Philip Zeyliger6458e7c2025-05-10 18:07:54 -0700129### Connecting to Sketch's Container
130
Pokey Rule9007dd92025-05-15 14:38:55 +0100131You can interact directly with the container in three ways:
Philip Zeyliger6458e7c2025-05-10 18:07:54 -0700132
Pokey Rule9007dd92025-05-15 14:38:55 +01001331. **Web UI Terminal**: Use the "Terminal" tab in the UI
1342. **SSH**: Look at the startup logs or click the information icon to see a command like `ssh sketch-ilik-eske-tcha-lott`.
135 We have automatically configured your SSH configuration to make these special hostnames work.
1363. **Visual Studio Code**: Look for a command line or magic link behind the information icon, or when Sketch starts up. This starts a new VSCode session "remoted into" the container. You
137 can edit the code, use the terminal, review diffs, and so forth.
Philip Zeyliger6458e7c2025-05-10 18:07:54 -0700138
Pokey Rule9007dd92025-05-15 14:38:55 +0100139Using SSH (and/or VSCode) allows you to forward ports from the container to your machine. For example, if you want to start your development webserver, you can do something like this:
Philip Zeyliger6458e7c2025-05-10 18:07:54 -0700140
Pokey Rule9007dd92025-05-15 14:38:55 +0100141```sh
142# Forward container port 8888 to local port 8000
143ssh -L8000:localhost:8888 sketch-ilik-epor-tfor-ward go run ./cmd/server
144```
Philip Zeyliger6458e7c2025-05-10 18:07:54 -0700145
Pokey Rule9007dd92025-05-15 14:38:55 +0100146This makes `http://localhost:8000/` on your machine point to `localhost:8888` inside the container.
147
148### Using Browser Tools
Philip Zeyliger5ebdbb82025-05-10 17:20:29 -0700149
150You can ask Sketch to browse a web page and take screenshots. There are tools
Josh Bleecher Snyder39ed5a52025-05-12 17:34:45 -0700151both for taking screenshots and "reading images", the latter of which sends the
Philip Zeyliger5ebdbb82025-05-10 17:20:29 -0700152image to the LLM. This functionality is handy if you're working on a web page and
153want to see what the in-progress change looks like.
154
Pokey Rule9007dd92025-05-15 14:38:55 +0100155## ❓ FAQ
Philip Zeyliger39bcf012025-05-12 10:07:40 -0700156
Pokey Rule9007dd92025-05-15 14:38:55 +0100157### "No space left on device"
Philip Zeyliger39bcf012025-05-12 10:07:40 -0700158
Pokey Rule9007dd92025-05-15 14:38:55 +0100159Docker images, containers, and so forth tend to pile up. Ask Docker to prune unused images and containers:
Philip Zeyliger39bcf012025-05-12 10:07:40 -0700160
Pokey Rule9007dd92025-05-15 14:38:55 +0100161```sh
162docker system prune -a
163```
164
165## 🛠️ Development
Philip Zeyligerd43e5722025-04-23 19:21:26 -0700166
M-Ab5cb9542025-05-02 11:32:34 -0400167[![Go Reference](https://pkg.go.dev/badge/sketch.dev.svg)](https://pkg.go.dev/sketch.dev)
168
Pokey Rule9007dd92025-05-15 14:38:55 +0100169See [CONTRIBUTING.md](CONTRIBUTING.md) for development guidelines.
Philip Zeyligerd43e5722025-04-23 19:21:26 -0700170
Pokey Rule9007dd92025-05-15 14:38:55 +0100171## 📄 Open Source
David Crawshaw64d32992025-04-21 09:14:36 -0700172
173Sketch is open source.
174It is right here in this repository!
175Have a look around and mod away.
176
Pokey Rule9007dd92025-05-15 14:38:55 +0100177If you want to run Sketch entirely without the sketch.dev service, you can set the flag `-skaband-addr=""` and then provide an `ANTHROPIC_API_KEY` environment variable. (More LLM services coming soon!)