Compare commits

...

6 Commits

Author SHA1 Message Date
Dax Raad da909d9684 append piped stdin to prompt 2025-07-07 16:33:21 -04:00
Jay V facd851b11 docs: dynamic domain 2025-07-07 16:31:15 -04:00
Dax Raad c51de945a5 Add stdin support to run command
Allow piping content to opencode run when no message arguments are provided, enabling standard Unix pipe patterns for better CLI integration.

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>
2025-07-07 16:29:13 -04:00
Jay V 9253a3ca9e docs: debug 2025-07-07 16:26:23 -04:00
Dax Raad 7cfa297a78 wip: model and prompt flags for tui 2025-07-07 16:24:37 -04:00
Jay V 661b74def6 docs: debug info 2025-07-07 16:13:26 -04:00
6 changed files with 32 additions and 9 deletions
+2
View File
@@ -39,6 +39,8 @@ new sst.cloudflare.x.Astro("Web", {
domain,
path: "packages/web",
environment: {
// For astro config
SST_STAGE: $app.stage,
VITE_API_URL: api.url,
},
})
+4 -1
View File
@@ -54,7 +54,10 @@ export const RunCommand = cmd({
})
},
handler: async (args) => {
const message = args.message.join(" ")
let message = args.message.join(" ")
if (!process.stdin.isTTY) message += "\n" + (await Bun.stdin.text())
await bootstrap({ cwd: process.cwd() }, async () => {
const session = await (async () => {
if (args.continue) {
+20 -5
View File
@@ -15,10 +15,21 @@ export const TuiCommand = cmd({
command: "$0 [project]",
describe: "start opencode tui",
builder: (yargs) =>
yargs.positional("project", {
type: "string",
describe: "path to start opencode in",
}),
yargs
.positional("project", {
type: "string",
describe: "path to start opencode in",
})
.option("model", {
type: "string",
alias: ["m"],
describe: "model to use in the format of provider/model",
})
.option("prompt", {
alias: ["p"],
type: "string",
describe: "prompt to use",
}),
handler: async (args) => {
while (true) {
const cwd = args.project ? path.resolve(args.project) : process.cwd()
@@ -60,7 +71,11 @@ export const TuiCommand = cmd({
cmd,
})
const proc = Bun.spawn({
cmd: [...cmd, ...process.argv.slice(2)],
cmd: [
...cmd,
...(args.model ? ["--model", args.model] : []),
...(args.prompt ? ["--prompt", args.prompt] : []),
],
cwd,
stdout: "inherit",
stderr: "inherit",
+4 -1
View File
@@ -9,10 +9,13 @@ import { rehypeHeadingIds } from "@astrojs/markdown-remark"
import rehypeAutolinkHeadings from "rehype-autolink-headings"
const github = "https://github.com/sst/opencode"
const stage = process.env.SST_STAGE || "dev"
// https://astro.build/config
export default defineConfig({
site: config.url,
site: stage === "production"
? `https://${config.domain}`
: `https://${stage}.${config.domain}`,
output: "server",
adapter: cloudflare({
imageService: "passthrough",
+1 -1
View File
@@ -1,5 +1,5 @@
export default {
url: "https://opencode.ai",
domain: "opencode.ai",
socialCard: "https://social-cards.sst.dev",
github: "https://github.com/sst/opencode",
discord: "https://discord.gg/opencode",
+1 -1
View File
@@ -13,7 +13,7 @@ const {
const isDocs = slug.startsWith("docs")
let encodedTitle = '';
let ogImage = `${config.url}/social-share.png`;
let ogImage = `https://${config.domain}/social-share.png`;
let truncatedDesc = '';
if (isDocs) {