sketch: Linux support

Together with 8a89e1cbd3e7c9bbe1c561e88141527a0c894e06, this
should resolve https://github.com/boldsoftware/sketch/issues/3,
in supporting Linux.

To test on a Mac, run "limactl shell default go run ./cmd/sketch -verbose", assuming
you have a lima default VM with sketch's dependencies already prepped.

The issues we encountered were:

1. Explicit checks for "is Colima installed", "is docker installed",
   etc. Easy enough to fix these.

2. When go's toolchain builds, it puts the output in different places
   depending whether it's cross-compiled or not. Fine, we adapt.
   Note that os.Rename() doesn't always work, and we fall back to
   copy/delete. Mode has to be set appropriately to, to make the
   /bin/sketch executable executable.

   Re-building is kind of silly: we could use /proc/self/exe, for
   example, or cross-mount the binary into the container, or any
   number of other things. That said, here we keep the paths the same.

3. Docker networking setup for the git server. The host git repo
   is served with git's cgi-bin wrapper. host.docker.internal
   seems to work different in colima vs Ubuntu's docker.io, so
   an extra command line flag to docker was added. Then,
   it turns out that our git server checks that the remote is
   127.0.0.1, which seems to be how Colima does its networking,
   but isn't the case for Docker in general. To handle this, we
   use HTTP Basic Auth with a random password. (Git also has
   an "http.extraHeader" configuration, but basic auth seems just
   as good and more obvious.)

Incidentally, I'm also adding the git remote as a git remote
named "sketch-host" to make it easier to work with in the terminal,
if necessary.
4 files changed
tree: cbe3fb6cb160fea4379e822fcca2cfcbe5bc51cf
  1. .github/
  2. .vscode/
  3. ant/
  4. claudetool/
  5. cmd/
  6. dockerimg/
  7. httprr/
  8. loop/
  9. skabandclient/
  10. skribe/
  11. termui/
  12. .gitignore
  13. go.mod
  14. go.sum
  15. LICENSE
  16. README.md
README.md

Sketch

Sketch is an agentic coding tool focused on the Go programming language. Sketch runs in your terminal, has a web UI, understands your code, and helps you get work done. To keep your environment pristine, sketch starts a docker container and outputs its work onto a branch in your host git repository.

To get started:

go install sketch.dev/cmd/sketch@latest
sketch

Requirements

Currently sketch only runs on macOS. It uses docker/colima (installable via homebrew) for containers.

The sketch.dev service is used to provide access to an LLM service and give you a way to access the web UI from anywhere.

Feedback/discussion

We have a discord server to discuss sketch.

Join if you want! https://discord.gg/2xG3KEG3

Open Source

Sketch is open source. It is right here in this repository! Have a look around and mod away.

If 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!)