Skip to content

Commit 40aad08

Browse files
authored
Merge remote-tracking branch 'origin/main' into refs/catnip/amber
2 parents 8b30fb8 + 85c95a3 commit 40aad08

File tree

121 files changed

+1561
-159579
lines changed

Some content is hidden

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

121 files changed

+1561
-159579
lines changed

.devcontainer/devcontainer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@
2727
"source=${localWorkspaceFolderBasename}-node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume",
2828
"source=${localWorkspaceFolderBasename}-go-mods,target=/go/pkg/mod,type=volume"
2929
],
30+
"runArgs": ["--device=/dev/net/tun"],
3031
"features": {
3132
"ghcr.io/devcontainers/features/git:1": {},
33+
"ghcr.io/tailscale/codespace/tailscale": {
34+
"version": "latest"
35+
},
3236
"ghcr.io/devcontainers/features/node:1": {
3337
"version": "latest"
3438
},

.devcontainer/features/feature/catnip-init

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ do_start()
2929
# 0 if daemon has been started
3030
# 1 if daemon was already running
3131
# 2 if daemon could not be started
32-
start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid vscode:vscode --exec $DAEMON --test > /dev/null \
32+
start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid CATNIP_USER:CATNIP_GROUP --exec $DAEMON --test > /dev/null \
3333
|| return 1
34-
start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid vscode:vscode --exec $DAEMON
34+
start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid CATNIP_USER:CATNIP_GROUP --exec $DAEMON
3535
RETVAL="$?"
3636
return "$RETVAL"
3737
}
@@ -46,11 +46,11 @@ do_stop()
4646

4747
# Try to stop by pidfile first
4848
if [ -f "$PIDFILE" ] && kill -0 $(cat "$PIDFILE") 2>/dev/null; then
49-
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --chuid vscode:vscode
49+
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --chuid CATNIP_USER:CATNIP_GROUP
5050
RETVAL="$?"
5151
else
5252
# Fallback: stop by process name/exec
53-
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --exec $DAEMON --chuid vscode:vscode
53+
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --exec $DAEMON --chuid CATNIP_USER:CATNIP_GROUP
5454
RETVAL="$?"
5555
fi
5656

.devcontainer/features/feature/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "feature",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"name": "catnip",
55
"description": "Ensures SSH, installs catnip, Claude CLI, GitHub CLI, and Catnip VS Code sidebar extension.",
66
"options": {

.devcontainer/features/feature/install.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,10 @@ install_init_service() {
224224
cp "$(dirname $0)/catnip-init" "$init_script"
225225
run_as_root chmod +x "$init_script"
226226

227-
# Update the script to use correct user paths
227+
# Update the script to use correct user paths, username, and group
228228
run_as_root sed -i "s|/home/vscode|$USERHOME|g" "$init_script"
229+
run_as_root sed -i "s|CATNIP_USER|$USERNAME|g" "$init_script"
230+
run_as_root sed -i "s|CATNIP_GROUP|$USERGROUP|g" "$init_script"
229231

230232
# Create /etc/default/catnip template (will be populated by post-start)
231233
log "Creating /etc/default/catnip template..."
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Deploy Cloudflare Worker
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "worker/**"
9+
- "wrangler.jsonc"
10+
- "tsconfig.worker.json"
11+
- "worker-configuration.d.ts"
12+
- "package.json"
13+
- "pnpm-lock.yaml"
14+
- ".github/workflows/deploy-worker.yml"
15+
16+
# Allow manual trigger
17+
workflow_dispatch:
18+
inputs:
19+
environment:
20+
description: "Deployment environment"
21+
required: true
22+
type: choice
23+
options:
24+
- production
25+
- qa
26+
27+
permissions:
28+
contents: read
29+
30+
jobs:
31+
deploy:
32+
runs-on: ubuntu-latest
33+
name: Deploy to Cloudflare Workers
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
38+
- name: Set up Node.js
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: "22"
42+
43+
- name: Install pnpm
44+
uses: pnpm/action-setup@v4
45+
with:
46+
version: 10
47+
48+
- name: Install dependencies
49+
run: pnpm install --frozen-lockfile
50+
51+
- name: Build project
52+
run: pnpm run build
53+
54+
- name: Deploy to Cloudflare Workers (Production)
55+
if: github.event_name == 'push' || github.event.inputs.environment == 'production'
56+
run: pnpm run deploy:prod
57+
env:
58+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
59+
60+
- name: Deploy to Cloudflare Workers (QA)
61+
if: github.event.inputs.environment == 'qa'
62+
run: pnpm run build && wrangler deploy --env qa
63+
env:
64+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,17 @@ worker/**/*.js.map
4242
# crush
4343
.crush/
4444

45+
# worktrees
46+
.worktrees/
47+
4548
# secrets
4649
*.pem
4750

4851
# reference files
4952
reference
5053
container/Dockerfile.backup
5154
public/*.jsonl
55+
docs/plans/
5256

5357
# fallback frontend assets for local go builds (real assets are built in docker)
5458
# keep the dummy index.html but ignore anything else that gets copied here

README.md

Lines changed: 25 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,53 +3,45 @@
33

44
# 🐾 Catnip
55

6-
**Run Claude Code Everywhere!**
6+
**Run Claude Code Everywhere**
77

8-
Catnip helps you stay organized, run many agents in parallel, and operate agents on the go with web our native mobile interface.
8+
Catnip helps you stay organized, run many agents in parallel, and operate agents remotely with our web and native mobile interfaces.
99

1010
[![GitHub Stars](https://img.shields.io/github/stars/wandb/catnip?style=social)](https://github.com/wandb/catnip)
1111
[![Docker Pulls](https://img.shields.io/docker/pulls/wandb/catnip)](https://hub.docker.com/r/wandb/catnip)
1212
[![Version](https://img.shields.io/github/v/release/wandb/catnip)](https://github.com/wandb/catnip/releases)
1313
<br/>
1414

15-
**🔥 Parallel vibe coding in containers. Stay organized, get notified, create anything! 😎**
16-
1715
<img src="public/screenshot.png" alt="Catnip UI Screenshot"/>
1816

1917
</div>
2018

21-
## 💡 When to Use Catnip
22-
23-
**You should use Catnip if you:**
24-
25-
- Want a quick environment to code with agents like Claude. Catnip runs in a universal docker container or your existing Dev Container, making it easy to start new projects or continue developing existing git repositories.
26-
- Have so many idea's that you want to try multiple things at once. Catnip creates git worktrees enabling parallel development.
27-
- Want a safe, isolated environment where AI assistants can run terminal commands without the risk of messing up your primary system and asking for permission all the time.
28-
- Are so addicted to Claude you want to be able to create and monitor agents from your phone. Catnip has a mobile UI making it a super tool when added to a cloud based runtime like Github Codespaces.
29-
3019
## 🚀 Why Catnip?
3120

32-
Think of Catnip as a **multi-agent coding workspace** that solves the chaos of having AI assistants work on multiple tasks in parallel.
21+
Catnip is a web service that automates git worktree creation and runs in a container. You can run Catnip in the cloud using GitHub Codespaces or locally on your machine.
3322

3423
**The Problem:** You want to keep Claude Code running as long as possible.
3524

36-
- It's annoying to manage multiple git worktree's and commit changes
37-
- Previewing the changes across multiple worktree's and more importantly giving the agent a way to test the changes is tricky and Catnip does everything it can to help
38-
- You lose track of what each AI assistant has been working on
39-
- You want to be able to review changes on the go / from your phone
25+
- Claude Code works best when it's sandboxed and has all the tools it needs to test or debug your code.
26+
- It's difficult to keep track of multiple claude sessions and manage git worktrees.
27+
- You want to be able to review changes / keep claude working when you're on the go from your phone
4028

41-
**The Solution:** Catnip gives each AI assistant its own isolated workspace while keeping everything synchronized:
29+
**The Solution:** Catnip runs in a container, manages worktrees for you, and exposes API's and UI's to interact with it:
4230

43-
- **🔒 Isolated Sandbox**: All code runs containerized environment using either Docker or Apple's new [Container SDK]
44-
(https://github.com/apple/container). We can use --dangerously-skip-permissions without fear!
31+
- **🔒 Isolated Sandbox**: All code runs containerized environment using either Docker or Apple's new
32+
[Container SDK](https://github.com/apple/container). We can use `--dangerously-skip-permissions` without fear!
4533
- **🧑‍💻 Worktree Management**: Worktree's let you spawn multiple agents in parallel. Catnip keeps everything organized.
46-
- **📱 Mobile Interface**: Catnip works on a mobile device. It's like having your own OpenAI Codex service.
47-
- **💻 Full Terminal Access**: Open multiple terminals via the web interface, CLI, or directly via SSH.
48-
- **👀 Preview Changes**: Catnip has a built in proxy and port detection. Start a web service and preview it live!
34+
- **📱 Mobile Interface**: Catnip has a native mobile interface. You can even interact with the Claude Code terminal interface on your phone!
35+
- **💻 Full Terminal Access**: The Claude Code terminal interface is 🔥. Open multiple terminals via the web interface, CLI, or directly via SSH.
36+
- **👀 Preview Changes**: Catnip has a built in proxy and port detection in the container. Start a web service and preview it live locally!
4937
- **🌐 Universal Access**: Still a big fan of Cursor or VS Code? No problem, full remote development directly in your IDE is supported.
5038

5139
## ⚡ Quick Start
5240

41+
### Mobile App
42+
43+
Our iOS native interface is currently in beta. You can join the [TestFlight group](https://testflight.apple.com/join/dm8GahU7) to try the app today. The app will help you configure an existing GitHub repository with catnip as described below. Once setup you can fire up claude code on the go! Please share any bug reports or feedback.
44+
5345
### Github Codespaces / Devcontainers
5446

5547
You can add Catnip to a `.devcontainer/devcontainer.json` in an existing GitHub repository. This gives you complete control over the environment that claude operates in. If you don't have a devcontainer config, add the following to your repo's github url: `/new/main?dev_container_template=1&filename=.devcontainer%2Fdevcontainer.json` to create one. Just add the catnip feature and ensure the port is forwarded:
@@ -100,18 +92,16 @@ CATNIP_GO_VERSION=1.22
10092
> [!NOTE]
10193
> If you want complete control of your environment, run catnip in a devcontainer as described above
10294
103-
### Environment Setup
95+
## Advanced Setup
10496

10597
Catnip currently looks for a file named `setup.sh` in the root of your repo and runs it when a workspace is created. This is a great place to run `pnpm install`, `pip install -r requirements.txt`, or `uv sync` - perfect for AI projects with complex dependencies.
10698

10799
```bash
108100
#!/bin/bash
109-
# Example setup.sh for LLM application development
110101
pip install -r requirements.txt
111-
# Pre-load common dependencies for LLM apps
112102
pip install openai anthropic chromadb
113-
npm install # For full-stack AI applications
114-
# Set up vector database or other services
103+
npm install
104+
# Assuming --dind passed locally, or the docker-in-docker feature was added
115105
docker-compose up -d --build
116106
```
117107

@@ -120,17 +110,16 @@ docker-compose up -d --build
120110
`catnip run` accepts `-e` arguments. For instance if you want to pass `ANTHROPIC_API_KEY` from your host into the container you can simply add `-e ANTHROPIC_API_KEY` and then all terminals and AI agent sessions within the container will see that variable. You can also explicitly set variables, `-e ANTHROPIC_BASE_URL=https://some.otherprovider.com/v1`
121111

122112
```bash
123-
# Essential for LLM application development
124113
catnip run -e ANTHROPIC_API_KEY -e OPENAI_API_KEY -e PINECONE_API_KEY
125114
```
126115

127116
### SSH
128117

129-
The `catnip run` command configures SSH within the container by default. It creates a key pair named `catnip_remote` and configures a `catnip` host allowing you to run `ssh catnip` or open a remote development environment via the [Remote-SSH extension](https://marketplace.cursorapi.com/items/?itemName=anysphere.remote-ssh). This works perfectly with Cursor, VS Code, and other editors that AI engineers commonly use. You can disable ssh by adding `--disable-ssh` to the run command.
118+
The `catnip run` command configures SSH within the container by default. It creates a key pair named `catnip_remote` and configures a `catnip` host allowing you to run `ssh catnip` or open a remote development environment via the [Remote-SSH extension](https://marketplace.cursorapi.com/items/?itemName=anysphere.remote-ssh). This works perfectly with Cursor, VS Code, and other editors that support remote development. You can disable ssh by adding `--disable-ssh` to the run command.
130119

131120
### Docker in Docker
132121

133-
If you want the catnip container to be able to run `docker` commands, pass the `--dind` flag to the `catnip run` command. This mounts the docker socket from the host into the container allowing your terminals and AI agents to build or run containers - useful for containerized ML services or complex multi-service applications.
122+
If you want the catnip container to be able to run `docker` commands, pass the `--dind` flag to the `catnip run` command. This mounts the docker socket from the host into the container allowing your terminals and AI agents to build or run containers - useful for containerized ML services or complex multi-service applications. If you're running in GitHub codespaces make sure you've
134123

135124
### Git
136125

@@ -168,16 +157,14 @@ This is especially powerful for LLM and agentic application development where yo
168157

169158
- [x] 🎯 Native devcontainer support
170159
- [x] 📱 Mobile UI
171-
- [ ] 🔄 Restore to previous checkpoints
172160
- [ ] 🤖 Support for more AI coding agents
173-
- [ ] 🌐 Cloud based deployments
174-
- [ ] 🔧 Plugin ecosystem
161+
- [ ] 🌐 Other cloud native environment
175162

176163
## ❓ FAQ
177164

178165
<details>
179-
<summary><b>How is Catnip different from Jules, Open SWE, or Conductor</b></summary>
180-
Catnip is Open Source, built to be extensible, and prioritizes local development first with support for cloud based deployments on the roadmap. It's specifically designed for AI engineers who need sophisticated multi-agent orchestration with powerful Git worktree management and real-time service discovery.
166+
<summary><b>How is Catnip different from Openai Codex, Claude Code on the web, Jules, or Conductor</b></summary>
167+
Catnip is Open Source, built to be extensible, and prioritizes deploying to GitHub Codespaces in the cloud so you can access Claude from anywhere. The native cloud agent environments from OpenAI, Anthropic, and Google have limitations that GitHub Codespaces unlock such as resources and customizability.
181168
</details>
182169
<details>
183170
<summary><b>What AI assistants does Catnip support?</b></summary>
@@ -189,13 +176,8 @@ Currently optimized for Claude Code, with support for additional AI coding assis
189176
<summary><b>Can I use this for LLM and AI application projects?</b></summary>
190177
Absolutely! Catnip is perfect for LLM app development. The containerized environment handles complex dependencies (vector databases, embedding models, etc.), automatic port detection works great with Jupyter/Streamlit/FastAPI, and the multi-agent system lets you parallelize RAG backend development, chat interface building, and data pipeline work.
191178
</details>
192-
<details>
193-
<summary><b>How does the Git worktree system work with multiple AI agents?</b></summary>
194-
Each agent works in an isolated worktree using custom `refs/catnip/*` references, preventing Git checkout conflicts. Catnip automatically creates and syncs "nice" feature branches for PRs, so you get the isolation you need for parallel agents while maintaining clean Git workflows.
195-
</details>
196-
<details>
197179
<summary><b>Did you develop Catnip with Catnip?</b></summary>
198-
Big time... Inception 🤯 We've been using Catnip to build Catnip, which has been invaluable for dogfooding the multi-agent workflow experience.
180+
Big time... Inception 🤯 We've been using Catnip to build Catnip, which has been invaluable for dog fooding the multi-agent workflow experience.
199181
</details>
200182

201183
## 🤝 Contributing

catnip-mobile/.env.local.example

Lines changed: 0 additions & 5 deletions
This file was deleted.

catnip-mobile/.gitignore

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)