1.9 KiB
1.9 KiB
hako project idea
a single tool (written in go) that manages docker images/containers for claude code to be in
these containers provide a sandbox so that there's less possibility of claude accidentally causing issues outside of the current working directory
proposed UI:
# builds the base hako image (debian:bookworm + node (latest lts) + npm install -g @anthropic-ai/claude-code + gcc)
# this writes to ~/.config/hako/Dockerfile.base with the defaults
# if you want to customize the base image, then edit the dockerfile and rerun `hako init`
# NOTE: dockerfiles have some special metadata on the first comment (say `# HAKO-VERSION=1`, this is important because if we want to edit the base one we would have to require
# users to wipe their dockerfiles first and then do it. we should be able to _warn_ them of that while running hako commands, and then init recreates the dockerfile on the latest version)
# target image name: hako-userland
hako init
# creates a Dockerfile.go that uses FROM as the hako base image, and installs golang
# builds the relevant image: hako-userland-go
hako init go
# same for python, etc
hako init py
# then, when inside a git project (must fail outside of git), `hako up` will:
# create a container if it doesnt exist: hako-go-<folder name of the folder that contains .git>-<folder>-<folder...> (must sanitize folder names)
# - if too long, then error to the user for now
# copy the currently working directory to a folder: /workspace
# immediately drop you into a shell inside that folder: /workspace
# you can immediately go in and type `claude`
# NOTE if container is already running just drop the shell
hako up go
# get files from container /workspace into working directory, ignores .gitignore and .git to prevent RCE
hako sync
# show all running containers
hako ps
# spin down a container, spins the current directory's container if not specified
hako down [container name]