Compare commits

..
Author SHA1 Message Date
Dax Raad 4d65309efe Release v0.0.0-202507310417
publish / publish (push) Has been cancelled
2025-07-31 00:18:03 -04:00
Dax Raad df1c911764 progress 2025-07-31 00:14:39 -04:00
Dax Raad 53907843b7 sync 2025-07-30 23:03:54 -04:00
Dax Raad 62284914cd sync 2025-07-30 21:11:45 -04:00
29 changed files with 174 additions and 340 deletions
+14 -12
View File
@@ -1,17 +1,14 @@
name: publish
run-name: "${{ format('v{0}', inputs.version) }}"
on:
workflow_dispatch:
inputs:
version:
description: "Version to publish"
required: true
type: string
title:
description: "Custom title for this run"
required: false
type: string
push:
branches:
- dev
tags:
- "*"
- "!vscode-v*"
- "!github-v*"
concurrency: ${{ github.workflow }}-${{ github.ref }}
@@ -37,7 +34,7 @@ jobs:
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.2.19
bun-version: 1.2.17
- name: Install makepkg
run: |
@@ -56,7 +53,12 @@ jobs:
- name: Publish
run: |
bun install
OPENCODE_VERSION=${{ inputs.version }} ./script/publish.ts
if [ "${{ startsWith(github.ref, 'refs/tags/') }}" = "true" ]; then
./script/publish.ts
else
./script/publish.ts --snapshot
fi
working-directory: ./packages/opencode
env:
GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }}
AUR_KEY: ${{ secrets.AUR_KEY }}
+1 -1
View File
@@ -21,7 +21,7 @@ jobs:
bun-version: latest
- name: Run stats script
run: bun script/stats.ts
run: bun scripts/stats.ts
- name: Commit stats
run: |
-1
View File
@@ -32,4 +32,3 @@
| 2025-07-28 | 105,446 (+2,802) | 136,016 (+1,280) | 241,462 (+4,082) |
| 2025-07-29 | 108,998 (+3,552) | 137,542 (+1,526) | 246,540 (+5,078) |
| 2025-07-30 | 113,544 (+4,546) | 140,317 (+2,775) | 253,861 (+7,321) |
| 2025-07-31 | 118,339 (+4,795) | 143,344 (+3,027) | 261,683 (+7,822) |
-1
View File
@@ -47,7 +47,6 @@
"hono": "catalog:",
"hono-openapi": "0.4.8",
"isomorphic-git": "1.32.1",
"jsonc-parser": "3.3.1",
"open": "10.1.2",
"remeda": "catalog:",
"tree-sitter": "0.22.4",
+1 -1
View File
@@ -8,7 +8,7 @@
"dev": "bun run packages/opencode/src/index.ts",
"typecheck": "bun run --filter='*' typecheck",
"stainless": "./scripts/stainless",
"postinstall": "./script/hooks"
"postinstall": "./scripts/hooks"
},
"workspaces": {
"packages": [
+1 -2
View File
@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/package.json",
"version": "0.0.0",
"version": "0.0.5",
"name": "opencode",
"type": "module",
"private": true,
@@ -45,7 +45,6 @@
"hono": "catalog:",
"hono-openapi": "0.4.8",
"isomorphic-git": "1.32.1",
"jsonc-parser": "3.3.1",
"open": "10.1.2",
"remeda": "catalog:",
"turndown": "7.2.0",
+15 -8
View File
@@ -1,13 +1,21 @@
#!/usr/bin/env bun
const dir = new URL("..", import.meta.url).pathname
process.chdir(dir)
import { $ } from "bun"
import pkg from "../package.json"
const dry = process.env["OPENCODE_DRY"] === "true"
const version = process.env["OPENCODE_VERSION"]!
const snapshot = process.env["OPENCODE_SNAPSHOT"] === "true"
const dry = process.argv.includes("--dry")
const snapshot = process.argv.includes("--snapshot")
const version = snapshot
? `0.0.0-${new Date().toISOString().slice(0, 16).replace(/[-:T]/g, "")}`
: await $`git describe --tags --abbrev=0`
.text()
.then((x) => x.substring(1).trim())
.catch(() => {
console.error("tag not found")
process.exit(1)
})
console.log(`publishing ${version}`)
@@ -18,13 +26,12 @@ const GOARCH: Record<string, string> = {
}
const targets = [
["windows", "x64"],
["linux", "arm64"],
["linux", "x64"],
["linux", "x64-baseline"],
["darwin", "x64"],
["darwin", "x64-baseline"],
["darwin", "arm64"],
["windows", "x64"],
]
await $`rm -rf dist`
@@ -52,7 +59,7 @@ for (const [os, arch] of targets) {
2,
),
)
if (!dry) await $`cd dist/${name} && chmod 777 -R . && bun publish --access public --tag ${npmTag}`
if (!dry) await $`cd dist/${name} && bun publish --access public --tag ${npmTag}`
optionalDependencies[name] = version
}
-1
View File
@@ -73,7 +73,6 @@ export namespace BunProc {
// Let Bun handle registry resolution:
// - If .npmrc files exist, Bun will use them automatically
// - If no .npmrc files exist, Bun will default to https://registry.npmjs.org
// - No need to pass --registry flag
log.info("installing package using Bun's default registry resolution", { pkg, version })
await BunProc.run(args, {
+1 -5
View File
@@ -5,11 +5,7 @@ import { UI } from "./ui"
export function FormatError(input: unknown) {
if (MCP.Failed.isInstance(input))
return `MCP server "${input.data.name}" failed. Note, opencode does not support MCP authentication yet.`
if (Config.JsonError.isInstance(input)) {
return (
`Config file at ${input.data.path} is not valid JSON(C)` + (input.data.message ? `: ${input.data.message}` : "")
)
}
if (Config.JsonError.isInstance(input)) return `Config file at ${input.data.path} is not valid JSON`
if (Config.InvalidError.isInstance(input))
return [
`Config file at ${input.data.path} is invalid`,
+5 -42
View File
@@ -12,7 +12,6 @@ import { NamedError } from "../util/error"
import matter from "gray-matter"
import { Flag } from "../flag/flag"
import { Auth } from "../auth"
import { type ParseError as JsoncParseError, parse as parseJsonc, printParseErrorCode } from "jsonc-parser"
export namespace Config {
const log = Log.create({ service: "config" })
@@ -66,32 +65,6 @@ export namespace Config {
throw new InvalidError({ path: item }, { cause: parsed.error })
}
// Load mode markdown files
result.mode = result.mode || {}
const markdownModes = [
...(await Filesystem.globUp("mode/*.md", Global.Path.config, Global.Path.config)),
...(await Filesystem.globUp(".opencode/mode/*.md", app.path.cwd, app.path.root)),
]
for (const item of markdownModes) {
const content = await Bun.file(item).text()
const md = matter(content)
if (!md.data) continue
const config = {
name: path.basename(item, ".md"),
...md.data,
prompt: md.content.trim(),
}
const parsed = Mode.safeParse(config)
if (parsed.success) {
result.mode = mergeDeep(result.mode, {
[config.name]: parsed.data,
})
continue
}
throw new InvalidError({ path: item }, { cause: parsed.error })
}
// Handle migration from autoshare to share field
if (result.autoshare === true && !result.share) {
result.share = "auto"
@@ -372,20 +345,11 @@ export namespace Config {
}
}
const errors: JsoncParseError[] = []
const data = parseJsonc(text, errors, { allowTrailingComma: true })
if (errors.length) {
throw new JsonError({
path: configPath,
message: errors
.map((e) => {
const lines = text.substring(0, e.offset).split("\n")
const line = lines.length
const column = lines[lines.length - 1].length + 1
return `${printParseErrorCode(e.error)} at line ${line}, column ${column}`
})
.join("; "),
})
let data: any
try {
data = JSON.parse(text)
} catch (err) {
throw new JsonError({ path: configPath }, { cause: err as Error })
}
const parsed = Info.safeParse(data)
@@ -402,7 +366,6 @@ export namespace Config {
"ConfigJsonError",
z.object({
path: z.string(),
message: z.string().optional(),
}),
)
+4 -46
View File
@@ -1,6 +1,7 @@
import { App } from "../app/app"
import { BunProc } from "../bun"
import { Filesystem } from "../util/filesystem"
import path from "path"
export interface Info {
name: string
@@ -64,57 +65,14 @@ export const prettier: Info = {
],
async enabled() {
const app = App.info()
const items = await Filesystem.findUp("package.json", app.path.cwd, app.path.root)
for (const item of items) {
const json = await Bun.file(item).json()
if (json.dependencies?.prettier) return true
if (json.devDependencies?.prettier) return true
const nms = await Filesystem.findUp("node_modules", app.path.cwd, app.path.root)
for (const item of nms) {
if (await Bun.file(path.join(item, ".bin", "prettier")).exists()) return true
}
return false
},
}
export const biome: Info = {
name: "biome",
command: [BunProc.which(), "x", "biome", "format", "--write", "$FILE"],
environment: {
BUN_BE_BUN: "1",
},
extensions: [
".js",
".jsx",
".mjs",
".cjs",
".ts",
".tsx",
".mts",
".cts",
".html",
".htm",
".css",
".scss",
".sass",
".less",
".vue",
".svelte",
".json",
".jsonc",
".yaml",
".yml",
".toml",
".xml",
".md",
".mdx",
".graphql",
".gql",
],
async enabled() {
const app = App.info()
const items = await Filesystem.findUp("biome.json", app.path.cwd, app.path.root)
return items.length > 0
},
}
export const zig: Info = {
name: "zig",
command: ["zig", "fmt", "$FILE"],
-2
View File
@@ -13,7 +13,6 @@ export namespace Global {
export const Path = {
data,
bin: path.join(data, "bin"),
log: path.join(data, "log"),
cache,
config,
state,
@@ -24,7 +23,6 @@ await Promise.all([
fs.mkdir(Global.Path.data, { recursive: true }),
fs.mkdir(Global.Path.config, { recursive: true }),
fs.mkdir(Global.Path.state, { recursive: true }),
fs.mkdir(Global.Path.log, { recursive: true }),
])
const CACHE_VERSION = "3"
+14 -34
View File
@@ -97,7 +97,7 @@ export namespace Provider {
Array.isArray(msg.content) && msg.content.some((part: any) => part.type === "image_url"),
)
}
} catch { }
} catch {}
const headers: Record<string, string> = {
...init.headers,
...copilot.HEADERS,
@@ -126,15 +126,6 @@ export namespace Provider {
options: {},
}
},
azure: async () => {
return {
autoload: false,
async getModel(sdk: any, modelID: string) {
return sdk.responses(modelID)
},
options: {},
}
},
"amazon-bedrock": async () => {
if (!process.env["AWS_PROFILE"] && !process.env["AWS_ACCESS_KEY_ID"] && !process.env["AWS_BEARER_TOKEN_BEDROCK"])
return { autoload: false }
@@ -203,17 +194,6 @@ export namespace Provider {
},
}
},
vercel: async () => {
return {
autoload: false,
options: {
headers: {
"http-referer": "https://opencode.ai/",
"x-title": "opencode",
},
},
}
},
}
const state = App.state("provider", async () => {
@@ -283,26 +263,26 @@ export namespace Provider {
cost:
!model.cost && !existing?.cost
? {
input: 0,
output: 0,
cache_read: 0,
cache_write: 0,
}
input: 0,
output: 0,
cache_read: 0,
cache_write: 0,
}
: {
cache_read: 0,
cache_write: 0,
...existing?.cost,
...model.cost,
},
cache_read: 0,
cache_write: 0,
...existing?.cost,
...model.cost,
},
options: {
...existing?.options,
...model.options,
},
limit: model.limit ??
existing?.limit ?? {
context: 0,
output: 0,
},
context: 0,
output: 0,
},
}
parsed.models[modelID] = parsedModel
}
+29 -30
View File
@@ -377,36 +377,6 @@ export namespace Session {
l.info("chatting")
const inputMode = input.mode ?? "build"
// Process revert cleanup first, before creating new messages
const session = await get(input.sessionID)
if (session.revert) {
let msgs = await messages(input.sessionID)
const messageID = session.revert.messageID
const [preserve, remove] = splitWhen(msgs, (x) => x.info.id === messageID)
msgs = preserve
for (const msg of remove) {
await Storage.remove(`session/message/${input.sessionID}/${msg.info.id}`)
await Bus.publish(MessageV2.Event.Removed, { sessionID: input.sessionID, messageID: msg.info.id })
}
const last = preserve.at(-1)
if (session.revert.partID && last) {
const partID = session.revert.partID
const [preserveParts, removeParts] = splitWhen(last.parts, (x) => x.id === partID)
last.parts = preserveParts
for (const part of removeParts) {
await Storage.remove(`session/part/${input.sessionID}/${last.info.id}/${part.id}`)
await Bus.publish(MessageV2.Event.PartRemoved, {
sessionID: input.sessionID,
messageID: last.info.id,
partID: part.id,
})
}
}
await update(input.sessionID, (draft) => {
draft.revert = undefined
})
}
const userMsg: MessageV2.Info = {
id: input.messageID ?? Identifier.ascending("message"),
role: "user",
@@ -590,6 +560,35 @@ export namespace Session {
const model = await Provider.getModel(input.providerID, input.modelID)
let msgs = await messages(input.sessionID)
const session = await get(input.sessionID)
if (session.revert) {
const messageID = session.revert.messageID
const [preserve, remove] = splitWhen(msgs, (x) => x.info.id === messageID)
msgs = preserve
for (const msg of remove) {
if (msg.info.id === userMsg.id) continue
await Storage.remove(`session/message/${input.sessionID}/${msg.info.id}`)
await Bus.publish(MessageV2.Event.Removed, { sessionID: input.sessionID, messageID: msg.info.id })
}
const last = preserve.at(-1)
if (session.revert.partID && last) {
const partID = session.revert.partID
const [preserveParts, removeParts] = splitWhen(last.parts, (x) => x.id === partID)
last.parts = preserveParts
for (const part of removeParts) {
await Storage.remove(`session/part/${input.sessionID}/${last.info.id}/${part.id}`)
await Bus.publish(MessageV2.Event.PartRemoved, {
sessionID: input.sessionID,
messageID: last.info.id,
partID: part.id,
})
}
}
await update(input.sessionID, (draft) => {
draft.revert = undefined
})
}
const previous = msgs.filter((x) => x.info.role === "assistant").at(-1)?.info as MessageV2.Assistant
const outputLimit = Math.min(model.info.limit.output, OUTPUT_TOKEN_MAX) || OUTPUT_TOKEN_MAX
+11 -10
View File
@@ -2,17 +2,20 @@ import { z } from "zod"
import { Tool } from "./tool"
import DESCRIPTION from "./bash.txt"
import { App } from "../app/app"
import path from "path"
// import Parser from "tree-sitter"
// import Bash from "tree-sitter-bash"
// import { Config } from "../config/config"
import Parser from "tree-sitter"
import Bash from "tree-sitter-bash"
import { Config } from "../config/config"
import { Filesystem } from "../util/filesystem"
import { Permission } from "../permission"
const MAX_OUTPUT_LENGTH = 30000
const DEFAULT_TIMEOUT = 1 * 60 * 1000
const MAX_TIMEOUT = 10 * 60 * 1000
// const parser = new Parser()
// parser.setLanguage(Bash.language as any)
const parser = new Parser()
parser.setLanguage(Bash.language as any)
export const BashTool = Tool.define("bash", {
description: DESCRIPTION,
@@ -27,10 +30,9 @@ export const BashTool = Tool.define("bash", {
}),
async execute(params, ctx) {
const timeout = Math.min(params.timeout ?? DEFAULT_TIMEOUT, MAX_TIMEOUT)
const app = App.info()
/*
const _cfg = await Config.get()
const tree = parser.parse(params.command)
const cfg = await Config.get()
const app = App.info()
const permissions = (() => {
const value = cfg.permission?.bash
if (!value)
@@ -91,7 +93,7 @@ export const BashTool = Tool.define("bash", {
if (needsAsk) {
await Permission.ask({
id: "bash",
id: "basj",
sessionID: ctx.sessionID,
title: params.command,
metadata: {
@@ -99,7 +101,6 @@ export const BashTool = Tool.define("bash", {
},
})
}
*/
const process = Bun.spawn({
cmd: ["bash", "-c", params.command],
+1 -2
View File
@@ -74,8 +74,7 @@ export namespace ToolRegistry {
modelID.toLowerCase().includes("qwen") ||
modelID.includes("gpt-") ||
modelID.includes("o1") ||
modelID.includes("o3") ||
modelID.includes("codex")
modelID.includes("o3")
) {
return {
patch: false,
+4 -2
View File
@@ -53,10 +53,12 @@ export namespace Log {
export async function init(options: Options) {
if (options.level) level = options.level
cleanup(Global.Path.log)
const dir = path.join(Global.Path.data, "log")
await fs.mkdir(dir, { recursive: true })
cleanup(dir)
if (options.print) return
logpath = path.join(
Global.Path.log,
dir,
options.dev ? "dev.log" : new Date().toISOString().split(".")[0].replace(/:/g, "") + ".log",
)
const logfile = Bun.file(logpath)
+1 -1
View File
@@ -1,11 +1,11 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@opencode-ai/sdk",
"version": "0.0.0",
"type": "module",
"exports": {
".": "./dist/index.js"
},
"version": "0.0.0-202507310417",
"files": [
"dist"
],
-3
View File
@@ -36,6 +36,3 @@ await createClient({
},
],
})
await $`rm -rf dist`
await $`bun tsc`
+5 -8
View File
@@ -9,16 +9,13 @@ const version = process.env["OPENCODE_VERSION"]
if (!version) {
throw new Error("OPENCODE_VERSION is required")
}
const dry = process.env["DRY"] === "true"
await import("./generate")
await $`rm -rf dist`
await $`bun tsc`
const snapshot = process.env["OPENCODE_SNAPSHOT"] === "true"
await $`bun pm version --allow-same-version --no-git-tag-version ${version}`
if (snapshot) {
await $`bun publish --tag snapshot`
}
if (!snapshot) {
if (!dry) {
await $`bun pm version --allow-same-version --no-git-tag-version ${version}`
await $`bun publish`
}
await $`bun pm version 0.0.0 --no-git-tag-version`
@@ -5,14 +5,9 @@ description: Using the opencode JSON config.
You can configure opencode using a JSON config file.
## Format
opencode supports both JSON and JSONC (JSON with Comments) formats. You can use comments in your configuration files:
```jsonc title="opencode.jsonc"
```json title="opencode.json"
{
"$schema": "https://opencode.ai/config.json",
// Theme configuration
"theme": "opencode",
"model": "anthropic/claude-sonnet-4-20250514",
"autoupdate": true
@@ -204,7 +199,7 @@ about rules here](/docs/rules).
You can configure specialized agents for specific tasks through the `agent` option.
```jsonc title="opencode.jsonc"
```json title="opencode.json"
{
"$schema": "https://opencode.ai/config.json",
"agent": {
@@ -213,7 +208,6 @@ You can configure specialized agents for specific tasks through the `agent` opti
"model": "anthropic/claude-sonnet-4-20250514",
"prompt": "You are a code reviewer. Focus on security, performance, and maintainability.",
"tools": {
// Disable file modification tools for review-only agent
"write": false,
"edit": false
}
+3 -85
View File
@@ -50,11 +50,7 @@ You can switch between modes during a session using the _Tab_ key. Or your confi
## Configure
You can customize the built-in modes or create your own through configuration. Modes can be configured in two ways:
### JSON Configuration
Configure modes in your `opencode.json` config file:
You can customize the built-in modes or create your own in the opencode [config](/docs/config).
```json title="opencode.json"
{
@@ -81,35 +77,7 @@ Configure modes in your `opencode.json` config file:
}
```
### Markdown Configuration
You can also define modes using markdown files. Place them in:
- Global: `~/.config/opencode/mode/`
- Project: `.opencode/mode/`
```markdown title="~/.config/opencode/mode/review.md"
---
model: anthropic/claude-sonnet-4-20250514
temperature: 0.1
tools:
write: false
edit: false
bash: false
---
You are in code review mode. Focus on:
- Code quality and best practices
- Potential bugs and edge cases
- Performance implications
- Security considerations
Provide constructive feedback without making direct changes.
```
The markdown file name becomes the mode name (e.g., `review.md` creates a `review` mode).
Let's look at these configuration options in detail.
Let's look at these options in detail.
---
@@ -240,9 +208,7 @@ Here are all the tools can be controlled through the mode config.
## Custom modes
You can create your own custom modes by adding them to the configuration. Here are examples using both approaches:
### Using JSON configuration
You can create your own custom modes by adding them to the `mode` configuration. For example, a documentation mode that focuses on reading and analysis.
```json title="opencode.json" {4-14}
{
@@ -263,54 +229,6 @@ You can create your own custom modes by adding them to the configuration. Here a
}
```
### Using markdown files
Create mode files in `.opencode/mode/` for project-specific modes or `~/.config/opencode/mode/` for global modes:
```markdown title=".opencode/mode/debug.md"
---
temperature: 0.1
tools:
bash: true
read: true
grep: true
write: false
edit: false
---
You are in debug mode. Your primary goal is to help investigate and diagnose issues.
Focus on:
- Understanding the problem through careful analysis
- Using bash commands to inspect system state
- Reading relevant files and logs
- Searching for patterns and anomalies
- Providing clear explanations of findings
Do not make any changes to files. Only investigate and report.
```
```markdown title="~/.config/opencode/mode/refactor.md"
---
model: anthropic/claude-sonnet-4-20250514
temperature: 0.2
tools:
edit: true
read: true
grep: true
glob: true
---
You are in refactoring mode. Focus on improving code quality without changing functionality.
Priorities:
- Improve code readability and maintainability
- Apply consistent naming conventions
- Reduce code duplication
- Optimize performance where appropriate
- Ensure all tests continue to pass
```
---
### Use cases
-28
View File
@@ -1,28 +0,0 @@
#!/usr/bin/env bun
import { $ } from "bun"
const snapshot = process.env["OPENCODE_SNAPSHOT"] === "true"
const version = snapshot
? `0.0.0-${new Date().toISOString().slice(0, 16).replace(/[-:T]/g, "")}`
: process.env["OPENCODE_VERSION"]
if (!version) {
throw new Error("OPENCODE_VERSION is required")
}
process.env["OPENCODE_VERSION"] = version
await import(`../packages/opencode/script/publish.ts`)
await import(`../packages/sdk/js/script/publish.ts`)
// await import(`../packages/sdk/stainless/generate.ts`)
if (!snapshot) {
await $`git commit -am "Release v${version}"`
await $`git tag v${version}`
await $`git push origin HEAD --tags`
}
if (snapshot) {
await $`git commit --allow-empty -m "Snapshot release v${version}"`
await $`git tag v${version}`
await $`git push origin v${version}`
await $`git reset --soft HEAD~1`
}
View File
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env bun
import { $ } from "bun"
const snapshot = process.env["OPENCODE_SNAPSHOT"] === "true"
const version = snapshot
? `0.0.0-${new Date().toISOString().slice(0, 16).replace(/[-:T]/g, "")}`
: process.env["OPENCODE_VERSION"]
if (!version) {
throw new Error("OPENCODE_VERSION is required")
}
process.env["OPENCODE_VERSION"] = version
await import(`../packages/sdk/stainless/generate.ts`)
await import(`../packages/sdk/js/script/publish.ts`)
await $`git commit -am "Release v${version}"`
await $`git tag v${version}`
await $`git push HEAD --tags`
+8 -7
View File
@@ -9,8 +9,10 @@ while [ "$#" -gt 0 ]; do
esac
done
# Get the latest release from GitHub
latest_tag=$(gh release list --limit 1 --json tagName --jq '.[0].tagName')
git fetch --force --tags
# Get the latest Git tag
latest_tag=$(git tag --sort=committerdate | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | tail -1)
# If there is no tag, exit the script
if [ -z "$latest_tag" ]; then
@@ -20,9 +22,8 @@ fi
echo "Latest tag: $latest_tag"
# Remove the 'v' prefix and split into major, minor, and patch numbers
version_without_v=${latest_tag#v}
IFS='.' read -ra VERSION <<< "$version_without_v"
# Split the tag into major, minor, and patch numbers
IFS='.' read -ra VERSION <<< "$latest_tag"
if [ "$minor" = true ]; then
# Increment the minor version and reset patch to 0
@@ -38,5 +39,5 @@ fi
echo "New version: $new_version"
gh workflow run publish.yml -f version="$new_version"
git tag $new_version
git push --tags
+35
View File
@@ -0,0 +1,35 @@
#!/bin/bash
set -e
# Parse command line arguments
DEV_MODE=false
for arg in "$@"; do
if [ "$arg" = "--dev" ]; then
DEV_MODE=true
fi
done
bun run ./packages/opencode/src/index.ts generate > openapi.json
echo "Running stl builds create..."
stl builds create --branch dev --pull --allow-empty --+target go --+target typescript
echo "Cleaning up..."
rm -rf packages/tui/sdk
mv opencode-go/ packages/tui/sdk/
rm -rf packages/tui/sdk/.git
rm -rf packages/sdk
mv opencode-typescript/ packages/sdk/
rm -rf packages/sdk/.git
# Only run production build if not in dev mode
if [ "$DEV_MODE" = false ]; then
echo "Kicking off production build..."
stl builds create --branch main --wait=false
else
echo "Skipping production build (--dev flag detected)"
fi
echo "Done!"