Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Mise configuration for cloudx.sh
# https://mise.jdx.dev/

[tools]
bun = "latest"
crane = "latest"
gh = "latest"
node = "latest"
podman = "latest"

[tasks.lint]
run = "bunx oxlint@latest src/"
description = "Run oxlint on source files"

[tasks.format]
run = "bunx oxlint@latest --fix src/"
description = "Format and fix source files with oxlint"

[tasks.typecheck]
run = "bun build --no-emit src/index.ts"
description = "Run TypeScript type checking"
26 changes: 20 additions & 6 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ User Request → Worker → Sandbox Durable Object → Container (OpenCode + Rep

2. **`Dockerfile`** - Container image definition
- Based on `cloudflare/sandbox:latest`
- Includes mise for tool version management
- Includes OpenCode CLI, Python, Node.js, Bun
- Pre-configured Git settings

Expand All @@ -88,15 +89,28 @@ User Request → Worker → Sandbox Durable Object → Container (OpenCode + Rep
### Building & Deploying

```bash
npm install # Install dependencies
npm run dev # Start local dev server (requires Docker)
npm run deploy # Deploy to Cloudflare
bun install # Install dependencies
bun run dev # Start local dev server (requires Docker)
bun run deploy # Deploy to Cloudflare
```

### Code Quality

```bash
npm run check # TypeScript type checking
bun run typecheck # TypeScript type checking
bun run lint # Run oxlint on source files
bun run format # Fix and format code with oxlint
```

### Tool Version Management (mise)

This project uses [mise](https://mise.jdx.dev/) for tool version management. The `.mise.toml` file defines the required tool versions and common tasks.

```bash
mise install # Install tools defined in .mise.toml
mise run lint # Run linting via mise task
mise run typecheck # Run type checking via mise task
mise run format # Fix and format code via mise task
```

### Docker Requirements
Expand All @@ -108,8 +122,8 @@ Local development requires Docker running for the container runtime. The Dockerf
### Pull Request Process

1. Make your changes
2. Ensure TypeScript compiles: `npm run check`
3. Test locally with `npm run dev` if Docker is available
2. Ensure TypeScript compiles: `bun run typecheck`
3. Test locally with `bun run dev` if Docker is available
4. Commit with clear, imperative messages (see git-commit skill)
5. Push and create PR
6. Deploy after review
Expand Down
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@

FROM docker.io/cloudflare/sandbox:0.6.7

# Add opencode install location to PATH before installation
ENV PATH="/root/.opencode/bin:${PATH}"
# Add opencode and mise install locations to PATH before installation
ENV PATH="/root/.opencode/bin:/root/.local/bin:${PATH}"

# Install mise (https://mise.jdx.dev/) for tool version management
RUN curl https://mise.run | sh \
&& mise --version

# Install OpenCode CLI
RUN curl -fsSL https://opencode.ai/install -o /tmp/install-opencode.sh \
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ git clone https://github.com/your-org/cloudx-sh.git
cd cloudx-sh

# Install dependencies
npm install
bun install

# Set up wrangler (Cloudflare CLI)
npx wrangler login
bunx wrangler login
```

### Configuration
Expand All @@ -69,8 +69,8 @@ ANTHROPIC_API_KEY=your-api-key-here

3. Create a KV namespace:
```bash
npx wrangler kv:namespace create CACHE
npx wrangler kv:namespace create CACHE --preview
bunx wrangler kv:namespace create CACHE
bunx wrangler kv:namespace create CACHE --preview
```

4. Update `wrangler.jsonc` with your KV namespace IDs
Expand All @@ -79,7 +79,7 @@ npx wrangler kv:namespace create CACHE --preview

```bash
# Start local development server
npm run dev
bun run dev
```

Visit `http://localhost:8787/github.com/owner/repo` to test.
Expand All @@ -88,10 +88,10 @@ Visit `http://localhost:8787/github.com/owner/repo` to test.

```bash
# Set the Anthropic API key as a secret
npx wrangler secret put ANTHROPIC_API_KEY
bunx wrangler secret put ANTHROPIC_API_KEY

# Deploy to Cloudflare
npm run deploy
bun run deploy
```

Note: Container provisioning may take 2-3 minutes after initial deployment.
Expand Down
247 changes: 247 additions & 0 deletions bun.lock

Large diffs are not rendered by default.

Loading