Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 17 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"permissions": {
"allow": [
"Bash(cargo check:*)",
"Bash(curl:*)",
"Bash(cargo build:*)",
"Bash(pkill:*)",
"Bash(jq:*)",
"Bash(timeout 10 curl:*)",
"Bash(cat:*)",
"Bash(timeout 35 curl:*)",
"Bash(npm run build:*)",
"WebFetch(domain:localhost)",
"Bash(cargo test:*)"
]
}
}
183 changes: 183 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
name: Release

on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g., 0.1.0)'
required: true
type: string

env:
CARGO_TERM_COLOR: always

jobs:
build-frontend:
name: Build Frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'
cache-dependency-path: frontend/pnpm-lock.yaml

- name: Install dependencies
working-directory: frontend
run: pnpm install --frozen-lockfile

- name: Build frontend
working-directory: frontend
run: pnpm build

- name: Create frontend zip
working-directory: frontend
run: |
cd out
zip -r ../frontend.zip .

- name: Upload frontend artifact
uses: actions/upload-artifact@v4
with:
name: frontend
path: frontend/frontend.zip

build-cli:
name: Build CLI (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- target: x86_64-apple-darwin
os: macos-latest
name: opencode-studio-darwin-x86_64
- target: aarch64-apple-darwin
os: macos-latest
name: opencode-studio-darwin-arm64
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
name: opencode-studio-linux-x86_64
steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-action@stable
with:
targets: ${{ matrix.target }}

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.target }}-cargo-

- name: Build CLI
run: cargo build --release --package opencode-studio --target ${{ matrix.target }}

- name: Package binary (Unix)
run: |
mkdir -p dist
cp target/${{ matrix.target }}/release/opencode-studio dist/${{ matrix.name }}
chmod +x dist/${{ matrix.name }}
cd dist && tar -czvf ${{ matrix.name }}.tar.gz ${{ matrix.name }}

- name: Upload CLI artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}
path: dist/${{ matrix.name }}.tar.gz

release:
name: Create Release
needs: [build-frontend, build-cli]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Prepare release assets
run: |
mkdir -p release
cp artifacts/frontend/frontend.zip release/
cp artifacts/opencode-studio-darwin-x86_64/opencode-studio-darwin-x86_64.tar.gz release/
cp artifacts/opencode-studio-darwin-arm64/opencode-studio-darwin-arm64.tar.gz release/
cp artifacts/opencode-studio-linux-x86_64/opencode-studio-linux-x86_64.tar.gz release/
ls -la release/

- name: Get version
id: version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
else
echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
fi

- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version.outputs.version }}
name: OpenCode Studio v${{ steps.version.outputs.version }}
draft: false
prerelease: false
files: |
release/frontend.zip
release/opencode-studio-darwin-x86_64.tar.gz
release/opencode-studio-darwin-arm64.tar.gz
release/opencode-studio-linux-x86_64.tar.gz
body: |
## OpenCode Studio v${{ steps.version.outputs.version }}

### Installation

**macOS (Apple Silicon)**
```bash
curl -L https://github.com/${{ github.repository }}/releases/download/v${{ steps.version.outputs.version }}/opencode-studio-darwin-arm64.tar.gz | tar xz
sudo mv opencode-studio-darwin-arm64 /usr/local/bin/opencode-studio
```

**macOS (Intel)**
```bash
curl -L https://github.com/${{ github.repository }}/releases/download/v${{ steps.version.outputs.version }}/opencode-studio-darwin-x86_64.tar.gz | tar xz
sudo mv opencode-studio-darwin-x86_64 /usr/local/bin/opencode-studio
```

**Linux (x86_64)**
```bash
curl -L https://github.com/${{ github.repository }}/releases/download/v${{ steps.version.outputs.version }}/opencode-studio-linux-x86_64.tar.gz | tar xz
sudo mv opencode-studio-linux-x86_64 /usr/local/bin/opencode-studio
```

### Usage

```bash
# Navigate to any git/jj project and run:
opencode-studio
```

The CLI will automatically:
1. Initialize `.opencode-studio/` directory
2. Download the frontend app (first run only)
3. Start the server and open your browser
6 changes: 6 additions & 0 deletions .opencode-studio/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[project]
name = "opencode-os"

[server]
port = 3001
opencode_url = "http://localhost:4096"
Loading