blob: 5c9d7976f85cac6efa280d3f48d99a6a2cda8c35 [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 Snyder72cf08c2025-07-16 11:58:45 -070028### Install via Homebrew
29
30```sh
31brew install boldsoftware/tap/sketch
32```
33
34Update by running `brew upgrade boldsoftware/tap/sketch`.
35
Josh Bleecher Snyderf3d739f2025-07-16 18:06:38 +000036### Install via GitHub Releases
37
Josh Bleecher Snyder1c18ec92025-07-08 10:55:54 -070038Grab the most recent [nightly release](https://github.com/boldsoftware/sketch/releases).
39
Josh Bleecher Snyderf3d739f2025-07-16 18:06:38 +000040Update by running `sketch -update`.
41
42### Build from source
43
44Clone this repo, and then run:
Josh Bleecher Snyder1c18ec92025-07-08 10:55:54 -070045
Earl Lee2e463fb2025-04-17 11:22:22 -070046```sh
Josh Bleecher Snyder1c18ec92025-07-08 10:55:54 -070047$ make
48$ ./sketch
Earl Lee2e463fb2025-04-17 11:22:22 -070049```
David Crawshaw64d32992025-04-21 09:14:36 -070050
Pokey Rule9007dd92025-05-15 14:38:55 +010051## 🔧 Requirements
David Crawshaw64d32992025-04-21 09:14:36 -070052
Philip Zeyligerbe0da442025-06-20 15:14:24 -070053Currently, Sketch runs on MacOS and Linux. It uses Docker for containers.
Josh Bleecher Snyder5cef9db2025-04-22 16:44:13 -070054
Pokey Rule9007dd92025-05-15 14:38:55 +010055| Platform | Installation |
56| -------- | -------------------------------------------------------------------------- |
Josh Bleecher Snyderf3d739f2025-07-16 18:06:38 +000057| 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 +010058| Linux | `apt install docker.io` (or equivalent for your distro) |
59| WSL2 | Install Docker Desktop for Windows (docker entirely inside WSL2 is tricky) |
David Crawshaw64d32992025-04-21 09:14:36 -070060
61The [sketch.dev](https://sketch.dev) service is used to provide access
62to an LLM service and give you a way to access the web UI from anywhere.
63
Pokey Rule9007dd92025-05-15 14:38:55 +010064## 🤝 Community & Feedback
David Crawshaw64d32992025-04-21 09:14:36 -070065
Pokey Rule9007dd92025-05-15 14:38:55 +010066- **Discord**: Join our community at [https://discord.gg/6w9qNRUDzS](https://discord.gg/6w9qNRUDzS)
67- **GitHub Issues**: Submit feedback at [https://github.com/boldsoftware/sketch/issues](https://github.com/boldsoftware/sketch/issues)
David Crawshaw64d32992025-04-21 09:14:36 -070068
Pokey Rule9007dd92025-05-15 14:38:55 +010069## 📖 User Guide
David Crawshaw64d32992025-04-21 09:14:36 -070070
Pokey Rule9007dd92025-05-15 14:38:55 +010071### Getting Started
Josh Bleecher Snyder39ed5a52025-05-12 17:34:45 -070072
Pokey Rule9007dd92025-05-15 14:38:55 +010073Start 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 -070074
Pokey Rule9007dd92025-05-15 14:38:55 +010075Ask 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 -070076when the Sketch agent's turn is done, and there's something to look at.
77
78### How Sketch Works
79
80<!-- TODO: innie/outtie picture -->
81
Pokey Rule9007dd92025-05-15 14:38:55 +010082When you start Sketch, it:
Philip Zeyliger5ebdbb82025-05-10 17:20:29 -070083
Pokey Rule9007dd92025-05-15 14:38:55 +0100841. Creates a Dockerfile
852. Builds it
863. Copies your repository into it
874. Starts a Docker container with the "inside" Sketch running
88
89This 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.
90
91Sketch'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 -070092
93### Getting Your Git Changes Out
94
95<!-- TODO: git picture -->
96
Pokey Rule9007dd92025-05-15 14:38:55 +010097Sketch is trained to make Git commits. When those happen, they are
Philip Zeyliger5ebdbb82025-05-10 17:20:29 -070098automatically pushed to the git repository where you started sketch with branch
Pokey Rule9007dd92025-05-15 14:38:55 +010099names `sketch/*`.
Philip Zeyliger5ebdbb82025-05-10 17:20:29 -0700100
Pokey Rule9007dd92025-05-15 14:38:55 +0100101**Finding Sketch branches:**
Philip Zeyliger5ebdbb82025-05-10 17:20:29 -0700102
Pokey Rule9007dd92025-05-15 14:38:55 +0100103```sh
104git branch -a --sort=creatordate | grep sketch/ | tail
105```
106
107The 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:
108
109```sh
110git cherry-pick $(git merge-base origin/main sketch/foo)
111```
112
113or merge the branch
114
115```sh
116git merge sketch/foo
117```
118
119or reset to the branch
120
121```sh
122git reset --hard sketch/foo
123```
124
125Ie use the same workflows you would if you were pulling in a friend's Pull Request.
126
127**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.
128
129Don'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 -0700130
131### Reviewing Diffs
132
133The diff view shows you changes since Sketch started. Leaving comments on lines
Josh Bleecher Snyder39ed5a52025-05-12 17:34:45 -0700134adds 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 -0700135comments.
136
Philip Zeyliger6458e7c2025-05-10 18:07:54 -0700137### Connecting to Sketch's Container
138
Pokey Rule9007dd92025-05-15 14:38:55 +0100139You can interact directly with the container in three ways:
Philip Zeyliger6458e7c2025-05-10 18:07:54 -0700140
Pokey Rule9007dd92025-05-15 14:38:55 +01001411. **Web UI Terminal**: Use the "Terminal" tab in the UI
1422. **SSH**: Look at the startup logs or click the information icon to see a command like `ssh sketch-ilik-eske-tcha-lott`.
143 We have automatically configured your SSH configuration to make these special hostnames work.
1443. **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
145 can edit the code, use the terminal, review diffs, and so forth.
Philip Zeyliger6458e7c2025-05-10 18:07:54 -0700146
Pokey Rule9007dd92025-05-15 14:38:55 +0100147Using 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 -0700148
Pokey Rule9007dd92025-05-15 14:38:55 +0100149```sh
150# Forward container port 8888 to local port 8000
151ssh -L8000:localhost:8888 sketch-ilik-epor-tfor-ward go run ./cmd/server
152```
Philip Zeyliger6458e7c2025-05-10 18:07:54 -0700153
Pokey Rule9007dd92025-05-15 14:38:55 +0100154This makes `http://localhost:8000/` on your machine point to `localhost:8888` inside the container.
155
156### Using Browser Tools
Philip Zeyliger5ebdbb82025-05-10 17:20:29 -0700157
158You can ask Sketch to browse a web page and take screenshots. There are tools
Josh Bleecher Snyder39ed5a52025-05-12 17:34:45 -0700159both for taking screenshots and "reading images", the latter of which sends the
Philip Zeyliger5ebdbb82025-05-10 17:20:29 -0700160image to the LLM. This functionality is handy if you're working on a web page and
161want to see what the in-progress change looks like.
162
Pokey Rule9007dd92025-05-15 14:38:55 +0100163## ❓ FAQ
Philip Zeyliger39bcf012025-05-12 10:07:40 -0700164
Pokey Rule9007dd92025-05-15 14:38:55 +0100165### "No space left on device"
Philip Zeyliger39bcf012025-05-12 10:07:40 -0700166
Pokey Rule9007dd92025-05-15 14:38:55 +0100167Docker images, containers, and so forth tend to pile up. Ask Docker to prune unused images and containers:
Philip Zeyliger39bcf012025-05-12 10:07:40 -0700168
Pokey Rule9007dd92025-05-15 14:38:55 +0100169```sh
170docker system prune -a
171```
172
173## 🛠️ Development
Philip Zeyligerd43e5722025-04-23 19:21:26 -0700174
M-Ab5cb9542025-05-02 11:32:34 -0400175[![Go Reference](https://pkg.go.dev/badge/sketch.dev.svg)](https://pkg.go.dev/sketch.dev)
176
Pokey Rule9007dd92025-05-15 14:38:55 +0100177See [CONTRIBUTING.md](CONTRIBUTING.md) for development guidelines.
Philip Zeyligerd43e5722025-04-23 19:21:26 -0700178
Pokey Rule9007dd92025-05-15 14:38:55 +0100179## 📄 Open Source
David Crawshaw64d32992025-04-21 09:14:36 -0700180
181Sketch is open source.
182It is right here in this repository!
183Have a look around and mod away.
184
Pokey Rule9007dd92025-05-15 14:38:55 +0100185If 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!)