Skip to content

Commit 902def7

Browse files
committed
Initial OSS release of back2base tooling
CLI and container runtime extracted from back2base, with the hosted features removed: no claudeproxy gateway, no cloud config sync, no durable-object memory, no Auth0 sign-in. Includes the Cobra-based CLI (run/shell/doctor/explore/profile/prune/mcp/overview/etc.), the embedded container payload (Dockerfile, compose, entrypoint, MCP profile defaults, skills, slash commands), CI workflows, and a goreleaser config for tagged releases.
0 parents  commit 902def7

181 files changed

Lines changed: 26552 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
name: Test
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-go@v5
17+
with:
18+
go-version-file: go.mod
19+
20+
- run: go vet ./...
21+
22+
- run: go test -v -race -count=1 ./...
23+
24+
lint:
25+
name: Lint
26+
runs-on: ubuntu-latest
27+
# Advisory only — lint findings surface in CI but don't gate build/release.
28+
# The lint job's exit code is non-blocking; tests are still required.
29+
continue-on-error: true
30+
steps:
31+
- uses: actions/checkout@v4
32+
33+
- uses: actions/setup-go@v5
34+
with:
35+
go-version-file: go.mod
36+
37+
- uses: golangci/golangci-lint-action@v7
38+
continue-on-error: true
39+
with:
40+
version: v2.1
41+
42+
build:
43+
name: Build
44+
runs-on: ubuntu-latest
45+
needs: [test]
46+
strategy:
47+
matrix:
48+
goos: [linux, darwin]
49+
goarch: [amd64, arm64]
50+
steps:
51+
- uses: actions/checkout@v4
52+
53+
- uses: actions/setup-go@v5
54+
with:
55+
go-version-file: go.mod
56+
57+
- run: go build -o /dev/null .
58+
env:
59+
GOOS: ${{ matrix.goos }}
60+
GOARCH: ${{ matrix.goarch }}

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- uses: actions/setup-go@v5
20+
with:
21+
go-version-file: go.mod
22+
23+
- name: Run tests
24+
run: go test -v ./...
25+
26+
- uses: goreleaser/goreleaser-action@v6
27+
with:
28+
version: "~> v2"
29+
args: release --clean
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/oss-back2base
2+
/back2base
3+
dist/
4+
*.test
5+
*.out
6+
.DS_Store

.goreleaser.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
version: 2
2+
3+
builds:
4+
- id: oss-back2base
5+
main: "."
6+
binary: oss-back2base
7+
ldflags:
8+
- -s -w
9+
- -X main.version={{.Version}}
10+
- -X main.commit={{.ShortCommit}}
11+
- -X main.date={{.Date}}
12+
- -X main.baseImageTag=v{{.Version}}
13+
env:
14+
- CGO_ENABLED=0
15+
goos:
16+
- darwin
17+
- linux
18+
goarch:
19+
- amd64
20+
- arm64
21+
22+
archives:
23+
- id: default
24+
formats: ['tar.gz']
25+
name_template: "oss-back2base_{{ .Os }}_{{ .Arch }}"
26+
27+
nfpms:
28+
- id: oss-back2base
29+
package_name: oss-back2base
30+
vendor: voltcyclone
31+
homepage: "https://github.com/voltcyclone/oss-back2base"
32+
maintainer: "voltcyclone"
33+
description: "Containerized Claude Code with curated MCP servers (OSS)"
34+
license: MIT
35+
formats:
36+
- deb
37+
dependencies:
38+
- docker.io | docker-ce
39+
recommends:
40+
- docker-compose-plugin
41+
section: devel
42+
priority: optional
43+
44+
checksum:
45+
name_template: "checksums.txt"
46+
47+
changelog:
48+
sort: asc
49+
filters:
50+
exclude:
51+
- "^docs:"
52+
- "^test:"
53+
- "^chore:"

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 voltcyclone
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
.PHONY: build test clean release lint install
2+
3+
VERSION ?= dev
4+
COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo "none")
5+
DATE := $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
6+
LDFLAGS := -s -w -X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.date=$(DATE) -X main.baseImageTag=$(VERSION)
7+
8+
# Build the binary
9+
build:
10+
go build -ldflags "$(LDFLAGS)" -o oss-back2base .
11+
12+
# Run all tests
13+
test:
14+
go test -v ./...
15+
16+
# Remove build artifacts
17+
clean:
18+
rm -f oss-back2base
19+
rm -rf dist/
20+
21+
# Local release (dry-run)
22+
release:
23+
goreleaser release --snapshot --clean
24+
25+
# Lint
26+
lint:
27+
go vet ./...
28+
29+
# Install locally (for development)
30+
install: build
31+
mkdir -p $(HOME)/.local/bin
32+
cp oss-back2base $(HOME)/.local/bin/oss-back2base

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# oss-back2base
2+
3+
Containerized [Claude Code](https://docs.anthropic.com/en/docs/claude-code) with a curated set of MCP servers, network isolation, and prompt-cache optimizations. No local dependencies beyond Docker.
4+
5+
This is the open-source release of [`back2base`](https://back2base.net). It includes the CLI and the container runtime but **not** the hosted features:
6+
7+
- No proxy gateway (no `claudeproxy`)
8+
- No cloud config sync
9+
- No durable-object memory / cross-session memory sync
10+
- No Auth0 sign-in flow
11+
12+
If you want hosted memory, multi-device config sync, and a managed Anthropic proxy, use the upstream `back2base` distribution. If you want a local, self-contained dev container for Claude Code with sensible MCP defaults and a firewall — read on.
13+
14+
## Quick start
15+
16+
```bash
17+
# Build the binary
18+
go build -o oss-back2base .
19+
20+
# First run extracts the embedded container payload to $HOME/.local/share/back2base
21+
# and builds the image. Sign in to Claude (host-side) and copy the token:
22+
claude setup-token
23+
echo 'BACK2BASE_CLAUDE_CODE_OAUTH_TOKEN=<paste-here>' > ~/.config/back2base/env
24+
25+
./oss-back2base # launch Claude Code in the current directory
26+
./oss-back2base shell # drop into a container shell
27+
./oss-back2base doctor # health checks
28+
./oss-back2base profile # pick an MCP profile
29+
```
30+
31+
Anthropic API key works too — set `BACK2BASE_ANTHROPIC_API_KEY` in `~/.config/back2base/env` instead of the OAuth token.
32+
33+
## What's included
34+
35+
- **CLI commands**: `run` (default), `shell`, `doctor`, `explore`, `profile`, `prune`, `mcp`, `overview`, `update`, `selfupdate`, `install`, `setup`, `clean`, `resume`, `status`, `build`/`rebuild`, `session`, `version`.
36+
- **Container payload** (`back2base-container/`): Dockerfile, docker-compose, entrypoint, iptables-based outbound firewall, MCP profile defaults, baseline `CLAUDE.md` template, skills + slash-command bundle.
37+
- **GitHub Actions**: `ci.yml` (go test/vet, lint, cross-build matrix) and `release.yml` (goreleaser on tag push).
38+
39+
## What's not included
40+
41+
- `auth0/`, `auth.go`, `login.go`, the device-flow code, and the host keychain credential store — all removed.
42+
- `workers/` (Cloudflare Workers for proxy, config, memory, landing site) — never copied.
43+
- `lib/cloud-sync.sh`, `lib/hooks/memory-push.sh`, `lib/hooks/memory-pull.sh` — removed from the container payload.
44+
- OTel telemetry to `otel.back2base.net` — disabled by default; users can point `BACK2BASE_OTEL_ENDPOINT` at their own collector.
45+
46+
## Repository layout
47+
48+
- `*.go` at the repo root — the Cobra-based CLI, flat `package main`. `assets.go` embeds the container payload.
49+
- `back2base-container/` — the shipped Docker image payload, extracted to `$BACK2BASE_HOME` on first run.
50+
- `.github/workflows/` — CI (test, vet, lint, cross-build) and release (goreleaser on tag push).
51+
52+
## License
53+
54+
MIT. See [LICENSE](LICENSE).

assets.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package main
2+
3+
import (
4+
"embed"
5+
"io/fs"
6+
)
7+
8+
// all: ensures files with leading "." or "_" under the tree are embedded too.
9+
//go:embed all:back2base-container
10+
var embeddedAssets embed.FS
11+
12+
// shipFS returns the embedded FS rooted inside back2base-container/ so callers
13+
// see the same paths they saw pre-reorg (e.g. "Dockerfile",
14+
// "defaults/env.example"). The back2base-container/ prefix is an internal
15+
// layout detail that stops at this function.
16+
func shipFS() fs.FS {
17+
sub, err := fs.Sub(embeddedAssets, "back2base-container")
18+
if err != nil {
19+
panic(err)
20+
}
21+
return sub
22+
}

0 commit comments

Comments
 (0)