Skip to content

An open-source, faster Devin alternative

TypeScript

Add CLI release automation and publish opencomputer skill

motatoesf4cc587b0941
diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml
new file mode 100644
index 00000000..264880d5
--- /dev/null
+++ b/.github/workflows/release-cli.yml
@@ -0,0 +1,108 @@
+name: Release CLI
+
+on:
+ push:
+ branches: [main]
+ paths:
+ - 'cmd/oc/**'
+ - 'internal/**'
+ - 'VERSION'
+ - 'go.mod'
+ - 'go.sum'
+ - '.github/workflows/release-cli.yml'
+
+permissions:
+ contents: write
+
+jobs:
+ release:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # need full history for tags
+
+ - uses: actions/setup-go@v5
+ with:
+ go-version-file: go.mod
+
+ - name: Determine version
+ id: version
+ run: |
+ BASE=$(cat VERSION | tr -d '[:space:]')
+ echo "base=$BASE" >> "$GITHUB_OUTPUT"
+
+ # Find the latest tag matching this base version
+ LATEST=$(git tag --list "v${BASE}.*" --sort=-v:refname | head -n1)
+
+ if [ -z "$LATEST" ]; then
+ # No existing tag for this base version — start at .0
+ PATCH=0
+ else
+ # Extract 4th number and bump
+ CURRENT_PATCH=$(echo "$LATEST" | sed "s/v${BASE}\.//")
+ PATCH=$((CURRENT_PATCH + 1))
+ fi
+
+ VERSION="${BASE}.${PATCH}"
+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
+ echo "tag=v${VERSION}" >> "$GITHUB_OUTPUT"
+ echo "Releasing v${VERSION}"
+
+ - name: Check if tag already exists
+ id: check_tag
+ run: |
+ if git rev-parse "refs/tags/${{ steps.version.outputs.tag }}" >/dev/null 2>&1; then
+ echo "exists=true" >> "$GITHUB_OUTPUT"
+ else
+ echo "exists=false" >> "$GITHUB_OUTPUT"
+ fi
+
+ - name: Build CLI binaries
+ if: steps.check_tag.outputs.exists == 'false'
+ run: |
+ VERSION="${{ steps.version.outputs.version }}"
+ LDFLAGS="-s -w -X github.com/opensandbox/opensandbox/cmd/oc/internal/commands.Version=${VERSION}"
+ mkdir -p dist
+
+ platforms=(
+ "linux/amd64"
+ "linux/arm64"
+ "darwin/amd64"
+ "darwin/arm64"
+ "windows/amd64"
+ )
+
+ for platform in "${platforms[@]}"; do
+ GOOS="${platform%/*}"
+ GOARCH="${platform#*/}"
+ output="dist/oc-${GOOS}-${GOARCH}"
+ if [ "$GOOS" = "windows" ]; then
+ output="${output}.exe"
+ fi
+ echo "Building ${GOOS}/${GOARCH}..."
+ CGO_ENABLED=0 GOOS="$GOOS" GOARCH="$GOARCH" go build \
+ -ldflags "$LDFLAGS" \
+ -o "$output" \
+ ./cmd/oc
+ done
+
+ # Create checksums
+ cd dist && sha256sum oc-* > checksums.txt
+
+ - name: Create tag
+ if: steps.check_tag.outputs.exists == 'false'
+ run: |
+ git tag "${{ steps.version.outputs.tag }}"
+ git push origin "${{ steps.version.outputs.tag }}"
+
+ - name: Create GitHub Release
+ if: steps.check_tag.outputs.exists == 'false'
+ uses: softprops/action-gh-release@v2
+ with:
+ tag_name: ${{ steps.version.outputs.tag }}
+ name: oc ${{ steps.version.outputs.tag }}
+ generate_release_notes: true
+ files: |
+ dist/oc-*
+ dist/checksums.txt
diff --git a/Makefile b/Makefile
index 8c66c990..316572bf 100644
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,8 @@ BINARY_SERVER = opensandbox-server
BINARY_WORKER = opensandbox-worker
BINARY_AGENT = osb-agent
BUILD_DIR = bin
+VERSION ?= $(shell cat VERSION | tr -d '[:space:]').dev
+LDFLAGS_OC = -s -w -X github.com/opensandbox/opensandbox/cmd/oc/internal/commands.Version=$(VERSION)
## help: Show this help message
help:
@@ -39,11 +41,11 @@ build-server-arm64:
## build-oc: Build the oc CLI tool
build-oc:
- CGO_ENABLED=0 go build -o $(BUILD_DIR)/oc ./cmd/oc
+ CGO_ENABLED=0 go build -ldflags "$(LDFLAGS_OC)" -o $(BUILD_DIR)/oc ./cmd/oc
## install-oc: Build and install oc to $GOPATH/bin
install-oc:
- CGO_ENABLED=0 go install ./cmd/oc
+ CGO_ENABLED=0 go install -ldflags "$(LDFLAGS_OC)" ./cmd/oc
## --- Local Testing (3 tiers) ---
diff --git a/README.md b/README.md
index f7c0a10a..8eb9e725 100644
--- a/README.md
+++ b/README.md
@@ -15,6 +15,21 @@ Think of it as the compute equivalent of a laptop that sleeps when you close the
## Quick start
+### CLI
+
+Download the latest `oc` binary from [GitHub Releases](https://github.com/diggerhq/opencomputer/releases):
+
+```bash
+# macOS (Apple Silicon)
+curl -fsSL https://github.com/diggerhq/opencomputer/releases/latest/download/oc-darwin-arm64 -o /usr/local/bin/oc
+chmod +x /usr/local/bin/oc
+
+# Configure
+oc config set api-key YOUR_API_KEY
+```
+
+### SDK
+
Install the SDK:
```bash
diff --git a/VERSION b/VERSION
new file mode 100644
index 00000000..8acdd82b
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+0.0.1
diff --git a/cmd/oc/internal/commands/root.go b/cmd/oc/internal/commands/root.go
index 6d77a5ad..381114a0 100644
--- a/cmd/oc/internal/commands/root.go
+++ b/cmd/oc/internal/commands/root.go
@@ -10,15 +10,19 @@ import (
"github.com/spf13/cobra"
)
+// Version is set at build time via ldflags.
+var Version = "dev"
+
var (
jsonOutput bool
printer *output.Printer
)
var rootCmd = &cobra.Command{
- Use: "oc",
- Short: "OpenComputer CLI — manage cloud sandboxes",
- Long: "Command-line interface for creating and managing OpenComputer sandboxes.",
+ Use: "oc",
+ Short: "OpenComputer CLI — manage cloud sandboxes",
+ Long: "Command-line interface for creating and managing OpenComputer sandboxes.",
+ Version: Version,
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
cfg := config.Load(cmd)
if cfg.APIKey == "" && cmd.Name() != "config" && cmd.Name() != "help" && cmd.Name() != "set" && cmd.Name() != "show" {
diff --git a/docs/cli/overview.mdx b/docs/cli/overview.mdx
index 2671150f..cbd6ccef 100644
--- a/docs/cli/overview.mdx
+++ b/docs/cli/overview.mdx
@@ -7,18 +7,40 @@ The `oc` CLI lets you manage OpenComputer sandboxes directly from your terminal
## Installation
-```bash
-# Build from source
-make build-oc
+Download the latest binary for your platform from [GitHub Releases](https://github.com/diggerhq/opencomputer/releases):
+
+<CodeGroup>
+
+```bash macOS (Apple Silicon)
+curl -fsSL https://github.com/diggerhq/opencomputer/releases/latest/download/oc-darwin-arm64 -o /usr/local/bin/oc
+chmod +x /usr/local/bin/oc
+```
+
+```bash macOS (Intel)
+curl -fsSL https://github.com/diggerhq/opencomputer/releases/latest/download/oc-darwin-amd64 -o /usr/local/bin/oc
+chmod +x /usr/local/bin/oc
+```
-# Install to /usr/local/bin
-make install-oc
+```bash Linux (x86_64)
+curl -fsSL https://github.com/diggerhq/opencomputer/releases/latest/download/oc-linux-amd64 -o /usr/local/bin/oc
+chmod +x /usr/local/bin/oc
```
-Or with `go install`:
+```bash Linux (ARM64)
+curl -fsSL https://github.com/diggerhq/opencomputer/releases/latest/download/oc-linux-arm64 -o /usr/local/bin/oc
+chmod +x /usr/local/bin/oc
+```
+
+```bash Windows (PowerShell)
+Invoke-WebRequest -Uri https://github.com/diggerhq/opencomputer/releases/latest/download/oc-windows-amd64.exe -OutFile oc.exe
+```
+
+</CodeGroup>
+
+Verify the installation:
```bash
-go install github.com/opensandbox/opensandbox/cmd/oc@latest
+oc --version
```
## Configuration
diff --git a/docs/introduction.mdx b/docs/introduction.mdx
index c5414d93..ca1e5e8c 100644
--- a/docs/introduction.mdx
+++ b/docs/introduction.mdx
@@ -24,6 +24,26 @@ OpenComputer gives you **secure, isolated cloud sandboxes** that spin up in mill
</Card>
</CardGroup>
+## CLI
+
+Download the `oc` binary from [GitHub Releases](https://github.com/diggerhq/opencomputer/releases):
+
+```bash
+curl -fsSL https://github.com/diggerhq/opencomputer/releases/latest/download/oc-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/') -o /usr/local/bin/oc && chmod +x /usr/local/bin/oc
+```
+
+See the [CLI Reference](/cli/overview) for full usage.
+
+## Agent Skill
+
+Install the OpenComputer skill for Claude Code and other AI agents:
+
+```bash
+npx skills add diggerhq/opencomputer
+```
+
+This gives your AI agent the ability to create and manage cloud sandboxes using the `oc` CLI.
+
## SDKs
OpenComputer provides first-class SDKs for TypeScript and Python with identical API surfaces.
diff --git a/docs/quickstart.mdx b/docs/quickstart.mdx
index c636200c..ca3728ef 100644
--- a/docs/quickstart.mdx
+++ b/docs/quickstart.mdx
@@ -7,10 +7,14 @@ description: "Get up and running with OpenComputer in 5 minutes"
Sign up at [app.opencomputer.dev](https://app.opencomputer.dev) and grab your API key from the dashboard.
-## 2. Install the SDK
+## 2. Install
<CodeGroup>
+```bash CLI
+curl -fsSL https://github.com/diggerhq/opencomputer/releases/latest/download/oc-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/') -o /usr/local/bin/oc && chmod +x /usr/local/bin/oc
+```
+
```bash npm
npm install @opencomputer/sdk
```
@@ -19,6 +23,10 @@ npm install @opencomputer/sdk
pip install opencomputer-sdk
```
+```bash Agent Skill
+npx skills add diggerhq/opencomputer
+```
+
</CodeGroup>
## 3. Set Your API Key
diff --git a/skills/opencomputer/README.md b/skills/opencomputer/README.md
new file mode 100644
index 00000000..1a86d96e
--- /dev/null
+++ b/skills/opencomputer/README.md
@@ -0,0 +1,68 @@
+# OpenComputer Skill
+
+Give your AI agent the ability to create and manage cloud sandboxes. Works with Claude Code, Codex, Cursor, and 30+ other AI agents that support the [Agent Skills](https://agentskills.io) standard.
+
+## Install
+
+```bash
+npx skills add diggerhq/opencomputer
+```
+
+## What it does
+
+Once installed, your AI agent can:
+
+- Create and manage cloud sandboxes (`oc create`, `oc sandbox list`, `oc sandbox kill`)
+- Execute commands inside sandboxes (`oc exec <id> -- <command>`)
+- Open interactive shells (`oc shell <id>`)
+- Snapshot and fork sandboxes with checkpoints (`oc checkpoint create/restore/spawn`)
+- Apply patches to checkpoints (`oc patch create`)
+- Expose sandbox ports via preview URLs (`oc preview create`)
+
+The skill auto-activates when you mention sandboxes, remote environments, or the `oc` CLI.
+
+## Prerequisites
+
+The `oc` CLI must be installed. The skill will guide your agent to install it automatically, or you can install it manually:
+
+```bash
+# macOS (Apple Silicon)
+curl -fsSL https://github.com/diggerhq/opencomputer/releases/latest/download/oc-darwin-arm64 -o /usr/local/bin/oc
+chmod +x /usr/local/bin/oc
+
+# macOS (Intel)
+curl -fsSL https://github.com/diggerhq/opencomputer/releases/latest/download/oc-darwin-amd64 -o /usr/local/bin/oc
+chmod +x /usr/local/bin/oc
+
+# Linux (x86_64)
+curl -fsSL https://github.com/diggerhq/opencomputer/releases/latest/download/oc-linux-amd64 -o /usr/local/bin/oc
+chmod +x /usr/local/bin/oc
+
+# Linux (ARM64)
+curl -fsSL https://github.com/diggerhq/opencomputer/releases/latest/download/oc-linux-arm64 -o /usr/local/bin/oc
+chmod +x /usr/local/bin/oc
+```
+
+Then configure your API key:
+
+```bash
+oc config set api-key YOUR_API_KEY
+```
+
+Get your API key at [app.opencomputer.dev](https://app.opencomputer.dev).
+
+## Example usage
+
+Once installed, just ask your agent naturally:
+
+- "Create a sandbox and install Node.js in it"
+- "Run my test suite in a sandbox"
+- "Checkpoint this sandbox so I can fork it later"
+- "Open a shell to the sandbox"
+
+## Learn more
+
+- [CLI Reference](https://docs.opencomputer.dev/cli/overview)
+- [TypeScript SDK](https://docs.opencomputer.dev/sdks/typescript/overview)
+- [Python SDK](https://docs.opencomputer.dev/sdks/python/overview)
+- [OpenComputer website](https://opencomputer.dev)
diff --git a/skills/sandbox/SKILL.md b/skills/opencomputer/SKILL.md
similarity index 86%
rename from skills/sandbox/SKILL.md
rename to skills/opencomputer/SKILL.md
index d277bbe4..94fdf410 100644
--- a/skills/sandbox/SKILL.md
+++ b/skills/opencomputer/SKILL.md
@@ -1,5 +1,5 @@
---
-name: sandbox
+name: opencomputer
description: Manage OpenComputer cloud sandboxes. Use when the user wants to create, run commands in, checkpoint, or manage sandbox environments. Auto-invokes when sandboxes, remote environments, or the oc CLI are mentioned.
allowed-tools: Bash(oc *), Bash(which oc), Read, Grep, Glob
---
@@ -13,9 +13,19 @@ The `oc` CLI must be installed and configured. Check with:
which oc
```
-If not installed, build it from the OpenComputer repo:
-```
-CGO_ENABLED=0 go build -o /usr/local/bin/oc ./cmd/oc
+If not installed, download the latest binary from GitHub Releases:
+```bash
+# macOS (Apple Silicon)
+curl -fsSL https://github.com/diggerhq/opencomputer/releases/latest/download/oc-darwin-arm64 -o /usr/local/bin/oc && chmod +x /usr/local/bin/oc
+
+# macOS (Intel)
+curl -fsSL https://github.com/diggerhq/opencomputer/releases/latest/download/oc-darwin-amd64 -o /usr/local/bin/oc && chmod +x /usr/local/bin/oc
+
+# Linux (x86_64)
+curl -fsSL https://github.com/diggerhq/opencomputer/releases/latest/download/oc-linux-amd64 -o /usr/local/bin/oc && chmod +x /usr/local/bin/oc
+
+# Linux (ARM64)
+curl -fsSL https://github.com/diggerhq/opencomputer/releases/latest/download/oc-linux-arm64 -o /usr/local/bin/oc && chmod +x /usr/local/bin/oc
```
Configuration requires an API key. Set it via: