Compare commits

..

28 Commits

Author SHA1 Message Date
Kit Langton
0b111ceb88 Merge branch 'httpapi-exerciser-dsl' of github.com:anomalyco/opencode into HEAD 2026-05-02 18:12:35 -04:00
Kit Langton
f19be82bbe Convert question lifecycle tests to Effect (#25488) 2026-05-02 18:11:30 -04:00
Kit Langton
09415a8ff2 Merge branch 'httpapi-exerciser-dsl' of github.com:anomalyco/opencode into HEAD 2026-05-02 18:06:55 -04:00
Kit Langton
7d241ff0aa test(httpapi): add negative route scenarios 2026-05-02 18:06:27 -04:00
Kit Langton
0b69b36c67 Use Effect helpers in question tests (#25484) 2026-05-02 17:57:15 -04:00
Kit Langton
fa055f25bd test(httpapi): simplify exerciser harness 2026-05-02 17:26:54 -04:00
Kit Langton
c2a1ab4d9e test(httpapi): merge latest dev 2026-05-02 17:05:52 -04:00
Kit Langton
c7a69e62db Merge remote-tracking branch 'origin/dev' into HEAD 2026-05-02 16:59:43 -04:00
Kit Langton
9341d69530 Merge remote-tracking branch 'origin/httpapi-exerciser-dsl' into httpapi-exerciser-dsl 2026-05-02 16:56:15 -04:00
Kit Langton
c3eb736ee8 test(httpapi): prefer Effect semantics for known legacy mismatches 2026-05-02 16:56:14 -04:00
Kit Langton
959cb17295 Use instance test helper in read truncation tests (#25464) 2026-05-02 16:54:41 -04:00
Kit Langton
f86371be2c Use instance test helper in remaining write tests (#25463) 2026-05-02 16:54:27 -04:00
Kit Langton
d0fd39e473 Use instance test helper in write overwrite tests (#25462) 2026-05-02 16:53:40 -04:00
opencode
43e20874f4 sync release versions for v1.14.33 2026-05-02 19:53:06 +00:00
opencode-agent[bot]
c444e971b0 chore: generate 2026-05-02 19:27:24 +00:00
HyeokjaeLee
430bde9e9b fix(instance): restore InstanceBootstrap init parameter for non-Effec… (#25449)
Co-authored-by: Dax Raad <d@ironbay.co>
2026-05-02 15:26:30 -04:00
Kit Langton
05b82a6a30 refactor(cli): drop ModelsDev Promise compat shim (#25460) 2026-05-02 15:11:01 -04:00
Kit Langton
6cd02c05c2 fix(telemetry): emit Tool.execute span for MCP and plugin tools (#25452) 2026-05-02 14:49:56 -04:00
opencode-agent[bot]
b3a7513765 chore: generate 2026-05-02 18:00:11 +00:00
Kit Langton
f8738c9002 feat(models): effectify ModelsDev as Service (#25434) 2026-05-02 13:59:08 -04:00
Aiden Cline
b460db15d7 tweak: allow read tool to accept offset of 0 (#25431) 2026-05-02 11:12:07 -05:00
opencode-agent[bot]
ff4779ca11 chore: generate 2026-05-02 16:09:04 +00:00
Kit Langton
146ff8ad85 feat(cli): add effectCmd wrapper + convert models command (#25429) 2026-05-02 12:08:04 -04:00
OpeOginni
0d0ec7dc46 docs: CLI docs for current commands and flags (#25399) 2026-05-02 11:07:22 -05:00
Jérôme Benoit
1ea6e6cd4b fix(nix): remove stale packages/shared filter (#24930) 2026-05-02 10:49:51 -05:00
opencode-agent[bot]
96061222d2 chore: generate 2026-05-02 15:45:21 +00:00
Kit Langton
3b9155714d Delete Instance.dispose and Instance.reload (#25427) 2026-05-02 11:44:16 -04:00
opencode
7371db5cc6 sync release versions for v1.14.32 2026-05-02 15:34:12 +00:00
74 changed files with 2805 additions and 2090 deletions

View File

@@ -29,7 +29,7 @@
},
"packages/app": {
"name": "@opencode-ai/app",
"version": "1.14.31",
"version": "1.14.33",
"dependencies": {
"@kobalte/core": "catalog:",
"@opencode-ai/core": "workspace:*",
@@ -85,7 +85,7 @@
},
"packages/console/app": {
"name": "@opencode-ai/console-app",
"version": "1.14.31",
"version": "1.14.33",
"dependencies": {
"@cloudflare/vite-plugin": "1.15.2",
"@ibm/plex": "6.4.1",
@@ -119,7 +119,7 @@
},
"packages/console/core": {
"name": "@opencode-ai/console-core",
"version": "1.14.31",
"version": "1.14.33",
"dependencies": {
"@aws-sdk/client-sts": "3.782.0",
"@jsx-email/render": "1.1.1",
@@ -146,7 +146,7 @@
},
"packages/console/function": {
"name": "@opencode-ai/console-function",
"version": "1.14.31",
"version": "1.14.33",
"dependencies": {
"@ai-sdk/anthropic": "3.0.64",
"@ai-sdk/openai": "3.0.48",
@@ -170,7 +170,7 @@
},
"packages/console/mail": {
"name": "@opencode-ai/console-mail",
"version": "1.14.31",
"version": "1.14.33",
"dependencies": {
"@jsx-email/all": "2.2.3",
"@jsx-email/cli": "1.4.3",
@@ -194,7 +194,7 @@
},
"packages/core": {
"name": "@opencode-ai/core",
"version": "1.14.31",
"version": "1.14.33",
"bin": {
"opencode": "./bin/opencode",
},
@@ -228,7 +228,7 @@
},
"packages/desktop": {
"name": "@opencode-ai/desktop",
"version": "1.14.31",
"version": "1.14.33",
"dependencies": {
"@opencode-ai/app": "workspace:*",
"@opencode-ai/ui": "workspace:*",
@@ -263,7 +263,7 @@
},
"packages/desktop-electron": {
"name": "@opencode-ai/desktop-electron",
"version": "1.14.31",
"version": "1.14.33",
"dependencies": {
"drizzle-orm": "catalog:",
"effect": "catalog:",
@@ -309,7 +309,7 @@
},
"packages/enterprise": {
"name": "@opencode-ai/enterprise",
"version": "1.14.31",
"version": "1.14.33",
"dependencies": {
"@opencode-ai/core": "workspace:*",
"@opencode-ai/ui": "workspace:*",
@@ -338,7 +338,7 @@
},
"packages/function": {
"name": "@opencode-ai/function",
"version": "1.14.31",
"version": "1.14.33",
"dependencies": {
"@octokit/auth-app": "8.0.1",
"@octokit/rest": "catalog:",
@@ -354,7 +354,7 @@
},
"packages/opencode": {
"name": "opencode",
"version": "1.14.31",
"version": "1.14.33",
"bin": {
"opencode": "./bin/opencode",
},
@@ -496,7 +496,7 @@
},
"packages/plugin": {
"name": "@opencode-ai/plugin",
"version": "1.14.31",
"version": "1.14.33",
"dependencies": {
"@opencode-ai/sdk": "workspace:*",
"effect": "catalog:",
@@ -531,7 +531,7 @@
},
"packages/sdk/js": {
"name": "@opencode-ai/sdk",
"version": "1.14.31",
"version": "1.14.33",
"dependencies": {
"cross-spawn": "catalog:",
},
@@ -546,7 +546,7 @@
},
"packages/slack": {
"name": "@opencode-ai/slack",
"version": "1.14.31",
"version": "1.14.33",
"dependencies": {
"@opencode-ai/sdk": "workspace:*",
"@slack/bolt": "^3.17.1",
@@ -581,7 +581,7 @@
},
"packages/ui": {
"name": "@opencode-ai/ui",
"version": "1.14.31",
"version": "1.14.33",
"dependencies": {
"@kobalte/core": "catalog:",
"@opencode-ai/core": "workspace:*",
@@ -630,7 +630,7 @@
},
"packages/web": {
"name": "@opencode-ai/web",
"version": "1.14.31",
"version": "1.14.33",
"dependencies": {
"@astrojs/cloudflare": "12.6.3",
"@astrojs/markdown-remark": "6.3.1",

View File

@@ -55,7 +55,6 @@ stdenvNoCC.mkDerivation {
--filter './packages/opencode' \
--filter './packages/desktop' \
--filter './packages/app' \
--filter './packages/shared' \
--frozen-lockfile \
--ignore-scripts \
--no-progress

View File

@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/app",
"version": "1.14.31",
"version": "1.14.33",
"description": "",
"type": "module",
"exports": {

View File

@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/console-app",
"version": "1.14.31",
"version": "1.14.33",
"type": "module",
"license": "MIT",
"scripts": {

View File

@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@opencode-ai/console-core",
"version": "1.14.31",
"version": "1.14.33",
"private": true,
"type": "module",
"license": "MIT",

View File

@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/console-function",
"version": "1.14.31",
"version": "1.14.33",
"$schema": "https://json.schemastore.org/package.json",
"private": true,
"type": "module",

View File

@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/console-mail",
"version": "1.14.31",
"version": "1.14.33",
"dependencies": {
"@jsx-email/all": "2.2.3",
"@jsx-email/cli": "1.4.3",

View File

@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/package.json",
"version": "1.14.31",
"version": "1.14.33",
"name": "@opencode-ai/core",
"type": "module",
"license": "MIT",

View File

@@ -1,7 +1,7 @@
{
"name": "@opencode-ai/desktop-electron",
"private": true,
"version": "1.14.31",
"version": "1.14.33",
"type": "module",
"license": "MIT",
"homepage": "https://opencode.ai",

View File

@@ -1,7 +1,7 @@
{
"name": "@opencode-ai/desktop",
"private": true,
"version": "1.14.31",
"version": "1.14.33",
"type": "module",
"license": "MIT",
"scripts": {

View File

@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/enterprise",
"version": "1.14.31",
"version": "1.14.33",
"private": true,
"type": "module",
"license": "MIT",

View File

@@ -1,7 +1,7 @@
id = "opencode"
name = "OpenCode"
description = "The open source coding agent."
version = "1.14.31"
version = "1.14.33"
schema_version = 1
authors = ["Anomaly"]
repository = "https://github.com/anomalyco/opencode"
@@ -11,26 +11,26 @@ name = "OpenCode"
icon = "./icons/opencode.svg"
[agent_servers.opencode.targets.darwin-aarch64]
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.31/opencode-darwin-arm64.zip"
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.33/opencode-darwin-arm64.zip"
cmd = "./opencode"
args = ["acp"]
[agent_servers.opencode.targets.darwin-x86_64]
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.31/opencode-darwin-x64.zip"
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.33/opencode-darwin-x64.zip"
cmd = "./opencode"
args = ["acp"]
[agent_servers.opencode.targets.linux-aarch64]
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.31/opencode-linux-arm64.tar.gz"
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.33/opencode-linux-arm64.tar.gz"
cmd = "./opencode"
args = ["acp"]
[agent_servers.opencode.targets.linux-x86_64]
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.31/opencode-linux-x64.tar.gz"
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.33/opencode-linux-x64.tar.gz"
cmd = "./opencode"
args = ["acp"]
[agent_servers.opencode.targets.windows-x86_64]
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.31/opencode-windows-x64.zip"
archive = "https://github.com/anomalyco/opencode/releases/download/v1.14.33/opencode-windows-x64.zip"
cmd = "./opencode.exe"
args = ["acp"]

View File

@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/function",
"version": "1.14.31",
"version": "1.14.33",
"$schema": "https://json.schemastore.org/package.json",
"private": true,
"type": "module",

View File

@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/package.json",
"version": "1.14.31",
"version": "1.14.33",
"name": "opencode",
"type": "module",
"license": "MIT",

View File

@@ -31,6 +31,7 @@ import type { Worktree } from "../src/worktree"
import type { Project } from "../src/project/project"
import path from "path"
const preserveExerciseGlobalRoot = !!process.env.OPENCODE_HTTPAPI_EXERCISE_GLOBAL
const exerciseGlobalRoot = process.env.OPENCODE_HTTPAPI_EXERCISE_GLOBAL ?? path.join(process.env.TMPDIR ?? "/tmp", `opencode-httpapi-global-${process.pid}`)
process.env.XDG_DATA_HOME = path.join(exerciseGlobalRoot, "data")
process.env.XDG_CONFIG_HOME = path.join(exerciseGlobalRoot, "config")
@@ -40,6 +41,7 @@ process.env.OPENCODE_DISABLE_SHARE = "true"
const exerciseConfigDirectory = path.join(exerciseGlobalRoot, "config", "opencode")
const exerciseDataDirectory = path.join(exerciseGlobalRoot, "data", "opencode")
const preserveExerciseDatabase = !!process.env.OPENCODE_HTTPAPI_EXERCISE_DB
const exerciseDatabasePath = process.env.OPENCODE_HTTPAPI_EXERCISE_DB ?? path.join(process.env.TMPDIR ?? "/tmp", `opencode-httpapi-exercise-${process.pid}.db`)
process.env.OPENCODE_DB = exerciseDatabasePath
Flag.OPENCODE_DB = exerciseDatabasePath
@@ -60,6 +62,7 @@ const color = {
type Method = (typeof Methods)[number]
type OpenApiMethod = (typeof OpenApiMethods)[number]
type Mode = "effect" | "parity" | "coverage"
type Backend = "effect" | "legacy"
type Comparison = "none" | "status" | "json"
type CaptureMode = "full" | "stream"
type ProjectOptions = { git?: boolean; config?: Partial<Config.Info>; llm?: boolean }
@@ -86,6 +89,10 @@ type CallResult = {
text: string
}
type BackendApp = {
request(input: string | URL | Request, init?: RequestInit): Response | Promise<Response>
}
/** Effect-native helpers available while setting up and asserting a scenario. */
type ScenarioContext = {
directory: string | undefined
@@ -410,6 +417,10 @@ const scenarios: Scenario[] = [
object(body)
check(body.username === "httpapi-local", "local config update should return patched config")
}, "status"),
http
.patch("/config", "config.update.invalid")
.at((ctx) => ({ path: "/config", headers: ctx.headers(), body: { username: 1 } }))
.status(400),
http.get("/config/providers", "config.providers").json(),
http.get("/project", "project.list").json(200, array, "status"),
http.get("/project/current", "project.current").json(200, (body, ctx) => {
@@ -450,25 +461,33 @@ const scenarios: Scenario[] = [
.at((ctx) => ({ path: route("/provider/{providerID}/oauth/callback", { providerID: "httpapi" }), headers: ctx.headers(), body: { method: "bad" } }))
.status(400),
http.get("/permission", "permission.list").json(200, array),
http
.post("/permission/{requestID}/reply", "permission.reply.invalid")
.at((ctx) => ({ path: route("/permission/{requestID}/reply", { requestID: "per_httpapi" }), headers: ctx.headers(), body: { reply: "bad" } }))
.status(400),
http
.post("/permission/{requestID}/reply", "permission.reply")
.at((ctx) => ({ path: route("/permission/{requestID}/reply", { requestID: "per_httpapi" }), headers: ctx.headers(), body: { reply: "once" } }))
.json(200, (body) => {
check(body === true, "permission reply should return true even when request is no longer pending")
}, "status"),
}),
http.get("/question", "question.list").json(200, array),
http
.post("/question/{requestID}/reply", "question.reply.invalid")
.at((ctx) => ({ path: route("/question/{requestID}/reply", { requestID: "que_httpapi_reply" }), headers: ctx.headers(), body: { answers: "Yes" } }))
.status(400),
http
.post("/question/{requestID}/reply", "question.reply")
.at((ctx) => ({ path: route("/question/{requestID}/reply", { requestID: "que_httpapi_reply" }), headers: ctx.headers(), body: { answers: [["Yes"]] } }))
.json(200, (body) => {
check(body === true, "question reply should return true even when request is no longer pending")
}, "status"),
}),
http
.post("/question/{requestID}/reject", "question.reject")
.at((ctx) => ({ path: route("/question/{requestID}/reject", { requestID: "que_httpapi_reject" }), headers: ctx.headers() }))
.json(200, (body) => {
check(body === true, "question reject should return true even when request is no longer pending")
}, "status"),
}),
http
.get("/file", "file.list")
.seeded((ctx) => ctx.file("hello.txt", "hello\n"))
@@ -482,6 +501,13 @@ const scenarios: Scenario[] = [
object(body)
check(body.content === "hello", `content should match seeded file: ${JSON.stringify(body)}`)
}),
http
.get("/file/content", "file.read.missing")
.at((ctx) => ({ path: `/file/content?${new URLSearchParams({ path: "missing.txt" })}`, headers: ctx.headers() }))
.json(200, (body) => {
object(body)
check(body.type === "text" && body.content === "", "missing file content should return an empty text result")
}),
http.get("/file/status", "file.status").json(200, array),
http
.get("/find", "find.text")
@@ -521,6 +547,10 @@ const scenarios: Scenario[] = [
object(body["httpapi-disabled"])
check(body["httpapi-disabled"].status === "disabled", "disabled MCP server should be added without spawning")
}, "status"),
http
.post("/mcp", "mcp.add.invalid")
.at((ctx) => ({ path: "/mcp", headers: ctx.headers(), body: { name: "httpapi-invalid", config: { type: "invalid" } } }))
.status(400),
http
.post("/mcp/{name}/auth", "mcp.auth.start")
.at((ctx) => ({ path: route("/mcp/{name}/auth", { name: "httpapi-missing" }), headers: ctx.headers() }))
@@ -535,7 +565,7 @@ const scenarios: Scenario[] = [
.json(200, (body) => {
object(body)
check(body.success === true, "MCP auth removal should return success")
}, "status"),
}),
http
.post("/mcp/{name}/auth/authenticate", "mcp.auth.authenticate")
.at((ctx) => ({ path: route("/mcp/{name}/auth/authenticate", { name: "httpapi-missing" }), headers: ctx.headers() }))
@@ -553,14 +583,14 @@ const scenarios: Scenario[] = [
.at((ctx) => ({ path: route("/mcp/{name}/connect", { name: "httpapi-missing" }), headers: ctx.headers() }))
.json(200, (body) => {
check(body === true, "missing MCP connect should remain a no-op success")
}, "status"),
}),
http
.post("/mcp/{name}/disconnect", "mcp.disconnect")
.mutating()
.at((ctx) => ({ path: route("/mcp/{name}/disconnect", { name: "httpapi-missing" }), headers: ctx.headers() }))
.json(200, (body) => {
check(body === true, "missing MCP disconnect should remain a no-op success")
}, "status"),
}),
http.get("/pty/shells", "pty.shells").json(200, array),
http.get("/pty", "pty.list").json(200, array),
http
@@ -573,6 +603,10 @@ const scenarios: Scenario[] = [
check(body.command === "/bin/sh", "PTY create should use controlled shell command")
check(body.cwd === ctx.directory, "PTY create should default cwd to scenario directory")
}, "status"),
http
.post("/pty", "pty.create.invalid")
.at((ctx) => ({ path: "/pty", headers: ctx.headers(), body: { command: 1 } }))
.status(400),
http
.get("/pty/{ptyID}", "pty.get")
.at((ctx) => ({ path: route("/pty/{ptyID}", { ptyID: "pty_httpapi_missing" }), headers: ctx.headers() }))
@@ -592,17 +626,17 @@ const scenarios: Scenario[] = [
.at((ctx) => ({ path: route("/pty/{ptyID}", { ptyID: "pty_httpapi_missing" }), headers: ctx.headers() }))
.json(200, (body) => {
check(body === true, "PTY remove should return true")
}, "status"),
}),
http
.get("/pty/{ptyID}/connect", "pty.connect")
.at((ctx) => ({ path: route("/pty/{ptyID}/connect", { ptyID: "invalid" }), headers: ctx.headers() }))
.at((ctx) => ({ path: route("/pty/{ptyID}/connect", { ptyID: "pty_httpapi_missing" }), headers: ctx.headers() }))
.status(404, undefined, "none"),
http.get("/experimental/console", "experimental.console.get").json(),
http.get("/experimental/console/orgs", "experimental.console.listOrgs").json(),
http
.post("/experimental/console/switch", "experimental.console.switchOrg")
.at((ctx) => ({ path: "/experimental/console/switch", headers: ctx.headers(), body: { accountID: 1, orgID: 1 } }))
.status(400),
.at((ctx) => ({ path: "/experimental/console/switch", headers: ctx.headers(), body: { accountID: "httpapi-account", orgID: "httpapi-org" } }))
.status(400, undefined, "none"),
http.get("/experimental/workspace/adapter", "experimental.workspace.adapter.list").json(200, array),
http.get("/experimental/workspace", "experimental.workspace.list").json(200, array),
http.get("/experimental/workspace/status", "experimental.workspace.status").json(200, array),
@@ -636,6 +670,10 @@ const scenarios: Scenario[] = [
yield* ctx.worktreeRemove(body.directory)
}),
"status"),
http
.post("/experimental/worktree", "worktree.create.invalid")
.at((ctx) => ({ path: "/experimental/worktree", headers: ctx.headers(), body: { name: 1 } }))
.status(400),
http
.delete("/experimental/worktree", "worktree.remove")
.mutating()
@@ -643,7 +681,7 @@ const scenarios: Scenario[] = [
.at((ctx) => ({ path: "/experimental/worktree", headers: ctx.headers(), body: { directory: ctx.state.directory } }))
.json(200, (body) => {
check(body === true, "worktree remove should return true")
}, "status"),
}),
http
.post("/experimental/worktree/reset", "worktree.reset")
.mutating()
@@ -654,7 +692,7 @@ const scenarios: Scenario[] = [
check(body === true, "worktree reset should return true")
yield* ctx.worktreeRemove(ctx.state.directory)
}),
"status"),
),
http.get("/experimental/session", "experimental.session.list").json(200, array),
http.get("/experimental/resource", "experimental.resource.list").json(),
http.post("/sync/history", "sync.history.list").at((ctx) => ({ path: "/sync/history", headers: ctx.headers(), body: {} })).json(200, array),
@@ -664,10 +702,10 @@ const scenarios: Scenario[] = [
.status(400),
http.post("/sync/start", "sync.start").mutating().preserveDatabase().json(200, (body) => {
check(body === true, "sync start should return true when no workspace sessions exist")
}, "status"),
}),
http.post("/instance/dispose", "instance.dispose").mutating().json(200, (body) => {
check(body === true, "instance dispose should return true")
}, "status"),
}),
http
.post("/log", "app.log")
.global()
@@ -686,7 +724,7 @@ const scenarios: Scenario[] = [
object(auth)
check(isRecord(auth.test) && auth.test.key === "test-key", "auth set should write isolated auth file")
}),
"status"),
),
http
.delete("/auth/{providerID}", "auth.remove")
.global()
@@ -703,7 +741,7 @@ const scenarios: Scenario[] = [
object(auth)
check(auth.test === undefined, "auth remove should delete provider from isolated auth file")
}),
"status"),
),
http
.get("/session", "session.list")
.seeded((ctx) => ctx.session({ title: "List me" }))
@@ -734,6 +772,10 @@ const scenarios: Scenario[] = [
check(body.id === ctx.state.id, "should return requested session")
check(body.title === "Get me", "should preserve seeded title")
}),
http
.get("/session/{sessionID}", "session.get.missing")
.at((ctx) => ({ path: route("/session/{sessionID}", { sessionID: "ses_httpapi_missing" }), headers: ctx.headers() }))
.status(404),
http
.patch("/session/{sessionID}", "session.update")
.mutating()
@@ -743,6 +785,11 @@ const scenarios: Scenario[] = [
object(body)
check(body.title === "After rename", "updated session should use new title")
}, "status"),
http
.patch("/session/{sessionID}", "session.update.invalid")
.mutating()
.at((ctx) => ({ path: route("/session/{sessionID}", { sessionID: "ses_httpapi_missing" }), headers: ctx.headers(), body: { title: 1 } }))
.status(400),
http
.delete("/session/{sessionID}", "session.delete")
.mutating()
@@ -753,7 +800,7 @@ const scenarios: Scenario[] = [
check(body === true, "delete should return true")
check((yield* ctx.sessionGet(ctx.state.id)) === undefined, "deleted session should not remain in storage")
}),
"status"),
),
http
.get("/session/{sessionID}/children", "session.children")
.seeded((ctx) =>
@@ -863,7 +910,7 @@ const scenarios: Scenario[] = [
const messages = yield* ctx.messages(ctx.state.session.id)
check(messages[0]?.parts.length === 0, "deleted part should not remain on message")
}),
"status"),
),
http
.delete("/session/{sessionID}/message/{messageID}", "session.deleteMessage")
.mutating()
@@ -886,7 +933,7 @@ const scenarios: Scenario[] = [
check(body === true, "delete message should return true")
check((yield* ctx.messages(ctx.state.session.id)).length === 0, "deleted message should not remain")
}),
"status"),
),
http
.post("/session/{sessionID}/fork", "session.fork")
.mutating()
@@ -903,7 +950,13 @@ const scenarios: Scenario[] = [
.at((ctx) => ({ path: route("/session/{sessionID}/abort", { sessionID: ctx.state.id }), headers: ctx.headers() }))
.json(200, (body) => {
check(body === true, "abort should return true")
}, "status"),
}),
http
.post("/session/{sessionID}/abort", "session.abort.missing")
.at((ctx) => ({ path: route("/session/{sessionID}/abort", { sessionID: "ses_httpapi_missing" }), headers: ctx.headers() }))
.json(200, (body) => {
check(body === true, "missing session abort should remain a no-op success")
}),
http
.post("/session/{sessionID}/init", "session.init")
.preserveDatabase()
@@ -927,7 +980,7 @@ const scenarios: Scenario[] = [
check(body === true, "init should return true")
yield* ctx.llmWait(1)
}),
"status"),
),
http
.post("/session/{sessionID}/message", "session.prompt")
.preserveDatabase()
@@ -1119,7 +1172,7 @@ const scenarios: Scenario[] = [
}))
.json(200, (body) => {
check(body === true, "deprecated permission response should return true")
}, "status"),
}),
http
.post("/session/{sessionID}/share", "session.share")
.mutating()
@@ -1142,6 +1195,10 @@ const scenarios: Scenario[] = [
.post("/tui/append-prompt", "tui.appendPrompt")
.at((ctx) => ({ path: "/tui/append-prompt", headers: ctx.headers(), body: { text: "hello" } }))
.json(200, boolean, "status"),
http
.post("/tui/select-session", "tui.selectSession.invalid")
.at((ctx) => ({ path: "/tui/select-session", headers: ctx.headers(), body: { sessionID: "invalid" } }))
.status(400),
http.post("/tui/open-help", "tui.openHelp").json(200, boolean, "status"),
http.post("/tui/open-sessions", "tui.openSessions").json(200, boolean, "status"),
http.post("/tui/open-themes", "tui.openThemes").json(200, boolean, "status"),
@@ -1191,6 +1248,7 @@ const scenarios: Scenario[] = [
]
const main = Effect.gen(function* () {
yield* Effect.addFinalizer(() => cleanupExercisePaths)
const options = parseOptions(Bun.argv.slice(2))
const modules = yield* Effect.promise(() => runtime())
const effectRoutes = routeKeys(OpenApi.fromApi(modules.PublicApi))
@@ -1416,15 +1474,23 @@ function controlledPtyInput(title: string | undefined) {
}
}
function call(backend: "effect" | "legacy", scenario: ActiveScenario, ctx: SeededContext<unknown>) {
function call(backend: Backend, scenario: ActiveScenario, ctx: SeededContext<unknown>) {
return Effect.promise(async () => capture(await app(await runtime(), backend).request(toRequest(scenario, ctx)), scenario.capture))
}
function app(modules: Runtime, backend: "effect" | "legacy") {
const appCache: Partial<Record<Backend, BackendApp>> = {}
function app(modules: Runtime, backend: Backend) {
Flag.OPENCODE_EXPERIMENTAL_HTTPAPI = backend === "effect"
Flag.OPENCODE_SERVER_PASSWORD = undefined
Flag.OPENCODE_SERVER_USERNAME = undefined
if (backend === "legacy") return modules.Server.Legacy().app
if (appCache[backend]) return appCache[backend]
if (backend === "legacy") {
const legacy = modules.Server.Legacy().app
return (appCache.legacy = {
request: (input, init) => legacy.request(input, init),
})
}
const handler = HttpRouter.toWebHandler(
modules.ExperimentalHttpApiServer.routes.pipe(
@@ -1432,12 +1498,11 @@ function app(modules: Runtime, backend: "effect" | "legacy") {
),
{ disableLogger: true },
).handler
return {
fetch: (request: Request) => handler(request, modules.ExperimentalHttpApiServer.context),
return (appCache.effect = {
request(input: string | URL | Request, init?: RequestInit) {
return this.fetch(input instanceof Request ? input : new Request(new URL(input, "http://localhost"), init))
return handler(input instanceof Request ? input : new Request(new URL(input, "http://localhost"), init), modules.ExperimentalHttpApiServer.context)
},
}
})
}
function toRequest(scenario: ActiveScenario, ctx: SeededContext<unknown>) {
@@ -1462,17 +1527,29 @@ async function capture(response: Response, mode: CaptureMode): Promise<CallResul
async function captureStream(response: Response) {
if (!response.body) return ""
const reader = response.body.getReader()
const read = reader.read().then((result) => ({ result }))
const read = reader.read().then(
(result) => ({ result }),
(error: unknown) => ({ error }),
)
const winner = await Promise.race([read, Bun.sleep(1_000).then(() => ({ timeout: true }))])
if ("timeout" in winner) {
await reader.cancel("timed out waiting for stream chunk").catch(() => undefined)
throw new Error("timed out waiting for stream chunk")
}
if ("error" in winner) throw winner.error
await reader.cancel().catch(() => undefined)
if (winner.result.done) return ""
return new TextDecoder().decode(winner.result.value)
}
const cleanupExercisePaths = Effect.promise(async () => {
const fs = await import("fs/promises")
if (!preserveExerciseDatabase) {
await Promise.all([exerciseDatabasePath, `${exerciseDatabasePath}-wal`, `${exerciseDatabasePath}-shm`].map((file) => fs.rm(file, { force: true }).catch(() => undefined)))
}
if (!preserveExerciseGlobalRoot) await fs.rm(exerciseGlobalRoot, { recursive: true, force: true }).catch(() => undefined)
})
function compare(scenario: ActiveScenario, effect: CallResult, legacy: CallResult) {
return Effect.sync(() => {
if (effect.status !== legacy.status) throw new Error(`legacy returned ${legacy.status}, effect returned ${effect.status}`)

View File

@@ -1,9 +1,11 @@
import { Instance } from "../project/instance"
import { InstanceStore } from "../project/instance-store"
import { getBootstrapRunEffect } from "../effect/app-runtime"
export async function bootstrap<T>(directory: string, cb: () => Promise<T>) {
return Instance.provide({
directory,
init: await getBootstrapRunEffect(),
fn: async () => {
try {
const result = await cb()

View File

@@ -212,7 +212,7 @@ export const GithubInstallCommand = cmd({
const app = await getAppInfo()
await installGitHubApp()
const providers = await ModelsDev.get().then((p) => {
const providers = await AppRuntime.runPromise(ModelsDev.Service.use((s) => s.get())).then((p) => {
// TODO: add guide for copilot, for now just hide it
delete p["github-copilot"]
return p

View File

@@ -1,19 +1,16 @@
import type { Argv } from "yargs"
import { Instance } from "../../project/instance"
import { EOL } from "os"
import { Effect } from "effect"
import { Provider } from "@/provider/provider"
import { ProviderID } from "../../provider/schema"
import { ModelsDev } from "@/provider/models"
import { cmd } from "./cmd"
import { effectCmd, fail } from "../effect-cmd"
import { UI } from "../ui"
import { EOL } from "os"
import { AppRuntime } from "@/effect/app-runtime"
import { Effect } from "effect"
export const ModelsCommand = cmd({
export const ModelsCommand = effectCmd({
command: "models [provider]",
describe: "list all available models",
builder: (yargs: Argv) => {
return yargs
builder: (yargs) =>
yargs
.positional("provider", {
describe: "provider ID to filter models by",
type: "string",
@@ -26,63 +23,44 @@ export const ModelsCommand = cmd({
.option("refresh", {
describe: "refresh the models cache from models.dev",
type: "boolean",
})
},
handler: async (args) => {
}),
handler: Effect.fn("Cli.models")(function* (args) {
if (args.refresh) {
await ModelsDev.refresh(true)
yield* ModelsDev.Service.use((s) => s.refresh(true))
UI.println(UI.Style.TEXT_SUCCESS_BOLD + "Models cache refreshed" + UI.Style.TEXT_NORMAL)
}
await Instance.provide({
directory: process.cwd(),
async fn() {
await AppRuntime.runPromise(
Effect.gen(function* () {
const svc = yield* Provider.Service
const providers = yield* svc.list()
const provider = yield* Provider.Service
const providers = yield* provider.list()
const print = (providerID: ProviderID, verbose?: boolean) => {
const provider = providers[providerID]
const sorted = Object.entries(provider.models).sort(([a], [b]) => a.localeCompare(b))
for (const [modelID, model] of sorted) {
process.stdout.write(`${providerID}/${modelID}`)
process.stdout.write(EOL)
if (verbose) {
process.stdout.write(JSON.stringify(model, null, 2))
process.stdout.write(EOL)
}
}
}
const print = (providerID: ProviderID, verbose?: boolean) => {
const p = providers[providerID]
const sorted = Object.entries(p.models).sort(([a], [b]) => a.localeCompare(b))
for (const [modelID, model] of sorted) {
process.stdout.write(`${providerID}/${modelID}`)
process.stdout.write(EOL)
if (verbose) {
process.stdout.write(JSON.stringify(model, null, 2))
process.stdout.write(EOL)
}
}
}
if (args.provider) {
const providerID = ProviderID.make(args.provider)
const provider = providers[providerID]
if (!provider) {
yield* Effect.sync(() => UI.error(`Provider not found: ${args.provider}`))
return
}
if (args.provider) {
const providerID = ProviderID.make(args.provider)
if (!providers[providerID]) return yield* fail(`Provider not found: ${args.provider}`)
print(providerID, args.verbose)
return
}
yield* Effect.sync(() => print(providerID, args.verbose))
return
}
const ids = Object.keys(providers).sort((a, b) => {
const aIsOpencode = a.startsWith("opencode")
const bIsOpencode = b.startsWith("opencode")
if (aIsOpencode && !bIsOpencode) return -1
if (!aIsOpencode && bIsOpencode) return 1
return a.localeCompare(b)
})
yield* Effect.sync(() => {
for (const providerID of ids) {
print(ProviderID.make(providerID), args.verbose)
}
})
}),
)
},
const ids = Object.keys(providers).sort((a, b) => {
const aIsOpencode = a.startsWith("opencode")
const bIsOpencode = b.startsWith("opencode")
if (aIsOpencode && !bIsOpencode) return -1
if (!aIsOpencode && bIsOpencode) return 1
return a.localeCompare(b)
})
},
for (const providerID of ids) print(ProviderID.make(providerID), args.verbose)
}),
})

View File

@@ -4,6 +4,9 @@ import { cmd } from "./cmd"
import * as prompts from "@clack/prompts"
import { UI } from "../ui"
import { ModelsDev } from "@/provider/models"
const getModels = () => AppRuntime.runPromise(ModelsDev.Service.use((s) => s.get()))
const refreshModels = () => AppRuntime.runPromise(ModelsDev.Service.use((s) => s.refresh(true)))
import { map, pipe, sortBy, values } from "remeda"
import path from "path"
import os from "os"
@@ -245,7 +248,7 @@ export const ProvidersListCommand = cmd({
return Object.entries(yield* auth.all())
}),
)
const database = await ModelsDev.get()
const database = await getModels()
for (const [providerID, result] of results) {
const name = database[providerID]?.name || providerID
@@ -334,14 +337,14 @@ export const ProvidersLoginCommand = cmd({
prompts.outro("Done")
return
}
await ModelsDev.refresh(true).catch(() => {})
await refreshModels().catch(() => {})
const config = await AppRuntime.runPromise(Config.Service.use((cfg) => cfg.get()))
const disabled = new Set(config.disabled_providers ?? [])
const enabled = config.enabled_providers ? new Set(config.enabled_providers) : undefined
const providers = await ModelsDev.get().then((x) => {
const providers = await getModels().then((x) => {
const filtered: Record<string, (typeof x)[string]> = {}
for (const [key, value] of Object.entries(x)) {
if ((enabled ? enabled.has(key) : true) && !disabled.has(key)) {
@@ -505,7 +508,7 @@ export const ProvidersLogoutCommand = cmd({
prompts.log.error("No credentials found")
return
}
const database = await ModelsDev.get()
const database = await getModels()
const selected = await prompts.select({
message: "Select provider",
options: credentials.map(([key, value]) => ({

View File

@@ -10,7 +10,7 @@ import { GlobalBus } from "@/bus/global"
import { Flag } from "@opencode-ai/core/flag/flag"
import { writeHeapSnapshot } from "node:v8"
import { Heap } from "@/cli/heap"
import { AppRuntime } from "@/effect/app-runtime"
import { AppRuntime, getBootstrapRunEffect } from "@/effect/app-runtime"
import { ensureProcessMetadata } from "@opencode-ai/core/util/opencode-process"
ensureProcessMetadata("worker")
@@ -77,6 +77,7 @@ export const rpc = {
async checkUpgrade(input: { directory: string }) {
await Instance.provide({
directory: input.directory,
init: await getBootstrapRunEffect(),
fn: async () => {
await upgrade().catch(() => {})
},

View File

@@ -0,0 +1,50 @@
import type { Argv } from "yargs"
import { Effect, Schema } from "effect"
import { AppRuntime, type AppServices } from "@/effect/app-runtime"
import { InstanceStore } from "@/project/instance-store"
import { cmd } from "./cmd/cmd"
/**
* User-visible command failure. Throw via `fail("...")` from an effectCmd handler
* to surface a printed message + non-zero exit. Recognised by the global error
* formatter in `src/cli/error.ts` (FormatError), so the existing top-level
* catch + cleanup in `src/index.ts` runs normally.
*/
export class CliError extends Schema.TaggedErrorClass<CliError>()("CliError", {
message: Schema.String,
exitCode: Schema.optional(Schema.Number),
}) {}
export const fail = (message: string, exitCode = 1) => Effect.fail(new CliError({ message, exitCode }))
/**
* Effect-native CLI command builder. Wraps yargs `cmd()` so the handler body is
* an `Effect` with `InstanceRef` provided and any `AppServices` yieldable.
*
* Errors propagate to the existing top-level handler in `src/index.ts`; use
* `fail("...")` for user-visible domain failures (clean exit, formatted message).
*
* Handlers are typically `Effect.fn("Cli.<name>")(function*(args) { ... })`,
* which adds a named tracing span per CLI invocation. Once all commands use
* `effectCmd`, swapping the underlying `cmd()` factory for effect/cli's
* `Command.make(...)` won't touch any handler bodies.
*/
export const effectCmd = <Args, A>(opts: {
command: string | readonly string[]
describe: string | false
builder?: (yargs: Argv) => Argv<Args>
/** Defaults to process.cwd(). Override for commands that take a directory positional. */
directory?: (args: Args) => string
handler: (args: Args) => Effect.Effect<A, CliError, AppServices | InstanceStore.Service>
}) =>
cmd<{}, Args>({
command: opts.command,
describe: opts.describe,
builder: opts.builder as never,
async handler(rawArgs) {
// yargs typing wraps Args in ArgumentsCamelCase<WithDoubleDash<...>>; cast at the boundary.
const args = rawArgs as unknown as Args
const directory = opts.directory?.(args) ?? process.cwd()
await AppRuntime.runPromise(InstanceStore.Service.use((s) => s.provide({ directory }, opts.handler(args))))
},
})

View File

@@ -15,6 +15,13 @@ function isTaggedError(error: unknown, tag: string): boolean {
}
export function FormatError(input: unknown) {
// CliError: domain failure surfaced from an effectCmd handler via fail("...")
if (isTaggedError(input, "CliError")) {
const data = input as ErrorLike & { exitCode?: number }
if (data.exitCode != null) process.exitCode = data.exitCode
return data.message ?? ""
}
// MCPFailed: { name: string }
if (NamedError.hasName(input, "MCPFailed")) {
return `MCP server "${(input as ErrorLike).data?.name}" failed. Note, opencode does not support MCP authentication yet.`

View File

@@ -1,4 +1,4 @@
import { Layer, ManagedRuntime } from "effect"
import { Effect, Layer, ManagedRuntime } from "effect"
import { attach } from "./run-service"
import * as Observability from "@opencode-ai/core/effect/observability"
@@ -14,6 +14,7 @@ import { FileWatcher } from "@/file/watcher"
import { Storage } from "@/storage/storage"
import { Snapshot } from "@/snapshot"
import { Plugin } from "@/plugin"
import { ModelsDev } from "@/provider/models"
import { Provider } from "@/provider/provider"
import { ProviderAuth } from "@/provider/auth"
import { Agent } from "@/agent/agent"
@@ -39,6 +40,7 @@ import { Command } from "@/command"
import { Truncate } from "@/tool/truncate"
import { ToolRegistry } from "@/tool/registry"
import { Format } from "@/format"
import { InstanceBootstrap } from "@/project/bootstrap"
import { InstanceStore } from "@/project/instance-store"
import { Project } from "@/project/project"
import { Vcs } from "@/project/vcs"
@@ -66,6 +68,7 @@ export const AppLayer = Layer.mergeAll(
Storage.defaultLayer,
Snapshot.defaultLayer,
Plugin.defaultLayer,
ModelsDev.defaultLayer,
Provider.defaultLayer,
ProviderAuth.defaultLayer,
Agent.defaultLayer,
@@ -91,6 +94,7 @@ export const AppLayer = Layer.mergeAll(
Truncate.defaultLayer,
ToolRegistry.defaultLayer,
Format.defaultLayer,
InstanceBootstrap.defaultLayer,
InstanceStore.defaultLayer,
Project.defaultLayer,
Vcs.defaultLayer,
@@ -105,6 +109,9 @@ export const AppLayer = Layer.mergeAll(
const rt = ManagedRuntime.make(AppLayer, { memoMap })
type Runtime = Pick<typeof rt, "runSync" | "runPromise" | "runPromiseExit" | "runFork" | "runCallback" | "dispose">
/** Services provided by AppRuntime — i.e. what an Effect run via AppRuntime.runPromise can yield. */
export type AppServices = ManagedRuntime.ManagedRuntime.Services<typeof rt>
const wrap = (effect: Parameters<typeof rt.runSync>[0]) => attach(effect as never) as never
export const AppRuntime: Runtime = {
@@ -125,3 +132,15 @@ export const AppRuntime: Runtime = {
},
dispose: () => rt.dispose(),
}
let bootstrapRun: Promise<Effect.Effect<void>>
export function getBootstrapRunEffect(): Promise<Effect.Effect<void>> {
if (!bootstrapRun) {
bootstrapRun = AppRuntime.runPromise(
Effect.gen(function* () {
return (yield* InstanceBootstrap.Service).run
}),
)
}
return bootstrapRun
}

View File

@@ -42,17 +42,4 @@ export const Instance = {
restore<R>(ctx: InstanceContext, fn: () => R): R {
return context.provide(ctx, fn)
},
// followup: `reload` survives because `test/server/project-init-git.test.ts`
// spies on this exact method. Once that test asserts on `InstanceStore.reloadInstance`
// (or moves to an Effect runtime), this wrapper can drop.
async reload(input: InstanceStore.LoadInput) {
return InstanceStore.reloadInstance(input)
},
// followup: `dispose` survives for legacy fixtures that read `Instance.current`
// out of ALS (e.g. `test/fixture/fixture.ts` `provideTmpdirInstance`,
// `test/question/question.test.ts` cancellation tests). Convert those to call
// `InstanceStore.disposeInstance(ctx)` directly once `Instance.provide` is gone.
async dispose() {
return InstanceStore.disposeInstance(Instance.current)
},
}

View File

@@ -1,25 +1,13 @@
import { Global } from "@opencode-ai/core/global"
import * as Log from "@opencode-ai/core/util/log"
import path from "path"
import { Schema } from "effect"
import { Context, Duration, Effect, Layer, Option, Schedule, Schema } from "effect"
import { FetchHttpClient, HttpClient, HttpClientRequest } from "effect/unstable/http"
import { Installation } from "../installation"
import { Flag } from "@opencode-ai/core/flag/flag"
import { lazy } from "@/util/lazy"
import { Filesystem } from "@/util/filesystem"
import { Flock } from "@opencode-ai/core/util/flock"
import { Hash } from "@opencode-ai/core/util/hash"
// Try to import bundled snapshot (generated at build time)
// Falls back to undefined in dev mode when snapshot doesn't exist
/* @ts-ignore */
const log = Log.create({ service: "models.dev" })
const source = url()
const filepath = path.join(
Global.Path.cache,
source === "https://models.dev" ? "models.json" : `models-${Hash.fast(source)}.json`,
)
const ttl = 5 * 60 * 1000
import { AppFileSystem } from "@opencode-ai/core/filesystem"
import { withTransientReadRetry } from "@/util/effect-http-client"
const Cost = Schema.Struct({
input: Schema.Finite,
@@ -101,76 +89,110 @@ export const Provider = Schema.Struct({
export type Provider = Schema.Schema.Type<typeof Provider>
function url() {
return Flag.OPENCODE_MODELS_URL || "https://models.dev"
export interface Interface {
readonly get: () => Effect.Effect<Record<string, Provider>>
readonly refresh: (force?: boolean) => Effect.Effect<void>
}
function fresh() {
return Date.now() - Number(Filesystem.stat(filepath)?.mtimeMs ?? 0) < ttl
}
export class Service extends Context.Service<Service, Interface>()("@opencode/ModelsDev") {}
function skip(force: boolean) {
return !force && fresh()
}
export const layer: Layer.Layer<Service, never, AppFileSystem.Service | HttpClient.HttpClient> = Layer.effect(
Service,
Effect.gen(function* () {
const fs = yield* AppFileSystem.Service
const http = HttpClient.filterStatusOk(withTransientReadRetry(yield* HttpClient.HttpClient))
const fetchApi = async () => {
const result = await fetch(`${url()}/api.json`, {
headers: { "User-Agent": Installation.USER_AGENT },
signal: AbortSignal.timeout(10000),
})
return { ok: result.ok, text: await result.text() }
}
const source = Flag.OPENCODE_MODELS_URL || "https://models.dev"
const filepath = path.join(
Global.Path.cache,
source === "https://models.dev" ? "models.json" : `models-${Hash.fast(source)}.json`,
)
const ttl = Duration.minutes(5)
const lockKey = `models-dev:${filepath}`
export const Data = lazy(async () => {
const result = await Filesystem.readJson(Flag.OPENCODE_MODELS_PATH ?? filepath).catch(() => {})
if (result) return result
// @ts-ignore
const snapshot = await import("./models-snapshot.js")
.then((m) => m.snapshot as Record<string, unknown>)
.catch(() => undefined)
if (snapshot) return snapshot
if (Flag.OPENCODE_DISABLE_MODELS_FETCH) return {}
return Flock.withLock(`models-dev:${filepath}`, async () => {
const result = await Filesystem.readJson(Flag.OPENCODE_MODELS_PATH ?? filepath).catch(() => {})
if (result) return result
const result2 = await fetchApi()
if (result2.ok) {
await Filesystem.write(filepath, result2.text).catch((e) => {
log.error("Failed to write models cache", { error: e })
})
}
return JSON.parse(result2.text)
})
})
export async function get() {
const result = await Data()
return result as Record<string, Provider>
}
export async function refresh(force = false) {
if (skip(force)) return Data.reset()
await Flock.withLock(`models-dev:${filepath}`, async () => {
if (skip(force)) return Data.reset()
const result = await fetchApi()
if (!result.ok) return
await Filesystem.write(filepath, result.text)
Data.reset()
}).catch((e) => {
log.error("Failed to fetch models.dev", {
error: e,
const fresh = Effect.fnUntraced(function* () {
const stat = yield* fs.stat(filepath).pipe(Effect.catch(() => Effect.succeed(undefined)))
if (!stat) return false
const mtime = Option.getOrElse(stat.mtime, () => new Date(0)).getTime()
return Date.now() - mtime < Duration.toMillis(ttl)
})
})
}
if (!Flag.OPENCODE_DISABLE_MODELS_FETCH && !process.argv.includes("--get-yargs-completions")) {
void refresh()
setInterval(
async () => {
await refresh()
},
60 * 1000 * 60,
).unref()
}
const fetchApi = Effect.fn("ModelsDev.fetchApi")(function* () {
return yield* HttpClientRequest.get(`${source}/api.json`).pipe(
HttpClientRequest.setHeader("User-Agent", Installation.USER_AGENT),
http.execute,
Effect.flatMap((res) => res.text),
Effect.timeout("10 seconds"),
)
})
const loadFromDisk = fs.readJson(Flag.OPENCODE_MODELS_PATH ?? filepath).pipe(
Effect.catch(() => Effect.succeed(undefined)),
Effect.map((v) => v as Record<string, Provider> | undefined),
)
// Bundled at build time; absent in dev — `tryPromise` covers both.
const loadSnapshot = Effect.tryPromise({
// @ts-ignore — generated at build time, may not exist in dev
try: () => import("./models-snapshot.js").then((m) => m.snapshot as Record<string, Provider> | undefined),
catch: () => undefined,
}).pipe(Effect.catch(() => Effect.succeed(undefined)))
const fetchAndWrite = Effect.fn("ModelsDev.fetchAndWrite")(function* () {
const text = yield* fetchApi()
yield* fs.writeWithDirs(filepath, text)
return text
})
const populate = Effect.gen(function* () {
const fromDisk = yield* loadFromDisk
if (fromDisk) return fromDisk
const snapshot = yield* loadSnapshot
if (snapshot) return snapshot
if (Flag.OPENCODE_DISABLE_MODELS_FETCH) return {}
// Flock is cross-process: concurrent opencode CLIs can race on this cache file.
const text = yield* Effect.scoped(
Effect.gen(function* () {
yield* Flock.effect(lockKey)
return yield* fetchAndWrite()
}),
)
return JSON.parse(text) as Record<string, Provider>
}).pipe(Effect.withSpan("ModelsDev.populate"), Effect.orDie)
const [cachedGet, invalidate] = yield* Effect.cachedInvalidateWithTTL(populate, Duration.infinity)
const get = (): Effect.Effect<Record<string, Provider>> => cachedGet
const refresh = Effect.fn("ModelsDev.refresh")(function* (force = false) {
if (!force && (yield* fresh())) return
yield* Effect.scoped(
Effect.gen(function* () {
yield* Flock.effect(lockKey)
// Re-check under the lock: another process may have refreshed between
// our outer check and lock acquisition.
if (!force && (yield* fresh())) return
yield* fetchAndWrite()
yield* invalidate
}),
).pipe(
Effect.tapCause((cause) => Effect.logError("Failed to fetch models.dev", { cause })),
Effect.ignore,
)
})
if (!Flag.OPENCODE_DISABLE_MODELS_FETCH && !process.argv.includes("--get-yargs-completions")) {
// Schedule.spaced runs the effect once, then waits between completions.
yield* Effect.forkScoped(refresh().pipe(Effect.repeat(Schedule.spaced("60 minutes")), Effect.ignore))
}
return Service.of({ get, refresh })
}),
)
export const defaultLayer: Layer.Layer<Service> = layer.pipe(
Layer.provide(FetchHttpClient.layer),
Layer.provide(AppFileSystem.defaultLayer),
)
export * as ModelsDev from "./models"

View File

@@ -1074,7 +1074,7 @@ export function fromModelsDevProvider(provider: ModelsDev.Provider): Info {
const layer: Layer.Layer<
Service,
never,
Config.Service | Auth.Service | Plugin.Service | AppFileSystem.Service | Env.Service
Config.Service | Auth.Service | Plugin.Service | AppFileSystem.Service | Env.Service | ModelsDev.Service
> = Layer.effect(
Service,
Effect.gen(function* () {
@@ -1083,13 +1083,14 @@ const layer: Layer.Layer<
const auth = yield* Auth.Service
const env = yield* Env.Service
const plugin = yield* Plugin.Service
const modelsDevSvc = yield* ModelsDev.Service
const state = yield* InstanceState.make<State>(() =>
Effect.gen(function* () {
using _ = log.time("state")
const bridge = yield* EffectBridge.make()
const cfg = yield* config.get()
const modelsDev = yield* Effect.promise(() => ModelsDev.get())
const modelsDev = yield* modelsDevSvc.get()
const database = mapValues(modelsDev, fromModelsDevProvider)
const providers: Record<ProviderID, Info> = {} as Record<ProviderID, Info>
@@ -1722,6 +1723,7 @@ export const defaultLayer = Layer.suspend(() =>
Layer.provide(Config.defaultLayer),
Layer.provide(Auth.defaultLayer),
Layer.provide(Plugin.defaultLayer),
Layer.provide(ModelsDev.defaultLayer),
),
)

View File

@@ -17,7 +17,7 @@ export const providerHandlers = HttpApiBuilder.group(InstanceHttpApi, "provider"
const list = Effect.fn("ProviderHttpApi.list")(function* () {
const config = yield* cfg.get()
const all = yield* Effect.promise(() => ModelsDev.get())
const all = yield* ModelsDev.Service.use((s) => s.get())
const disabled = new Set(config.disabled_providers ?? [])
const enabled = config.enabled_providers ? new Set(config.enabled_providers) : undefined
const filtered: Record<string, (typeof all)[string]> = {}

View File

@@ -23,6 +23,7 @@ import { InstanceStore } from "@/project/instance-store"
import { Plugin } from "@/plugin"
import { Project } from "@/project/project"
import { ProviderAuth } from "@/provider/auth"
import { ModelsDev } from "@/provider/models"
import { Provider } from "@/provider/provider"
import { Pty } from "@/pty"
import { Question } from "@/question"
@@ -155,6 +156,7 @@ export function createRoutes(corsOptions?: CorsOptions) {
InstanceBootstrap.defaultLayer,
InstanceStore.defaultLayer,
MCP.defaultLayer,
ModelsDev.defaultLayer,
Permission.defaultLayer,
Plugin.defaultLayer,
Project.defaultLayer,

View File

@@ -1,6 +1,6 @@
import type { MiddlewareHandler } from "hono"
import { Instance } from "@/project/instance"
import { AppRuntime } from "@/effect/app-runtime"
import { getBootstrapRunEffect } from "@/effect/app-runtime"
import { AppFileSystem } from "@opencode-ai/core/filesystem"
import { WorkspaceContext } from "@/control-plane/workspace-context"
import { WorkspaceID } from "@/control-plane/schema"
@@ -23,6 +23,7 @@ export function InstanceMiddleware(workspaceID?: WorkspaceID): MiddlewareHandler
async fn() {
return Instance.provide({
directory,
init: await getBootstrapRunEffect(),
async fn() {
return next()
},

View File

@@ -2,12 +2,13 @@ import { Hono } from "hono"
import { describeRoute, validator } from "hono-openapi"
import { resolver } from "hono-openapi"
import { Instance } from "@/project/instance"
import { InstanceStore } from "@/project/instance-store"
import { Project } from "@/project/project"
import z from "zod"
import { ProjectID } from "@/project/schema"
import { errors } from "../../error"
import { lazy } from "@/util/lazy"
import { AppRuntime } from "@/effect/app-runtime"
import { getBootstrapRunEffect } from "@/effect/app-runtime"
import { jsonRequest, runRequest } from "./trace"
export const ProjectRoutes = lazy(() =>
@@ -81,10 +82,11 @@ export const ProjectRoutes = lazy(() =>
Project.Service.use((svc) => svc.initGit({ directory: dir, project: prev })),
)
if (next.id === prev.id && next.vcs === prev.vcs && next.worktree === prev.worktree) return c.json(next)
await Instance.reload({
await InstanceStore.reloadInstance({
directory: dir,
worktree: dir,
project: next,
init: await getBootstrapRunEffect(),
})
return c.json(next)
},

View File

@@ -36,7 +36,7 @@ export const ProviderRoutes = lazy(() =>
const svc = yield* Provider.Service
const cfg = yield* Config.Service
const config = yield* cfg.get()
const all = yield* Effect.promise(() => ModelsDev.get())
const all = yield* ModelsDev.Service.use((s) => s.get())
const disabled = new Set(config.disabled_providers ?? [])
const enabled = config.enabled_providers ? new Set(config.enabled_providers) : undefined
const filtered: Record<string, (typeof all)[string]> = {}

View File

@@ -5,10 +5,10 @@ import { WorkspaceID } from "@/control-plane/schema"
import { WorkspaceContext } from "@/control-plane/workspace-context"
import { Workspace } from "@/control-plane/workspace"
import { Flag } from "@opencode-ai/core/flag/flag"
import { getBootstrapRunEffect, AppRuntime } from "@/effect/app-runtime"
import { Instance } from "@/project/instance"
import { Session } from "@/session/session"
import { SessionID } from "@/session/schema"
import { AppRuntime } from "@/effect/app-runtime"
import { Effect } from "effect"
import * as Log from "@opencode-ai/core/util/log"
import { ServerProxy } from "./proxy"
@@ -94,11 +94,13 @@ export function WorkspaceRouterMiddleware(upgrade: UpgradeWebSocket): Middleware
const target = await adapter.target(workspace)
if (target.type === "local") {
const init = await getBootstrapRunEffect()
return WorkspaceContext.provide({
workspaceID: WorkspaceID.make(workspaceID),
fn: () =>
Instance.provide({
directory: target.directory,
init,
async fn() {
return next()
},

View File

@@ -464,9 +464,18 @@ NOTE: At any point in time through this workflow you should feel free to ask the
{ tool: key, sessionID: ctx.sessionID, callID: opts.toolCallId },
{ args },
)
yield* ctx.ask({ permission: key, metadata: {}, patterns: ["*"], always: ["*"] })
const result: Awaited<ReturnType<NonNullable<typeof execute>>> = yield* Effect.promise(() =>
execute(args, opts),
const result: Awaited<ReturnType<NonNullable<typeof execute>>> = yield* Effect.gen(function* () {
yield* ctx.ask({ permission: key, metadata: {}, patterns: ["*"], always: ["*"] })
return yield* Effect.promise(() => execute(args, opts))
}).pipe(
Effect.withSpan("Tool.execute", {
attributes: {
"tool.name": key,
"tool.call_id": opts.toolCallId,
"session.id": ctx.sessionID,
"message.id": input.processor.message.id,
},
}),
)
yield* plugin.trigger(
"tool.execute.after",

View File

@@ -154,10 +154,6 @@ export const ReadTool = Tool.define(
params: Schema.Schema.Type<typeof Parameters>,
ctx: Tool.Context,
) {
if (params.offset !== undefined && params.offset < 1) {
return yield* Effect.fail(new Error("offset must be greater than or equal to 1"))
}
const instance = yield* InstanceState.context
let filepath = params.filePath
if (!path.isAbsolute(filepath)) {
@@ -192,7 +188,7 @@ export const ReadTool = Tool.define(
if (stat.type === "Directory") {
const items = yield* list(filepath)
const limit = params.limit ?? DEFAULT_READ_LIMIT
const offset = params.offset ?? 1
const offset = params.offset || 1
const start = offset - 1
const sliced = items.slice(start, start + limit)
const truncated = start + sliced.length < items.length
@@ -249,7 +245,7 @@ export const ReadTool = Tool.define(
}
const file = yield* Effect.promise(() =>
lines(filepath, { limit: params.limit ?? DEFAULT_READ_LIMIT, offset: params.offset ?? 1 }),
lines(filepath, { limit: params.limit ?? DEFAULT_READ_LIMIT, offset: params.offset || 1 }),
)
if (file.count < file.offset && !(file.count === 0 && file.offset === 1)) {
return yield* Effect.fail(

View File

@@ -154,7 +154,16 @@ export const layer: Layer.Layer<
...(out.truncated && { outputPath: out.outputPath }),
},
}
}),
}).pipe(
Effect.withSpan("Tool.execute", {
attributes: {
"tool.name": id,
"session.id": toolCtx.sessionID,
"message.id": toolCtx.messageID,
...(toolCtx.callID ? { "tool.call_id": toolCtx.callID } : {}),
},
}),
),
}
}

View File

@@ -3,6 +3,7 @@ import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner"
import { $ } from "bun"
import { Context, Deferred, Duration, Effect, Exit, Fiber, Layer } from "effect"
import { InstanceState } from "@/effect/instance-state"
import { InstanceStore } from "../../src/project/instance-store"
import { Instance } from "../../src/project/instance"
import { disposeAllInstances, provideInstance, tmpdirScoped } from "../fixture/fixture"
import { testEffect } from "../lib/effect"
@@ -69,7 +70,7 @@ it.live("InstanceState invalidates on reload", () =>
)
const a = yield* access(state, dir)
yield* Effect.promise(() => Instance.reload({ directory: dir }))
yield* Effect.promise(() => InstanceStore.reloadInstance({ directory: dir }))
const b = yield* access(state, dir)
expect(a).not.toBe(b)
@@ -269,7 +270,7 @@ it.live("InstanceState correct after interleaved init and dispose", () =>
const [, b] = yield* Effect.all(
[
Effect.promise(() => Instance.reload({ directory: one })),
Effect.promise(() => InstanceStore.reloadInstance({ directory: one })),
Test.use((svc) => svc.get()).pipe(provideInstance(two)),
],
{ concurrency: "unbounded" },

View File

@@ -9,8 +9,8 @@ import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner"
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"
import type { Config } from "@/config/config"
import { InstanceRef } from "../../src/effect/instance-ref"
import { Instance } from "../../src/project/instance"
import { InstanceStore } from "../../src/project/instance-store"
import { Instance } from "../../src/project/instance"
import { TestLLMServer } from "../lib/llm-server"
// Re-export for test ergonomics. The implementation lives next to the runtime
@@ -151,7 +151,7 @@ export function provideTmpdirInstance<A, E, R>(
? Effect.promise(() =>
Instance.provide({
directory: path,
fn: () => Instance.dispose(),
fn: () => InstanceStore.disposeInstance(Instance.current),
}),
).pipe(Effect.ignore)
: Effect.void,

View File

@@ -9,6 +9,19 @@ import { TestInstance, withTmpdirInstance } from "../fixture/fixture"
type Body<A, E, R> = Effect.Effect<A, E, R> | (() => Effect.Effect<A, E, R>)
type InstanceOptions = { git?: boolean; config?: Partial<Config.Info> }
function isInstanceOptions(options: InstanceOptions | number | TestOptions | undefined): options is InstanceOptions {
return !!options && typeof options === "object" && ("git" in options || "config" in options)
}
function instanceArgs(
options?: InstanceOptions | number | TestOptions,
testOptions?: number | TestOptions,
): { instanceOptions: InstanceOptions | undefined; testOptions: number | TestOptions | undefined } {
if (typeof options === "number") return { instanceOptions: undefined, testOptions: options }
if (isInstanceOptions(options)) return { instanceOptions: options, testOptions }
return { instanceOptions: undefined, testOptions: options }
}
const body = <A, E, R>(value: Body<A, E, R>) => Effect.suspend(() => (typeof value === "function" ? value() : value))
const run = <A, E, R, E2>(value: Body<A, E, R | Scope.Scope>, layer: Layer.Layer<R, E2>) =>
@@ -44,23 +57,32 @@ const make = <R, E>(testLayer: Layer.Layer<R, E>, liveLayer: Layer.Layer<R, E>)
const instance = <A, E2>(
name: string,
value: Body<A, E2, R | TestInstance | Scope.Scope>,
instanceOptions?: InstanceOptions,
options?: InstanceOptions | number | TestOptions,
opts?: number | TestOptions,
) => test(name, () => run(body(value).pipe(withTmpdirInstance(instanceOptions)), liveLayer), opts)
) => {
const args = instanceArgs(options, opts)
return test(name, () => run(body(value).pipe(withTmpdirInstance(args.instanceOptions)), liveLayer), args.testOptions)
}
instance.only = <A, E2>(
name: string,
value: Body<A, E2, R | TestInstance | Scope.Scope>,
instanceOptions?: InstanceOptions,
options?: InstanceOptions | number | TestOptions,
opts?: number | TestOptions,
) => test.only(name, () => run(body(value).pipe(withTmpdirInstance(instanceOptions)), liveLayer), opts)
) => {
const args = instanceArgs(options, opts)
return test.only(name, () => run(body(value).pipe(withTmpdirInstance(args.instanceOptions)), liveLayer), args.testOptions)
}
instance.skip = <A, E2>(
name: string,
value: Body<A, E2, R | TestInstance | Scope.Scope>,
instanceOptions?: InstanceOptions,
options?: InstanceOptions | number | TestOptions,
opts?: number | TestOptions,
) => test.skip(name, () => run(body(value).pipe(withTmpdirInstance(instanceOptions)), liveLayer), opts)
) => {
const args = instanceArgs(options, opts)
return test.skip(name, () => run(body(value).pipe(withTmpdirInstance(args.instanceOptions)), liveLayer), args.testOptions)
}
return { effect, live, instance }
}

View File

@@ -1,4 +1,5 @@
import { test, expect, mock, beforeEach } from "bun:test"
import { InstanceStore } from "../../src/project/instance-store"
import { Effect } from "effect"
import type { MCP as MCPNS } from "../../src/mcp/index"
@@ -197,7 +198,7 @@ function withInstance(
fn: async () => {
await Effect.runPromise(MCP.Service.use(fn).pipe(Effect.provide(MCP.defaultLayer)))
// dispose instance to clean up state between tests
await Instance.dispose()
await InstanceStore.disposeInstance(Instance.current)
},
})
}

View File

@@ -6,6 +6,7 @@ import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner"
import { Permission } from "../../src/permission"
import { PermissionID } from "../../src/permission/schema"
import { Instance } from "../../src/project/instance"
import { InstanceStore } from "../../src/project/instance-store"
import { disposeAllInstances, provideInstance, provideTmpdirInstance, tmpdirScoped } from "../fixture/fixture"
import { testEffect } from "../lib/effect"
import { MessageID, SessionID } from "../../src/session/schema"
@@ -998,7 +999,9 @@ it.live("pending permission rejects on instance dispose", () =>
}).pipe(run, Effect.forkScoped)
expect(yield* waitForPending(1).pipe(run)).toHaveLength(1)
yield* Effect.promise(() => Instance.provide({ directory: dir, fn: () => void Instance.dispose() }))
yield* Effect.promise(() =>
Instance.provide({ directory: dir, fn: () => void InstanceStore.disposeInstance(Instance.current) }),
)
const exit = yield* Fiber.await(fiber)
expect(Exit.isFailure(exit)).toBe(true)
@@ -1021,7 +1024,7 @@ it.live("pending permission rejects on instance reload", () =>
}).pipe(run, Effect.forkScoped)
expect(yield* waitForPending(1).pipe(run)).toHaveLength(1)
yield* Effect.promise(() => Instance.reload({ directory: dir }))
yield* Effect.promise(() => InstanceStore.reloadInstance({ directory: dir }))
const exit = yield* Fiber.await(fiber)
expect(Exit.isFailure(exit)).toBe(true)
@@ -1115,7 +1118,7 @@ it.live("ask - abort should clear pending request", () =>
const pending = yield* waitForPending(1).pipe(run)
expect(pending).toHaveLength(1)
yield* Effect.promise(() => Instance.reload({ directory: dir }))
yield* Effect.promise(() => InstanceStore.reloadInstance({ directory: dir }))
const exit = yield* Fiber.await(fiber)
expect(Exit.isFailure(exit)).toBe(true)

View File

@@ -5,6 +5,7 @@ import path from "path"
import { Cause, Effect, Exit, Layer } from "effect"
import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner"
import { Instance } from "../../src/project/instance"
import { InstanceStore } from "../../src/project/instance-store"
import { Worktree } from "../../src/worktree"
import { disposeAllInstances, provideInstance, provideTmpdirInstance } from "../fixture/fixture"
import { testEffect } from "../lib/effect"
@@ -136,7 +137,11 @@ describe("Worktree", () => {
expect(props.name).toBe(info.name)
expect(props.branch).toBe(info.branch)
yield* Effect.promise(() => Instance.dispose()).pipe(provideInstance(info.directory))
yield* Effect.promise(() =>
InstanceStore.runtime.runPromise((s) =>
s.load({ directory: info.directory }).pipe(Effect.flatMap(s.dispose)),
),
)
yield* Effect.promise(() => Bun.sleep(100))
yield* svc.remove({ directory: info.directory })
}),
@@ -156,7 +161,11 @@ describe("Worktree", () => {
expect(info.branch).toBe("opencode/test-workspace")
yield* Effect.promise(() => ready)
yield* Effect.promise(() => Instance.dispose()).pipe(provideInstance(info.directory))
yield* Effect.promise(() =>
InstanceStore.runtime.runPromise((s) =>
s.load({ directory: info.directory }).pipe(Effect.flatMap(s.dispose)),
),
)
yield* Effect.promise(() => Bun.sleep(100))
yield* svc.remove({ directory: info.directory })
}),

View File

@@ -0,0 +1,259 @@
import { describe, expect, beforeAll, beforeEach, afterAll } from "bun:test"
import { Effect, Layer, Ref } from "effect"
import { HttpClient, HttpClientResponse } from "effect/unstable/http"
import { AppFileSystem } from "@opencode-ai/core/filesystem"
import { Flag } from "@opencode-ai/core/flag/flag"
import { Global } from "@opencode-ai/core/global"
import { ModelsDev } from "../../src/provider/models"
import { it } from "../lib/effect"
import { rm, writeFile, utimes, mkdir } from "fs/promises"
import path from "path"
// test/preload.ts pins OPENCODE_MODELS_PATH to a fixture so other tests can
// resolve providers without network. These tests need to drive the on-disk
// cache themselves and silence the eager refresh fork. Save/restore around
// the suite — never leak the mutation to subsequent test files in the same
// bun process.
const ORIGINAL_MODELS_PATH = Flag.OPENCODE_MODELS_PATH
const ORIGINAL_DISABLE_FETCH = Flag.OPENCODE_DISABLE_MODELS_FETCH
beforeAll(() => {
Flag.OPENCODE_MODELS_PATH = undefined
Flag.OPENCODE_DISABLE_MODELS_FETCH = true
})
afterAll(() => {
Flag.OPENCODE_MODELS_PATH = ORIGINAL_MODELS_PATH
Flag.OPENCODE_DISABLE_MODELS_FETCH = ORIGINAL_DISABLE_FETCH
})
const cacheFile = path.join(Global.Path.cache, "models.json")
const fixture: Record<string, ModelsDev.Provider> = {
acme: {
id: "acme",
name: "Acme",
env: ["ACME_API_KEY"],
models: {
"acme-1": {
id: "acme-1",
name: "Acme One",
release_date: "2026-01-01",
attachment: false,
reasoning: false,
temperature: true,
tool_call: true,
limit: { context: 128000, output: 8192 },
},
},
},
}
const fixture2: Record<string, ModelsDev.Provider> = {
beta: {
id: "beta",
name: "Beta",
env: ["BETA_API_KEY"],
models: {
"beta-1": {
id: "beta-1",
name: "Beta One",
release_date: "2026-02-01",
attachment: false,
reasoning: true,
temperature: false,
tool_call: false,
limit: { context: 64000, output: 4096 },
},
},
},
}
interface MockState {
body: string
status: number
calls: Array<{ url: string }>
}
const makeMockClient = (state: Ref.Ref<MockState>) =>
HttpClient.make((request) =>
Effect.gen(function* () {
yield* Ref.update(state, (s) => ({ ...s, calls: [...s.calls, { url: request.url }] }))
const s = yield* Ref.get(state)
return HttpClientResponse.fromWeb(request, new Response(s.body, { status: s.status }))
}),
)
const buildLayer = (state: Ref.Ref<MockState>) =>
// Layer.fresh is required: ModelsDev.layer is a module-level Layer constant,
// and Effect.provide uses a process-global MemoMap by default — without fresh,
// every test would reuse the cachedInvalidateWithTTL state from the first run.
Layer.fresh(ModelsDev.layer).pipe(
Layer.provide(Layer.succeed(HttpClient.HttpClient, makeMockClient(state))),
Layer.provide(AppFileSystem.defaultLayer),
)
const writeCache = (data: object, mtimeMs?: number) =>
Effect.promise(async () => {
await mkdir(Global.Path.cache, { recursive: true })
await writeFile(cacheFile, JSON.stringify(data))
if (mtimeMs !== undefined) {
const t = mtimeMs / 1000
await utimes(cacheFile, t, t)
}
})
const provided = <A, E>(state: Ref.Ref<MockState>, eff: Effect.Effect<A, E, ModelsDev.Service>) =>
eff.pipe(Effect.provide(buildLayer(state)))
beforeEach(async () => {
await rm(cacheFile, { force: true })
})
afterAll(async () => {
await rm(cacheFile, { force: true })
})
const initialState: MockState = {
body: JSON.stringify(fixture),
status: 200,
calls: [],
}
describe("ModelsDev Service", () => {
it.live("get() returns providers from disk when cache file exists", () =>
Effect.gen(function* () {
yield* writeCache(fixture)
const state = yield* Ref.make(initialState)
const result = yield* provided(
state,
ModelsDev.Service.use((s) => s.get()),
)
expect(result).toEqual(fixture)
const final = yield* Ref.get(state)
expect(final.calls).toEqual([])
}),
)
it.live("get() returns {} when disk empty and fetch disabled", () =>
Effect.gen(function* () {
const state = yield* Ref.make(initialState)
const result = yield* provided(
state,
ModelsDev.Service.use((s) => s.get()),
)
expect(result).toEqual({})
const final = yield* Ref.get(state)
expect(final.calls).toEqual([])
}),
)
it.live("get() is single-flight under concurrent calls", () =>
Effect.gen(function* () {
yield* writeCache(fixture)
const state = yield* Ref.make(initialState)
const results = yield* provided(
state,
Effect.gen(function* () {
const svc = yield* ModelsDev.Service
return yield* Effect.all([svc.get(), svc.get(), svc.get(), svc.get(), svc.get()], {
concurrency: "unbounded",
})
}),
)
for (const result of results) expect(result).toEqual(fixture)
}),
)
it.live("get() caches across calls (later disk writes are ignored until invalidate)", () =>
Effect.gen(function* () {
yield* writeCache(fixture)
const state = yield* Ref.make(initialState)
const first = yield* provided(
state,
Effect.gen(function* () {
const svc = yield* ModelsDev.Service
const a = yield* svc.get()
// mutate disk between calls — cache should mask the change
yield* writeCache(fixture2)
const b = yield* svc.get()
return { a, b }
}),
)
expect(first.a).toEqual(fixture)
expect(first.b).toEqual(fixture)
}),
)
it.live("refresh(true) fetches via HttpClient and updates the cache", () =>
Effect.gen(function* () {
yield* writeCache(fixture)
const state = yield* Ref.make({ ...initialState, body: JSON.stringify(fixture2) })
const result = yield* provided(
state,
Effect.gen(function* () {
const svc = yield* ModelsDev.Service
const before = yield* svc.get()
yield* svc.refresh(true)
const after = yield* svc.get()
return { before, after }
}),
)
expect(result.before).toEqual(fixture)
expect(result.after).toEqual(fixture2)
const final = yield* Ref.get(state)
expect(final.calls.length).toBe(1)
expect(final.calls[0].url).toContain("/api.json")
}),
)
it.live("refresh(false) skips fetch when on-disk file is fresh", () =>
Effect.gen(function* () {
// Fresh: mtime within the 5-minute TTL.
yield* writeCache(fixture, Date.now() - 1000)
const state = yield* Ref.make({ ...initialState, body: JSON.stringify(fixture2) })
yield* provided(
state,
ModelsDev.Service.use((s) => s.refresh(false)),
)
const final = yield* Ref.get(state)
expect(final.calls).toEqual([])
}),
)
it.live("refresh(false) fetches when on-disk file is stale", () =>
Effect.gen(function* () {
// Stale: mtime 10 minutes ago, beyond the 5-minute TTL.
yield* writeCache(fixture, Date.now() - 10 * 60 * 1000)
const state = yield* Ref.make({ ...initialState, body: JSON.stringify(fixture2) })
const after = yield* provided(
state,
Effect.gen(function* () {
const svc = yield* ModelsDev.Service
yield* svc.refresh(false)
return yield* svc.get()
}),
)
const final = yield* Ref.get(state)
expect(final.calls.length).toBe(1)
expect(after).toEqual(fixture2)
}),
)
it.live("refresh swallows HTTP errors and leaves cache intact", () =>
Effect.gen(function* () {
yield* writeCache(fixture)
const state = yield* Ref.make({ ...initialState, status: 500, body: "boom" })
const result = yield* provided(
state,
Effect.gen(function* () {
const svc = yield* ModelsDev.Service
yield* svc.refresh(true)
return yield* svc.get()
}),
)
expect(result).toEqual(fixture)
// withTransientReadRetry retries 5xx, so calls may be > 1.
const final = yield* Ref.get(state)
expect(final.calls.length).toBeGreaterThanOrEqual(1)
}),
)
})

View File

@@ -2,6 +2,7 @@ import { afterEach, expect } from "bun:test"
import { Cause, Effect, Exit, Fiber, Layer } from "effect"
import { Question } from "../../src/question"
import { Instance } from "../../src/project/instance"
import { InstanceStore } from "../../src/project/instance-store"
import { QuestionID } from "../../src/question/schema"
import { disposeAllInstances, provideInstance, tmpdirScoped } from "../fixture/fixture"
import { SessionID } from "../../src/session/schema"
@@ -374,7 +375,9 @@ it.live("pending question rejects on instance dispose", () =>
}).pipe(provideInstance(dir), Effect.forkScoped)
expect(yield* waitForPending(1).pipe(provideInstance(dir))).toHaveLength(1)
yield* Effect.promise(() => Instance.provide({ directory: dir, fn: () => void Instance.dispose() }))
yield* Effect.promise(() =>
Instance.provide({ directory: dir, fn: () => InstanceStore.disposeInstance(Instance.current) }),
)
const exit = yield* Fiber.await(fiber)
expect(Exit.isFailure(exit)).toBe(true)
@@ -397,7 +400,7 @@ it.live("pending question rejects on instance reload", () =>
}).pipe(provideInstance(dir), Effect.forkScoped)
expect(yield* waitForPending(1).pipe(provideInstance(dir))).toHaveLength(1)
yield* Effect.promise(() => Instance.reload({ directory: dir }))
yield* Effect.promise(() => InstanceStore.reloadInstance({ directory: dir }))
const exit = yield* Fiber.await(fiber)
expect(Exit.isFailure(exit)).toBe(true)

View File

@@ -5,6 +5,7 @@ import { Flag } from "@opencode-ai/core/flag/flag"
import { ExperimentalHttpApiServer } from "../../src/server/routes/instance/httpapi/server"
import { McpPaths } from "../../src/server/routes/instance/httpapi/groups/mcp"
import { Instance } from "../../src/project/instance"
import { InstanceStore } from "../../src/project/instance-store"
import { Server } from "../../src/server/server"
import * as Log from "@opencode-ai/core/util/log"
import { resetDatabase } from "../fixture/db"
@@ -57,7 +58,9 @@ function withMcpProject<A, E, R>(self: (dir: string) => Effect.Effect<A, E, R>)
}),
)
yield* Effect.addFinalizer(() =>
Effect.promise(() => Instance.provide({ directory: dir, fn: () => Instance.dispose() })).pipe(Effect.ignore),
Effect.promise(() =>
Instance.provide({ directory: dir, fn: () => InstanceStore.disposeInstance(Instance.current) }),
).pipe(Effect.ignore),
)
return yield* self(dir).pipe(provideInstance(dir))

View File

@@ -3,6 +3,7 @@ import { Effect, FileSystem, Layer, Path } from "effect"
import { NodeFileSystem, NodePath } from "@effect/platform-node"
import { Flag } from "@opencode-ai/core/flag/flag"
import { Instance } from "../../src/project/instance"
import { InstanceStore } from "../../src/project/instance-store"
import { Server } from "../../src/server/server"
import * as Log from "@opencode-ai/core/util/log"
import { resetDatabase } from "../fixture/db"
@@ -89,7 +90,9 @@ function withProviderProject<A, E, R>(self: (dir: string) => Effect.Effect<A, E,
)
yield* writeProviderAuthPlugin(dir)
yield* Effect.addFinalizer(() =>
Effect.promise(() => Instance.provide({ directory: dir, fn: () => Instance.dispose() })).pipe(Effect.ignore),
Effect.promise(() =>
Instance.provide({ directory: dir, fn: () => InstanceStore.disposeInstance(Instance.current) }),
).pipe(Effect.ignore),
)
return yield* self(dir).pipe(provideInstance(dir))

View File

@@ -1,9 +1,8 @@
import { afterEach, describe, expect, spyOn, test } from "bun:test"
import { afterEach, describe, expect, test } from "bun:test"
import { Effect } from "effect"
import path from "path"
import { GlobalBus } from "../../src/bus/global"
import { Snapshot } from "../../src/snapshot"
import { Instance } from "../../src/project/instance"
import { Server } from "../../src/server/server"
import { Filesystem } from "@/util/filesystem"
import * as Log from "@opencode-ai/core/util/log"
@@ -16,6 +15,9 @@ afterEach(async () => {
await resetDatabase()
})
const disposedEvents = (seen: { directory?: string; payload: { type: string } }[], dir: string) =>
seen.filter((evt) => evt.directory === dir && evt.payload.type === "server.instance.disposed").length
describe("project.initGit endpoint", () => {
test("initializes git and reloads immediately", async () => {
await using tmp = await tmpdir()
@@ -24,8 +26,6 @@ describe("project.initGit endpoint", () => {
const fn = (evt: { directory?: string; payload: { type: string } }) => {
seen.push(evt)
}
const reload = Instance.reload
const reloadSpy = spyOn(Instance, "reload").mockImplementation((input) => reload(input))
GlobalBus.on("event", fn)
try {
@@ -42,10 +42,8 @@ describe("project.initGit endpoint", () => {
vcs: "git",
worktree: tmp.path,
})
expect(reloadSpy).toHaveBeenCalledTimes(1)
expect(seen.some((evt) => evt.directory === tmp.path && evt.payload.type === "server.instance.disposed")).toBe(
true,
)
// Reload behavior: bus emits exactly one server.instance.disposed for the directory.
expect(disposedEvents(seen, tmp.path)).toBe(1)
expect(await Filesystem.exists(path.join(tmp.path, ".git", "opencode"))).toBe(false)
const current = await app.request("/project/current", {
@@ -70,7 +68,6 @@ describe("project.initGit endpoint", () => {
).toBeTruthy()
} finally {
await disposeAllInstances()
reloadSpy.mockRestore()
GlobalBus.off("event", fn)
}
})
@@ -82,8 +79,6 @@ describe("project.initGit endpoint", () => {
const fn = (evt: { directory?: string; payload: { type: string } }) => {
seen.push(evt)
}
const reload = Instance.reload
const reloadSpy = spyOn(Instance, "reload").mockImplementation((input) => reload(input))
GlobalBus.on("event", fn)
try {
@@ -98,10 +93,7 @@ describe("project.initGit endpoint", () => {
vcs: "git",
worktree: tmp.path,
})
expect(
seen.filter((evt) => evt.directory === tmp.path && evt.payload.type === "server.instance.disposed").length,
).toBe(0)
expect(reloadSpy).toHaveBeenCalledTimes(0)
expect(disposedEvents(seen, tmp.path)).toBe(0)
const current = await app.request("/project/current", {
headers: {
@@ -115,7 +107,6 @@ describe("project.initGit endpoint", () => {
})
} finally {
await disposeAllInstances()
reloadSpy.mockRestore()
GlobalBus.off("event", fn)
}
})

View File

@@ -13,7 +13,7 @@ import { ReadTool } from "../../src/tool/read"
import { Truncate } from "@/tool/truncate"
import { Tool } from "@/tool/tool"
import { Filesystem } from "@/util/filesystem"
import { disposeAllInstances, provideInstance, tmpdirScoped } from "../fixture/fixture"
import { disposeAllInstances, provideInstance, TestInstance, tmpdirScoped } from "../fixture/fixture"
import { testEffect } from "../lib/effect"
const FIXTURES_DIR = path.join(import.meta.dir, "fixtures")
@@ -255,28 +255,28 @@ describe("tool.read env file permissions", () => {
})
describe("tool.read truncation", () => {
it.live("truncates large file by bytes and sets truncated metadata", () =>
it.instance("truncates large file by bytes and sets truncated metadata", () =>
Effect.gen(function* () {
const dir = yield* tmpdirScoped()
const test = yield* TestInstance
const base = yield* load(path.join(FIXTURES_DIR, "models-api.json"))
const target = 60 * 1024
const content = base.length >= target ? base : base.repeat(Math.ceil(target / base.length))
yield* put(path.join(dir, "large.json"), content)
yield* put(path.join(test.directory, "large.json"), content)
const result = yield* exec(dir, { filePath: path.join(dir, "large.json") })
const result = yield* run({ filePath: path.join(test.directory, "large.json") })
expect(result.metadata.truncated).toBe(true)
expect(result.output).toContain("Output capped at")
expect(result.output).toContain("Use offset=")
}),
)
it.live("truncates by line count when limit is specified", () =>
it.instance("truncates by line count when limit is specified", () =>
Effect.gen(function* () {
const dir = yield* tmpdirScoped()
const test = yield* TestInstance
const lines = Array.from({ length: 100 }, (_, i) => `line${i}`).join("\n")
yield* put(path.join(dir, "many-lines.txt"), lines)
yield* put(path.join(test.directory, "many-lines.txt"), lines)
const result = yield* exec(dir, { filePath: path.join(dir, "many-lines.txt"), limit: 10 })
const result = yield* run({ filePath: path.join(test.directory, "many-lines.txt"), limit: 10 })
expect(result.metadata.truncated).toBe(true)
expect(result.output).toContain("Showing lines 1-10 of 100")
expect(result.output).toContain("Use offset=11")
@@ -286,12 +286,12 @@ describe("tool.read truncation", () => {
}),
)
it.live("does not truncate small file", () =>
it.instance("does not truncate small file", () =>
Effect.gen(function* () {
const dir = yield* tmpdirScoped()
yield* put(path.join(dir, "small.txt"), "hello world")
const test = yield* TestInstance
yield* put(path.join(test.directory, "small.txt"), "hello world")
const result = yield* exec(dir, { filePath: path.join(dir, "small.txt") })
const result = yield* run({ filePath: path.join(test.directory, "small.txt") })
expect(result.metadata.truncated).toBe(false)
expect(result.output).toContain("End of file")
}),

View File

@@ -95,26 +95,42 @@ describe("tool.write", () => {
})
describe("existing file overwrite", () => {
it.live("overwrites existing file content", () =>
provideTmpdirInstance((dir) =>
Effect.gen(function* () {
const filepath = path.join(dir, "existing.txt")
yield* Effect.promise(() => fs.writeFile(filepath, "old content", "utf-8"))
const result = yield* run({ filePath: filepath, content: "new content" })
it.instance("overwrites existing file content", () =>
Effect.gen(function* () {
const test = yield* TestInstance
const filepath = path.join(test.directory, "existing.txt")
yield* Effect.promise(() => fs.writeFile(filepath, "old content", "utf-8"))
const result = yield* run({ filePath: filepath, content: "new content" })
expect(result.output).toContain("Wrote file successfully")
expect(result.metadata.exists).toBe(true)
expect(result.output).toContain("Wrote file successfully")
expect(result.metadata.exists).toBe(true)
const content = yield* Effect.promise(() => fs.readFile(filepath, "utf-8"))
expect(content).toBe("new content")
}),
),
const content = yield* Effect.promise(() => fs.readFile(filepath, "utf-8"))
expect(content).toBe("new content")
}),
)
it.live("preserves BOM when overwriting existing files", () =>
provideTmpdirInstance((dir) =>
it.instance("preserves BOM when overwriting existing files", () =>
Effect.gen(function* () {
const test = yield* TestInstance
const filepath = path.join(test.directory, "existing.cs")
const bom = String.fromCharCode(0xfeff)
yield* Effect.promise(() => fs.writeFile(filepath, `${bom}using System;\n`, "utf-8"))
yield* run({ filePath: filepath, content: "using Up;\n" })
const content = yield* Effect.promise(() => fs.readFile(filepath, "utf-8"))
expect(content.charCodeAt(0)).toBe(0xfeff)
expect(content.slice(1)).toBe("using Up;\n")
}),
)
it.instance(
"restores BOM after formatter strips it",
() =>
Effect.gen(function* () {
const filepath = path.join(dir, "existing.cs")
const test = yield* TestInstance
const filepath = path.join(test.directory, "formatted.cs")
const bom = String.fromCharCode(0xfeff)
yield* Effect.promise(() => fs.writeFile(filepath, `${bom}using System;\n`, "utf-8"))
@@ -124,165 +140,138 @@ describe("tool.write", () => {
expect(content.charCodeAt(0)).toBe(0xfeff)
expect(content.slice(1)).toBe("using Up;\n")
}),
),
)
it.live("restores BOM after formatter strips it", () =>
provideTmpdirInstance(
(dir) =>
Effect.gen(function* () {
const filepath = path.join(dir, "formatted.cs")
const bom = String.fromCharCode(0xfeff)
yield* Effect.promise(() => fs.writeFile(filepath, `${bom}using System;\n`, "utf-8"))
yield* run({ filePath: filepath, content: "using Up;\n" })
const content = yield* Effect.promise(() => fs.readFile(filepath, "utf-8"))
expect(content.charCodeAt(0)).toBe(0xfeff)
expect(content.slice(1)).toBe("using Up;\n")
}),
{
config: {
formatter: {
stripbom: {
extensions: [".cs"],
command: [
"node",
"-e",
"const fs = require('fs'); const file = process.argv[1]; let text = fs.readFileSync(file, 'utf8'); if (text.charCodeAt(0) === 0xfeff) text = text.slice(1); fs.writeFileSync(file, text, 'utf8')",
"$FILE",
],
},
{
config: {
formatter: {
stripbom: {
extensions: [".cs"],
command: [
"node",
"-e",
"const fs = require('fs'); const file = process.argv[1]; let text = fs.readFileSync(file, 'utf8'); if (text.charCodeAt(0) === 0xfeff) text = text.slice(1); fs.writeFileSync(file, text, 'utf8')",
"$FILE",
],
},
},
},
),
},
)
it.live("returns diff in metadata for existing files", () =>
provideTmpdirInstance((dir) =>
Effect.gen(function* () {
const filepath = path.join(dir, "file.txt")
yield* Effect.promise(() => fs.writeFile(filepath, "old", "utf-8"))
const result = yield* run({ filePath: filepath, content: "new" })
it.instance("returns diff in metadata for existing files", () =>
Effect.gen(function* () {
const test = yield* TestInstance
const filepath = path.join(test.directory, "file.txt")
yield* Effect.promise(() => fs.writeFile(filepath, "old", "utf-8"))
const result = yield* run({ filePath: filepath, content: "new" })
expect(result.metadata).toHaveProperty("filepath", filepath)
expect(result.metadata).toHaveProperty("exists", true)
}),
),
expect(result.metadata).toHaveProperty("filepath", filepath)
expect(result.metadata).toHaveProperty("exists", true)
}),
)
})
describe("file permissions", () => {
it.live("sets file permissions when writing sensitive data", () =>
provideTmpdirInstance((dir) =>
Effect.gen(function* () {
const filepath = path.join(dir, "sensitive.json")
yield* run({ filePath: filepath, content: JSON.stringify({ secret: "data" }) })
it.instance("sets file permissions when writing sensitive data", () =>
Effect.gen(function* () {
const test = yield* TestInstance
const filepath = path.join(test.directory, "sensitive.json")
yield* run({ filePath: filepath, content: JSON.stringify({ secret: "data" }) })
if (process.platform !== "win32") {
const stats = yield* Effect.promise(() => fs.stat(filepath))
expect(stats.mode & 0o777).toBe(0o644)
}
}),
),
if (process.platform !== "win32") {
const stats = yield* Effect.promise(() => fs.stat(filepath))
expect(stats.mode & 0o777).toBe(0o644)
}
}),
)
})
describe("content types", () => {
it.live("writes JSON content", () =>
provideTmpdirInstance((dir) =>
Effect.gen(function* () {
const filepath = path.join(dir, "data.json")
const data = { key: "value", nested: { array: [1, 2, 3] } }
yield* run({ filePath: filepath, content: JSON.stringify(data, null, 2) })
it.instance("writes JSON content", () =>
Effect.gen(function* () {
const test = yield* TestInstance
const filepath = path.join(test.directory, "data.json")
const data = { key: "value", nested: { array: [1, 2, 3] } }
yield* run({ filePath: filepath, content: JSON.stringify(data, null, 2) })
const content = yield* Effect.promise(() => fs.readFile(filepath, "utf-8"))
expect(JSON.parse(content)).toEqual(data)
}),
),
const content = yield* Effect.promise(() => fs.readFile(filepath, "utf-8"))
expect(JSON.parse(content)).toEqual(data)
}),
)
it.live("writes binary-safe content", () =>
provideTmpdirInstance((dir) =>
Effect.gen(function* () {
const filepath = path.join(dir, "binary.bin")
const content = "Hello\x00World\x01\x02\x03"
yield* run({ filePath: filepath, content })
it.instance("writes binary-safe content", () =>
Effect.gen(function* () {
const test = yield* TestInstance
const filepath = path.join(test.directory, "binary.bin")
const content = "Hello\x00World\x01\x02\x03"
yield* run({ filePath: filepath, content })
const buf = yield* Effect.promise(() => fs.readFile(filepath))
expect(buf.toString()).toBe(content)
}),
),
const buf = yield* Effect.promise(() => fs.readFile(filepath))
expect(buf.toString()).toBe(content)
}),
)
it.live("writes empty content", () =>
provideTmpdirInstance((dir) =>
Effect.gen(function* () {
const filepath = path.join(dir, "empty.txt")
yield* run({ filePath: filepath, content: "" })
it.instance("writes empty content", () =>
Effect.gen(function* () {
const test = yield* TestInstance
const filepath = path.join(test.directory, "empty.txt")
yield* run({ filePath: filepath, content: "" })
const content = yield* Effect.promise(() => fs.readFile(filepath, "utf-8"))
expect(content).toBe("")
const content = yield* Effect.promise(() => fs.readFile(filepath, "utf-8"))
expect(content).toBe("")
const stats = yield* Effect.promise(() => fs.stat(filepath))
expect(stats.size).toBe(0)
}),
),
const stats = yield* Effect.promise(() => fs.stat(filepath))
expect(stats.size).toBe(0)
}),
)
it.live("writes multi-line content", () =>
provideTmpdirInstance((dir) =>
Effect.gen(function* () {
const filepath = path.join(dir, "multiline.txt")
const lines = ["Line 1", "Line 2", "Line 3", ""].join("\n")
yield* run({ filePath: filepath, content: lines })
it.instance("writes multi-line content", () =>
Effect.gen(function* () {
const test = yield* TestInstance
const filepath = path.join(test.directory, "multiline.txt")
const lines = ["Line 1", "Line 2", "Line 3", ""].join("\n")
yield* run({ filePath: filepath, content: lines })
const content = yield* Effect.promise(() => fs.readFile(filepath, "utf-8"))
expect(content).toBe(lines)
}),
),
const content = yield* Effect.promise(() => fs.readFile(filepath, "utf-8"))
expect(content).toBe(lines)
}),
)
it.live("handles different line endings", () =>
provideTmpdirInstance((dir) =>
Effect.gen(function* () {
const filepath = path.join(dir, "crlf.txt")
const content = "Line 1\r\nLine 2\r\nLine 3"
yield* run({ filePath: filepath, content })
it.instance("handles different line endings", () =>
Effect.gen(function* () {
const test = yield* TestInstance
const filepath = path.join(test.directory, "crlf.txt")
const content = "Line 1\r\nLine 2\r\nLine 3"
yield* run({ filePath: filepath, content })
const buf = yield* Effect.promise(() => fs.readFile(filepath))
expect(buf.toString()).toBe(content)
}),
),
const buf = yield* Effect.promise(() => fs.readFile(filepath))
expect(buf.toString()).toBe(content)
}),
)
})
describe("error handling", () => {
it.live("throws error when OS denies write access", () =>
provideTmpdirInstance((dir) =>
Effect.gen(function* () {
const readonlyPath = path.join(dir, "readonly.txt")
yield* Effect.promise(() => fs.writeFile(readonlyPath, "test", "utf-8"))
yield* Effect.promise(() => fs.chmod(readonlyPath, 0o444))
const exit = yield* run({ filePath: readonlyPath, content: "new content" }).pipe(Effect.exit)
expect(exit._tag).toBe("Failure")
}),
),
it.instance("throws error when OS denies write access", () =>
Effect.gen(function* () {
const test = yield* TestInstance
const readonlyPath = path.join(test.directory, "readonly.txt")
yield* Effect.promise(() => fs.writeFile(readonlyPath, "test", "utf-8"))
yield* Effect.promise(() => fs.chmod(readonlyPath, 0o444))
const exit = yield* run({ filePath: readonlyPath, content: "new content" }).pipe(Effect.exit)
expect(exit._tag).toBe("Failure")
}),
)
})
describe("title generation", () => {
it.live("returns relative path as title", () =>
provideTmpdirInstance((dir) =>
Effect.gen(function* () {
const filepath = path.join(dir, "src", "components", "Button.tsx")
yield* Effect.promise(() => fs.mkdir(path.dirname(filepath), { recursive: true }))
it.instance("returns relative path as title", () =>
Effect.gen(function* () {
const test = yield* TestInstance
const filepath = path.join(test.directory, "src", "components", "Button.tsx")
yield* Effect.promise(() => fs.mkdir(path.dirname(filepath), { recursive: true }))
const result = yield* run({ filePath: filepath, content: "export const Button = () => {}" })
expect(result.title).toEndWith(path.join("src", "components", "Button.tsx"))
}),
),
const result = yield* run({ filePath: filepath, content: "export const Button = () => {}" })
expect(result.title).toEndWith(path.join("src", "components", "Button.tsx"))
}),
)
})
})

View File

@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@opencode-ai/plugin",
"version": "1.14.31",
"version": "1.14.33",
"type": "module",
"license": "MIT",
"scripts": {

View File

@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@opencode-ai/sdk",
"version": "1.14.31",
"version": "1.14.33",
"type": "module",
"license": "MIT",
"scripts": {

View File

@@ -33,6 +33,13 @@ export type EventProjectUpdated = {
properties: Project
}
export type EventServerInstanceDisposed = {
type: "server.instance.disposed"
properties: {
directory: string
}
}
export type EventServerConnected = {
type: "server.connected"
properties: {
@@ -47,10 +54,18 @@ export type EventGlobalDisposed = {
}
}
export type EventServerInstanceDisposed = {
type: "server.instance.disposed"
export type EventFileEdited = {
type: "file.edited"
properties: {
directory: string
file: string
}
}
export type EventFileWatcherUpdated = {
type: "file.watcher.updated"
properties: {
file: string
event: "add" | "change" | "unlink"
}
}
@@ -215,53 +230,6 @@ export type EventInstallationUpdateAvailable = {
}
}
export type EventWorkspaceReady = {
type: "workspace.ready"
properties: {
name: string
}
}
export type EventWorkspaceFailed = {
type: "workspace.failed"
properties: {
message: string
}
}
export type EventWorkspaceRestore = {
type: "workspace.restore"
properties: {
workspaceID: string
sessionID: string
total: number
step: number
}
}
export type EventWorkspaceStatus = {
type: "workspace.status"
properties: {
workspaceID: string
status: "connected" | "connecting" | "disconnected" | "error"
}
}
export type EventFileEdited = {
type: "file.edited"
properties: {
file: string
}
}
export type EventFileWatcherUpdated = {
type: "file.watcher.updated"
properties: {
file: string
event: "add" | "change" | "unlink"
}
}
export type QuestionOption = {
/**
* Display text (1-5 words, concise)
@@ -484,6 +452,38 @@ export type EventVcsBranchUpdated = {
}
}
export type EventWorkspaceReady = {
type: "workspace.ready"
properties: {
name: string
}
}
export type EventWorkspaceFailed = {
type: "workspace.failed"
properties: {
message: string
}
}
export type EventWorkspaceRestore = {
type: "workspace.restore"
properties: {
workspaceID: string
sessionID: string
total: number
step: number
}
}
export type EventWorkspaceStatus = {
type: "workspace.status"
properties: {
workspaceID: string
status: "connected" | "connecting" | "disconnected" | "error"
}
}
export type EventWorktreeReady = {
type: "worktree.ready"
properties: {
@@ -1112,9 +1112,11 @@ export type GlobalEvent = {
workspace?: string
payload:
| EventProjectUpdated
| EventServerInstanceDisposed
| EventServerConnected
| EventGlobalDisposed
| EventServerInstanceDisposed
| EventFileEdited
| EventFileWatcherUpdated
| EventLspClientDiagnostics
| EventLspUpdated
| EventMessagePartDelta
@@ -1124,12 +1126,6 @@ export type GlobalEvent = {
| EventSessionError
| EventInstallationUpdated
| EventInstallationUpdateAvailable
| EventWorkspaceReady
| EventWorkspaceFailed
| EventWorkspaceRestore
| EventWorkspaceStatus
| EventFileEdited
| EventFileWatcherUpdated
| EventQuestionAsked
| EventQuestionReplied
| EventQuestionRejected
@@ -1145,6 +1141,10 @@ export type GlobalEvent = {
| EventMcpBrowserOpenFailed
| EventCommandExecuted
| EventVcsBranchUpdated
| EventWorkspaceReady
| EventWorkspaceFailed
| EventWorkspaceRestore
| EventWorkspaceStatus
| EventWorktreeReady
| EventWorktreeFailed
| EventPtyCreated
@@ -2055,9 +2055,11 @@ export type File = {
export type Event =
| EventProjectUpdated
| EventServerInstanceDisposed
| EventServerConnected
| EventGlobalDisposed
| EventServerInstanceDisposed
| EventFileEdited
| EventFileWatcherUpdated
| EventLspClientDiagnostics
| EventLspUpdated
| EventMessagePartDelta
@@ -2067,12 +2069,6 @@ export type Event =
| EventSessionError
| EventInstallationUpdated
| EventInstallationUpdateAvailable
| EventWorkspaceReady
| EventWorkspaceFailed
| EventWorkspaceRestore
| EventWorkspaceStatus
| EventFileEdited
| EventFileWatcherUpdated
| EventQuestionAsked
| EventQuestionReplied
| EventQuestionRejected
@@ -2088,6 +2084,10 @@ export type Event =
| EventMcpBrowserOpenFailed
| EventCommandExecuted
| EventVcsBranchUpdated
| EventWorkspaceReady
| EventWorkspaceFailed
| EventWorkspaceRestore
| EventWorkspaceStatus
| EventWorktreeReady
| EventWorktreeFailed
| EventPtyCreated

View File

@@ -7674,6 +7674,25 @@
},
"required": ["type", "properties"]
},
"Event.server.instance.disposed": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "server.instance.disposed"
},
"properties": {
"type": "object",
"properties": {
"directory": {
"type": "string"
}
},
"required": ["directory"]
}
},
"required": ["type", "properties"]
},
"Event.server.connected": {
"type": "object",
"properties": {
@@ -7702,21 +7721,44 @@
},
"required": ["type", "properties"]
},
"Event.server.instance.disposed": {
"Event.file.edited": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "server.instance.disposed"
"const": "file.edited"
},
"properties": {
"type": "object",
"properties": {
"directory": {
"file": {
"type": "string"
}
},
"required": ["directory"]
"required": ["file"]
}
},
"required": ["type", "properties"]
},
"Event.file.watcher.updated": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "file.watcher.updated"
},
"properties": {
"type": "object",
"properties": {
"file": {
"type": "string"
},
"event": {
"type": "string",
"enum": ["add", "change", "unlink"]
}
},
"required": ["file", "event"]
}
},
"required": ["type", "properties"]
@@ -8183,144 +8225,6 @@
},
"required": ["type", "properties"]
},
"Event.workspace.ready": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "workspace.ready"
},
"properties": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
},
"required": ["name"]
}
},
"required": ["type", "properties"]
},
"Event.workspace.failed": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "workspace.failed"
},
"properties": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
},
"required": ["message"]
}
},
"required": ["type", "properties"]
},
"Event.workspace.restore": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "workspace.restore"
},
"properties": {
"type": "object",
"properties": {
"workspaceID": {
"type": "string",
"pattern": "^wrk.*"
},
"sessionID": {
"type": "string",
"pattern": "^ses.*"
},
"total": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"step": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": ["workspaceID", "sessionID", "total", "step"]
}
},
"required": ["type", "properties"]
},
"Event.workspace.status": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "workspace.status"
},
"properties": {
"type": "object",
"properties": {
"workspaceID": {
"type": "string",
"pattern": "^wrk.*"
},
"status": {
"type": "string",
"enum": ["connected", "connecting", "disconnected", "error"]
}
},
"required": ["workspaceID", "status"]
}
},
"required": ["type", "properties"]
},
"Event.file.edited": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "file.edited"
},
"properties": {
"type": "object",
"properties": {
"file": {
"type": "string"
}
},
"required": ["file"]
}
},
"required": ["type", "properties"]
},
"Event.file.watcher.updated": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "file.watcher.updated"
},
"properties": {
"type": "object",
"properties": {
"file": {
"type": "string"
},
"event": {
"type": "string",
"enum": ["add", "change", "unlink"]
}
},
"required": ["file", "event"]
}
},
"required": ["type", "properties"]
},
"QuestionOption": {
"type": "object",
"properties": {
@@ -8839,6 +8743,102 @@
},
"required": ["type", "properties"]
},
"Event.workspace.ready": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "workspace.ready"
},
"properties": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
},
"required": ["name"]
}
},
"required": ["type", "properties"]
},
"Event.workspace.failed": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "workspace.failed"
},
"properties": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
},
"required": ["message"]
}
},
"required": ["type", "properties"]
},
"Event.workspace.restore": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "workspace.restore"
},
"properties": {
"type": "object",
"properties": {
"workspaceID": {
"type": "string",
"pattern": "^wrk.*"
},
"sessionID": {
"type": "string",
"pattern": "^ses.*"
},
"total": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"step": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": ["workspaceID", "sessionID", "total", "step"]
}
},
"required": ["type", "properties"]
},
"Event.workspace.status": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "workspace.status"
},
"properties": {
"type": "object",
"properties": {
"workspaceID": {
"type": "string",
"pattern": "^wrk.*"
},
"status": {
"type": "string",
"enum": ["connected", "connecting", "disconnected", "error"]
}
},
"required": ["workspaceID", "status"]
}
},
"required": ["type", "properties"]
},
"Event.worktree.ready": {
"type": "object",
"properties": {
@@ -10960,6 +10960,9 @@
{
"$ref": "#/components/schemas/Event.project.updated"
},
{
"$ref": "#/components/schemas/Event.server.instance.disposed"
},
{
"$ref": "#/components/schemas/Event.server.connected"
},
@@ -10967,7 +10970,10 @@
"$ref": "#/components/schemas/Event.global.disposed"
},
{
"$ref": "#/components/schemas/Event.server.instance.disposed"
"$ref": "#/components/schemas/Event.file.edited"
},
{
"$ref": "#/components/schemas/Event.file.watcher.updated"
},
{
"$ref": "#/components/schemas/Event.lsp.client.diagnostics"
@@ -10996,24 +11002,6 @@
{
"$ref": "#/components/schemas/Event.installation.update-available"
},
{
"$ref": "#/components/schemas/Event.workspace.ready"
},
{
"$ref": "#/components/schemas/Event.workspace.failed"
},
{
"$ref": "#/components/schemas/Event.workspace.restore"
},
{
"$ref": "#/components/schemas/Event.workspace.status"
},
{
"$ref": "#/components/schemas/Event.file.edited"
},
{
"$ref": "#/components/schemas/Event.file.watcher.updated"
},
{
"$ref": "#/components/schemas/Event.question.asked"
},
@@ -11059,6 +11047,18 @@
{
"$ref": "#/components/schemas/Event.vcs.branch.updated"
},
{
"$ref": "#/components/schemas/Event.workspace.ready"
},
{
"$ref": "#/components/schemas/Event.workspace.failed"
},
{
"$ref": "#/components/schemas/Event.workspace.restore"
},
{
"$ref": "#/components/schemas/Event.workspace.status"
},
{
"$ref": "#/components/schemas/Event.worktree.ready"
},
@@ -13253,6 +13253,9 @@
{
"$ref": "#/components/schemas/Event.project.updated"
},
{
"$ref": "#/components/schemas/Event.server.instance.disposed"
},
{
"$ref": "#/components/schemas/Event.server.connected"
},
@@ -13260,7 +13263,10 @@
"$ref": "#/components/schemas/Event.global.disposed"
},
{
"$ref": "#/components/schemas/Event.server.instance.disposed"
"$ref": "#/components/schemas/Event.file.edited"
},
{
"$ref": "#/components/schemas/Event.file.watcher.updated"
},
{
"$ref": "#/components/schemas/Event.lsp.client.diagnostics"
@@ -13289,24 +13295,6 @@
{
"$ref": "#/components/schemas/Event.installation.update-available"
},
{
"$ref": "#/components/schemas/Event.workspace.ready"
},
{
"$ref": "#/components/schemas/Event.workspace.failed"
},
{
"$ref": "#/components/schemas/Event.workspace.restore"
},
{
"$ref": "#/components/schemas/Event.workspace.status"
},
{
"$ref": "#/components/schemas/Event.file.edited"
},
{
"$ref": "#/components/schemas/Event.file.watcher.updated"
},
{
"$ref": "#/components/schemas/Event.question.asked"
},
@@ -13352,6 +13340,18 @@
{
"$ref": "#/components/schemas/Event.vcs.branch.updated"
},
{
"$ref": "#/components/schemas/Event.workspace.ready"
},
{
"$ref": "#/components/schemas/Event.workspace.failed"
},
{
"$ref": "#/components/schemas/Event.workspace.restore"
},
{
"$ref": "#/components/schemas/Event.workspace.status"
},
{
"$ref": "#/components/schemas/Event.worktree.ready"
},

View File

@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/slack",
"version": "1.14.31",
"version": "1.14.33",
"type": "module",
"license": "MIT",
"scripts": {

View File

@@ -1,6 +1,6 @@
{
"name": "@opencode-ai/ui",
"version": "1.14.31",
"version": "1.14.33",
"type": "module",
"license": "MIT",
"exports": {

View File

@@ -2,7 +2,7 @@
"name": "@opencode-ai/web",
"type": "module",
"license": "MIT",
"version": "1.14.31",
"version": "1.14.33",
"scripts": {
"dev": "astro dev",
"dev:remote": "VITE_API_URL=https://api.opencode.ai astro dev",

View File

@@ -29,16 +29,16 @@ opencode [project]
#### الخيارات
| الخيار | المختصر | الوصف |
| ------------ | ------- | ----------------------------------------------------------------- |
| `--continue` | `-c` | متابعة الجلسة الأخيرة |
| `--session` | `-s` | معرّف الجلسة للمتابعة |
| `--fork` | | تفريع الجلسة عند المتابعة (يستخدم مع `--continue` أو `--session`) |
| `--prompt` | | الموجّه المراد استخدامه |
| `--model` | `-m` | النموذج المراد استخدامه بصيغة provider/model |
| `--agent` | | الوكيل المراد استخدامه |
| `--port` | | المنفذ الذي يتم الاستماع عليه |
| `--hostname` | | اسم المضيف الذي يتم الاستماع عليه |
| الخيار | المختصر | الوصف |
| ---------------------------------------- | ------- | ----------------------------------------------------------------- |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | متابعة الجلسة الأخيرة |
| <nobr><code>{"--session"}</code></nobr> | `-s` | معرّف الجلسة للمتابعة |
| <nobr><code>{"--fork"}</code></nobr> | | تفريع الجلسة عند المتابعة (يستخدم مع `--continue` أو `--session`) |
| <nobr><code>{"--prompt"}</code></nobr> | | الموجّه المراد استخدامه |
| <nobr><code>{"--model"}</code></nobr> | `-m` | النموذج المراد استخدامه بصيغة provider/model |
| <nobr><code>{"--agent"}</code></nobr> | | الوكيل المراد استخدامه |
| <nobr><code>{"--port"}</code></nobr> | | المنفذ الذي يتم الاستماع عليه |
| <nobr><code>{"--hostname"}</code></nobr> | | اسم المضيف الذي يتم الاستماع عليه |
---
@@ -78,10 +78,14 @@ opencode attach http://10.20.30.40:4096
#### الرايات
| الراية | المختصر | الوصف |
| ----------- | ------- | ----------------------------------- |
| `--dir` | | دليل العمل الذي ستبدأ منه واجهة TUI |
| `--session` | `-s` | معرّف الجلسة للمتابعة |
| الراية | المختصر | الوصف |
| ---------------------------------------- | ------- | --------------------------------------------------------------------------------- |
| <nobr><code>{"--dir"}</code></nobr> | | دليل العمل الذي ستبدأ منه واجهة TUI |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | متابعة آخر جلسة |
| <nobr><code>{"--session"}</code></nobr> | `-s` | معرّف الجلسة للمتابعة |
| <nobr><code>{"--fork"}</code></nobr> | | تفريع الجلسة عند المتابعة (استخدمه مع `--continue` أو `--session`) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | كلمة مرور المصادقة الأساسية (الافتراضي `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | اسم مستخدم المصادقة الأساسية (الافتراضي `OPENCODE_SERVER_USERNAME` أو `opencode`) |
---
@@ -187,10 +191,10 @@ opencode github run
##### الرايات
| الراية | الوصف |
| --------- | ------------------------------------ |
| `--event` | حدث GitHub مُحاكى لتشغيل الوكيل عليه |
| `--token` | رمز وصول شخصي لـ GitHub |
| الراية | الوصف |
| ------------------------------------- | ------------------------------------ |
| <nobr><code>{"--event"}</code></nobr> | حدث GitHub مُحاكى لتشغيل الوكيل عليه |
| <nobr><code>{"--token"}</code></nobr> | رمز وصول شخصي لـ GitHub |
---
@@ -296,10 +300,10 @@ opencode models anthropic
#### الرايات
| الراية | الوصف |
| ----------- | ------------------------------------------------------------- |
| `--refresh` | تحديث ذاكرة التخزين المؤقت للنماذج من models.dev |
| `--verbose` | استخدام مخرجات أكثر تفصيلا للنماذج (تشمل بيانات مثل التكاليف) |
| الراية | الوصف |
| --------------------------------------- | ------------------------------------------------------------- |
| <nobr><code>{"--refresh"}</code></nobr> | تحديث ذاكرة التخزين المؤقت للنماذج من models.dev |
| <nobr><code>{"--verbose"}</code></nobr> | استخدام مخرجات أكثر تفصيلا للنماذج (تشمل بيانات مثل التكاليف) |
استخدم الراية `--refresh` لتحديث قائمة النماذج المخزنة مؤقتا. يفيد ذلك عند إضافة نماذج جديدة إلى مزود وتريد رؤيتها في OpenCode.
@@ -335,20 +339,25 @@ opencode run --attach http://localhost:4096 "Explain async/await in JavaScript"
#### الرايات
| الراية | المختصر | الوصف |
| ------------ | ------- | ----------------------------------------------------------------- |
| `--command` | | الأمر المراد تشغيله؛ استخدم الرسالة كوسائط |
| `--continue` | `-c` | متابعة الجلسة الأخيرة |
| `--session` | `-s` | معرّف الجلسة للمتابعة |
| `--fork` | | تفريع الجلسة عند المتابعة (يستخدم مع `--continue` أو `--session`) |
| `--share` | | مشاركة الجلسة |
| `--model` | `-m` | النموذج المراد استخدامه بصيغة provider/model |
| `--agent` | | الوكيل المراد استخدامه |
| `--file` | `-f` | ملف/ملفات لإرفاقها بالرسالة |
| `--format` | | التنسيق: default (منسق) أو json (أحداث JSON خام) |
| `--title` | | عنوان للجلسة (يستخدم موجهًا مقتطعًا إن لم تُحدَّد قيمة) |
| `--attach` | | الإرفاق بخادم opencode قيد التشغيل (مثل http://localhost:4096) |
| `--port` | | منفذ الخادم المحلي (الافتراضي منفذ عشوائي) |
| الراية | المختصر | الوصف |
| ---------------------------------------- | ------- | --------------------------------------------------------------------------------- |
| <nobr><code>{"--command"}</code></nobr> | | الأمر المراد تشغيله؛ استخدم الرسالة كوسائط |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | متابعة الجلسة الأخيرة |
| <nobr><code>{"--session"}</code></nobr> | `-s` | معرّف الجلسة للمتابعة |
| <nobr><code>{"--fork"}</code></nobr> | | تفريع الجلسة عند المتابعة (يستخدم مع `--continue` أو `--session`) |
| <nobr><code>{"--share"}</code></nobr> | | مشاركة الجلسة |
| <nobr><code>{"--model"}</code></nobr> | `-m` | النموذج المراد استخدامه بصيغة provider/model |
| <nobr><code>{"--agent"}</code></nobr> | | الوكيل المراد استخدامه |
| <nobr><code>{"--file"}</code></nobr> | `-f` | ملف/ملفات لإرفاقها بالرسالة |
| <nobr><code>{"--format"}</code></nobr> | | التنسيق: default (منسق) أو json (أحداث JSON خام) |
| <nobr><code>{"--title"}</code></nobr> | | عنوان للجلسة (يستخدم موجهًا مقتطعًا إن لم تُحدَّد قيمة) |
| <nobr><code>{"--attach"}</code></nobr> | | الإرفاق بخادم opencode قيد التشغيل (مثل http://localhost:4096) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | كلمة مرور المصادقة الأساسية (الافتراضي `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | اسم مستخدم المصادقة الأساسية (الافتراضي `OPENCODE_SERVER_USERNAME` أو `opencode`) |
| <nobr><code>{"--dir"}</code></nobr> | | دليل التشغيل، أو المسار على الخادم البعيد عند الإرفاق |
| <nobr><code>{"--variant"}</code></nobr> | | متغير النموذج (جهد الاستدلال الخاص بالمزود) |
| <nobr><code>{"--thinking"}</code></nobr> | | عرض كتل التفكير |
| <nobr><code>{"--port"}</code></nobr> | | منفذ الخادم المحلي (الافتراضي منفذ عشوائي) |
---
@@ -364,12 +373,12 @@ opencode serve
#### الرايات
| الراية | الوصف |
| ------------ | ----------------------------------------- |
| `--port` | المنفذ الذي يتم الاستماع عليه |
| `--hostname` | اسم المضيف الذي يتم الاستماع عليه |
| `--mdns` | تفعيل اكتشاف mDNS |
| `--cors` | أصول/منشأات إضافية للمتصفح للسماح بـ CORS |
| الراية | الوصف |
| ---------------------------------------- | ----------------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | المنفذ الذي يتم الاستماع عليه |
| <nobr><code>{"--hostname"}</code></nobr> | اسم المضيف الذي يتم الاستماع عليه |
| <nobr><code>{"--mdns"}</code></nobr> | تفعيل اكتشاف mDNS |
| <nobr><code>{"--cors"}</code></nobr> | أصول/منشأات إضافية للمتصفح للسماح بـ CORS |
---
@@ -393,10 +402,10 @@ opencode session list
##### الرايات
| الراية | المختصر | الوصف |
| ------------- | ------- | ------------------------------------- |
| `--max-count` | `-n` | حصر النتائج في أحدث N جلسات |
| `--format` | | تنسيق المخرجات: table أو json (table) |
| الراية | المختصر | الوصف |
| ----------------------------------------- | ------- | ------------------------------------- |
| <nobr><code>{"--max-count"}</code></nobr> | `-n` | حصر النتائج في أحدث N جلسات |
| <nobr><code>{"--format"}</code></nobr> | | تنسيق المخرجات: table أو json (table) |
---
@@ -410,12 +419,12 @@ opencode stats
#### الرايات
| الراية | الوصف |
| ----------- | ------------------------------------------------------------------------- |
| `--days` | عرض الإحصاءات لآخر N يومًا (الافتراضي: كل الوقت) |
| `--tools` | عدد الأدوات المطلوب عرضها (الافتراضي: الكل) |
| `--models` | عرض تفصيل استخدام النماذج (مخفي افتراضيا). مرّر رقمًا لعرض أعلى N |
| `--project` | التصفية حسب المشروع (الافتراضي: كل المشاريع، سلسلة فارغة: المشروع الحالي) |
| الراية | الوصف |
| --------------------------------------- | ------------------------------------------------------------------------- |
| <nobr><code>{"--days"}</code></nobr> | عرض الإحصاءات لآخر N يومًا (الافتراضي: كل الوقت) |
| <nobr><code>{"--tools"}</code></nobr> | عدد الأدوات المطلوب عرضها (الافتراضي: الكل) |
| <nobr><code>{"--models"}</code></nobr> | عرض تفصيل استخدام النماذج (مخفي افتراضيا). مرّر رقمًا لعرض أعلى N |
| <nobr><code>{"--project"}</code></nobr> | التصفية حسب المشروع (الافتراضي: كل المشاريع، سلسلة فارغة: المشروع الحالي) |
---
@@ -460,12 +469,12 @@ opencode web
#### الرايات
| الراية | الوصف |
| ------------ | ----------------------------------------- |
| `--port` | المنفذ الذي يتم الاستماع عليه |
| `--hostname` | اسم المضيف الذي يتم الاستماع عليه |
| `--mdns` | تفعيل اكتشاف mDNS |
| `--cors` | أصول/منشأات إضافية للمتصفح للسماح بـ CORS |
| الراية | الوصف |
| ---------------------------------------- | ----------------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | المنفذ الذي يتم الاستماع عليه |
| <nobr><code>{"--hostname"}</code></nobr> | اسم المضيف الذي يتم الاستماع عليه |
| <nobr><code>{"--mdns"}</code></nobr> | تفعيل اكتشاف mDNS |
| <nobr><code>{"--cors"}</code></nobr> | أصول/منشأات إضافية للمتصفح للسماح بـ CORS |
---
@@ -481,11 +490,11 @@ opencode acp
#### الرايات
| الراية | الوصف |
| ------------ | --------------------------------- |
| `--cwd` | دليل العمل |
| `--port` | المنفذ الذي يتم الاستماع عليه |
| `--hostname` | اسم المضيف الذي يتم الاستماع عليه |
| الراية | الوصف |
| ---------------------------------------- | --------------------------------- |
| <nobr><code>{"--cwd"}</code></nobr> | دليل العمل |
| <nobr><code>{"--port"}</code></nobr> | المنفذ الذي يتم الاستماع عليه |
| <nobr><code>{"--hostname"}</code></nobr> | اسم المضيف الذي يتم الاستماع عليه |
---
@@ -499,12 +508,12 @@ opencode uninstall
#### الرايات
| الراية | المختصر | الوصف |
| --------------- | ------- | ----------------------------------- |
| `--keep-config` | `-c` | الإبقاء على ملفات التهيئة |
| `--keep-data` | `-d` | الإبقاء على بيانات الجلسات واللقطات |
| `--dry-run` | | عرض ما سيتم حذفه دون تنفيذ الحذف |
| `--force` | `-f` | تخطي مطالبات التأكيد |
| الراية | المختصر | الوصف |
| ------------------------------------------- | ------- | ----------------------------------- |
| <nobr><code>{"--keep-config"}</code></nobr> | `-c` | الإبقاء على ملفات التهيئة |
| <nobr><code>{"--keep-data"}</code></nobr> | `-d` | الإبقاء على بيانات الجلسات واللقطات |
| <nobr><code>{"--dry-run"}</code></nobr> | | عرض ما سيتم حذفه دون تنفيذ الحذف |
| <nobr><code>{"--force"}</code></nobr> | `-f` | تخطي مطالبات التأكيد |
---
@@ -530,9 +539,9 @@ opencode upgrade v0.1.48
#### الرايات
| الراية | المختصر | الوصف |
| ---------- | ------- | ----------------------------------------------------------- |
| `--method` | `-m` | طريقة التثبيت المستخدمة: curl أو npm أو pnpm أو bun أو brew |
| الراية | المختصر | الوصف |
| -------------------------------------- | ------- | ----------------------------------------------------------- |
| <nobr><code>{"--method"}</code></nobr> | `-m` | طريقة التثبيت المستخدمة: curl أو npm أو pnpm أو bun أو brew |
---
@@ -540,12 +549,12 @@ opencode upgrade v0.1.48
يدعم سطر أوامر opencode الخيارات العامة التالية.
| الراية | المختصر | الوصف |
| -------------- | ------- | -------------------------------------- |
| `--help` | `-h` | عرض المساعدة |
| `--version` | `-v` | طباعة رقم الإصدار |
| `--print-logs` | | طباعة السجلات إلى stderr |
| `--log-level` | | مستوى السجل (DEBUG, INFO, WARN, ERROR) |
| الراية | المختصر | الوصف |
| ------------------------------------------ | ------- | -------------------------------------- |
| <nobr><code>{"--help"}</code></nobr> | `-h` | عرض المساعدة |
| <nobr><code>{"--version"}</code></nobr> | `-v` | طباعة رقم الإصدار |
| <nobr><code>{"--print-logs"}</code></nobr> | | طباعة السجلات إلى stderr |
| <nobr><code>{"--log-level"}</code></nobr> | | مستوى السجل (DEBUG, INFO, WARN, ERROR) |
---

View File

@@ -29,16 +29,16 @@ opencode [project]
#### Opcije
| Opcija | Kratko | Opis |
| ------------ | ------ | ------------------------------------------------------------------------ |
| `--continue` | `-c` | Nastavite posljednju sesiju |
| `--session` | `-s` | ID sesije za nastavak |
| `--fork` | | Forkujte sesiju pri nastavku (koristiti sa `--continue` ili `--session`) |
| `--prompt` | | Prompt za upotrebu |
| `--model` | `-m` | Model za korištenje u obliku provider/model |
| `--agent` | | Agent za korištenje |
| `--port` | | Port na kojem treba slušati |
| `--hostname` | | Hostname na kojem treba slušati |
| Opcija | Kratko | Opis |
| ---------------------------------------- | ------ | ------------------------------------------------------------------------ |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Nastavite posljednju sesiju |
| <nobr><code>{"--session"}</code></nobr> | `-s` | ID sesije za nastavak |
| <nobr><code>{"--fork"}</code></nobr> | | Forkujte sesiju pri nastavku (koristiti sa `--continue` ili `--session`) |
| <nobr><code>{"--prompt"}</code></nobr> | | Prompt za upotrebu |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Model za korištenje u obliku provider/model |
| <nobr><code>{"--agent"}</code></nobr> | | Agent za korištenje |
| <nobr><code>{"--port"}</code></nobr> | | Port na kojem treba slušati |
| <nobr><code>{"--hostname"}</code></nobr> | | Hostname na kojem treba slušati |
---
@@ -78,10 +78,14 @@ opencode attach http://10.20.30.40:4096
#### Opcije
| Opcija | Kratko | Opis |
| ----------- | ------ | ------------------------------------ |
| `--dir` | | Radni direktorij za pokretanje TUI-a |
| `--session` | `-s` | ID sesije za nastavak |
| Opcija | Kratko | Opis |
| ---------------------------------------- | ------ | --------------------------------------------------------------------------------------------- |
| <nobr><code>{"--dir"}</code></nobr> | | Radni direktorij za pokretanje TUI-a |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Nastavi posljednju sesiju |
| <nobr><code>{"--session"}</code></nobr> | `-s` | ID sesije za nastavak |
| <nobr><code>{"--fork"}</code></nobr> | | Forkuj sesiju prilikom nastavka (koristite sa `--continue` ili `--session`) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Lozinka za osnovnu autentifikaciju (zadano: `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Korisničko ime za osnovnu autentifikaciju (zadano: `OPENCODE_SERVER_USERNAME` ili `opencode`) |
---
@@ -187,10 +191,10 @@ opencode github run
##### Opcije
| Opcija | Opis |
| --------- | -------------------------------------- |
| `--event` | GitHub mock event za pokretanje agenta |
| `--token` | GitHub Personal Access Token |
| Opcija | Opis |
| ------------------------------------- | -------------------------------------- |
| <nobr><code>{"--event"}</code></nobr> | GitHub mock event za pokretanje agenta |
| <nobr><code>{"--token"}</code></nobr> | GitHub Personal Access Token |
---
@@ -293,10 +297,10 @@ opencode models anthropic
#### Opcije
| Opcija | Opis |
| ----------- | ------------------------------------------------------------------------ |
| `--refresh` | Osvježite keš modela sa models.dev |
| `--verbose` | Koristite detaljniji izlaz modela (uključuje metapodatke poput troškova) |
| Opcija | Opis |
| --------------------------------------- | ------------------------------------------------------------------------ |
| <nobr><code>{"--refresh"}</code></nobr> | Osvježite keš modela sa models.dev |
| <nobr><code>{"--verbose"}</code></nobr> | Koristite detaljniji izlaz modela (uključuje metapodatke poput troškova) |
Koristite `--refresh` zastavicu da ažurirate keširanu listu modela. Ovo je korisno kada su novi modeli dodani provajderu i želite da ih vidite u OpenCode.
@@ -332,20 +336,25 @@ opencode run --attach http://localhost:4096 "Explain async/await in JavaScript"
#### Opcije
| Opcija | Kratko | Opis |
| ------------ | ------ | ------------------------------------------------------------------------ |
| `--command` | | Naredba za pokretanje, koristite poruku za argumente |
| `--continue` | `-c` | Nastavite posljednju sesiju |
| `--session` | `-s` | ID sesije za nastavak |
| `--fork` | | Forkujte sesiju pri nastavku (koristiti sa `--continue` ili `--session`) |
| `--share` | | Podijelite sesiju |
| `--model` | `-m` | Model za korištenje u obliku provider/model |
| `--agent` | | Agent za korištenje |
| `--file` | `-f` | Fajlovi koje treba priložiti poruci |
| `--format` | | Format: default (formatiran) ili json (sirovi JSON događaji) |
| `--title` | | Naslov sesije (koristi skraćeni prompt ako nije navedena vrijednost) |
| `--attach` | | Priključite na pokrenuti OpenCode server (npr. http://localhost:4096) |
| `--port` | | Port za lokalni server (zadano na nasumični port) |
| Opcija | Kratko | Opis |
| ---------------------------------------- | ------ | --------------------------------------------------------------------------------------------- |
| <nobr><code>{"--command"}</code></nobr> | | Naredba za pokretanje, koristite poruku za argumente |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Nastavite posljednju sesiju |
| <nobr><code>{"--session"}</code></nobr> | `-s` | ID sesije za nastavak |
| <nobr><code>{"--fork"}</code></nobr> | | Forkujte sesiju pri nastavku (koristiti sa `--continue` ili `--session`) |
| <nobr><code>{"--share"}</code></nobr> | | Podijelite sesiju |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Model za korištenje u obliku provider/model |
| <nobr><code>{"--agent"}</code></nobr> | | Agent za korištenje |
| <nobr><code>{"--file"}</code></nobr> | `-f` | Fajlovi koje treba priložiti poruci |
| <nobr><code>{"--format"}</code></nobr> | | Format: default (formatiran) ili json (sirovi JSON događaji) |
| <nobr><code>{"--title"}</code></nobr> | | Naslov sesije (koristi skraćeni prompt ako nije navedena vrijednost) |
| <nobr><code>{"--attach"}</code></nobr> | | Priključite na pokrenuti OpenCode server (npr. http://localhost:4096) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Lozinka za osnovnu autentifikaciju (zadano: `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Korisničko ime za osnovnu autentifikaciju (zadano: `OPENCODE_SERVER_USERNAME` ili `opencode`) |
| <nobr><code>{"--dir"}</code></nobr> | | Direktorij za pokretanje, ili putanja na udaljenom serveru pri spajanju |
| <nobr><code>{"--variant"}</code></nobr> | | Varijanta modela (napor zaključivanja specifičan za provajdera) |
| <nobr><code>{"--thinking"}</code></nobr> | | Prikaži blokove razmišljanja |
| <nobr><code>{"--port"}</code></nobr> | | Port za lokalni server (zadano na nasumični port) |
---
@@ -361,12 +370,12 @@ Ovo pokreće HTTP server koji pruža API pristup funkcionalnosti OpenCode-a bez
#### Opcije
| Opcija | Opis |
| ------------ | ----------------------------------------------------- |
| `--port` | Port na kojem treba slušati |
| `--hostname` | Hostname na kojem treba slušati |
| `--mdns` | Omogući mDNS otkrivanje |
| `--cors` | Dodatni origin(i) pretraživača koji dozvoljavaju CORS |
| Opcija | Opis |
| ---------------------------------------- | ----------------------------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | Port na kojem treba slušati |
| <nobr><code>{"--hostname"}</code></nobr> | Hostname na kojem treba slušati |
| <nobr><code>{"--mdns"}</code></nobr> | Omogući mDNS otkrivanje |
| <nobr><code>{"--cors"}</code></nobr> | Dodatni origin(i) pretraživača koji dozvoljavaju CORS |
---
@@ -390,10 +399,10 @@ opencode session list
##### Opcije
| Opcija | Kratko | Opis |
| ------------- | ------ | -------------------------------------- |
| `--max-count` | `-n` | Ograničenje na N najnovijih sesija |
| `--format` | | Izlazni format: table ili json (table) |
| Opcija | Kratko | Opis |
| ----------------------------------------- | ------ | -------------------------------------- |
| <nobr><code>{"--max-count"}</code></nobr> | `-n` | Ograničenje na N najnovijih sesija |
| <nobr><code>{"--format"}</code></nobr> | | Izlazni format: table ili json (table) |
---
@@ -407,12 +416,12 @@ opencode stats
#### Opcije
| Opcija | Opis |
| ----------- | ---------------------------------------------------------------------------------------------------------- |
| `--days` | Prikaži statistiku za zadnjih N dana (sva vremena) |
| `--tools` | Broj alata za prikaz (svi) |
| `--models` | Prikaži raščlambu korištenja modela (skriveno prema zadanim postavkama). Proslijedite broj za prikaz top N |
| `--project` | Filtriraj po projektu (svi projekti, prazan niz: trenutni projekt) |
| Opcija | Opis |
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| <nobr><code>{"--days"}</code></nobr> | Prikaži statistiku za zadnjih N dana (sva vremena) |
| <nobr><code>{"--tools"}</code></nobr> | Broj alata za prikaz (svi) |
| <nobr><code>{"--models"}</code></nobr> | Prikaži raščlambu korištenja modela (skriveno prema zadanim postavkama). Proslijedite broj za prikaz top N |
| <nobr><code>{"--project"}</code></nobr> | Filtriraj po projektu (svi projekti, prazan niz: trenutni projekt) |
---
@@ -457,12 +466,12 @@ Ovo pokreće HTTP server i otvara web pretraživač za pristup OpenCode-u preko
#### Opcije
| Opcija | Opis |
| ------------ | ----------------------------------------------------- |
| `--port` | Port na kojem treba slušati |
| `--hostname` | Hostname na kojem treba slušati |
| `--mdns` | Omogući mDNS otkrivanje |
| `--cors` | Dodatni origin(i) pretraživača koji dozvoljavaju CORS |
| Opcija | Opis |
| ---------------------------------------- | ----------------------------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | Port na kojem treba slušati |
| <nobr><code>{"--hostname"}</code></nobr> | Hostname na kojem treba slušati |
| <nobr><code>{"--mdns"}</code></nobr> | Omogući mDNS otkrivanje |
| <nobr><code>{"--cors"}</code></nobr> | Dodatni origin(i) pretraživača koji dozvoljavaju CORS |
---
@@ -478,11 +487,11 @@ Ova naredba pokreće ACP server koji komunicira preko stdin/stdout koristeći nd
#### Opcije
| Opcija | Opis |
| ------------ | --------------------------- |
| `--cwd` | Radni direktorij |
| `--port` | Port na kojem treba slušati |
| `--hostname` | Hostname na kojem slušati |
| Opcija | Opis |
| ---------------------------------------- | --------------------------- |
| <nobr><code>{"--cwd"}</code></nobr> | Radni direktorij |
| <nobr><code>{"--port"}</code></nobr> | Port na kojem treba slušati |
| <nobr><code>{"--hostname"}</code></nobr> | Hostname na kojem slušati |
---
@@ -496,12 +505,12 @@ opencode uninstall
#### Opcije
| Opcija | Kratko | Opis |
| --------------- | ------ | --------------------------------------------- |
| `--keep-config` | `-c` | Sačuvajte konfiguracijske datoteke |
| `--keep-data` | `-d` | Sačuvajte podatke i snimke sesije |
| `--dry-run` | | Pokažite šta bi bilo uklonjeno bez uklanjanja |
| `--force` | `-f` | Preskoči upite za potvrdu |
| Opcija | Kratko | Opis |
| ------------------------------------------- | ------ | --------------------------------------------- |
| <nobr><code>{"--keep-config"}</code></nobr> | `-c` | Sačuvajte konfiguracijske datoteke |
| <nobr><code>{"--keep-data"}</code></nobr> | `-d` | Sačuvajte podatke i snimke sesije |
| <nobr><code>{"--dry-run"}</code></nobr> | | Pokažite šta bi bilo uklonjeno bez uklanjanja |
| <nobr><code>{"--force"}</code></nobr> | `-f` | Preskoči upite za potvrdu |
---
@@ -527,9 +536,9 @@ opencode upgrade v0.1.48
#### Opcije
| Opcija | Kratko | Opis |
| ---------- | ------ | ------------------------------------------------------- |
| `--method` | `-m` | Korišteni način instalacije; curl, npm, pnpm, bun, brew |
| Opcija | Kratko | Opis |
| -------------------------------------- | ------ | ------------------------------------------------------- |
| <nobr><code>{"--method"}</code></nobr> | `-m` | Korišteni način instalacije; curl, npm, pnpm, bun, brew |
---
@@ -537,12 +546,12 @@ opencode upgrade v0.1.48
OpenCode CLI prihvata sljedeće globalne zastavice.
| Opcija | Kratko | Opis |
| -------------- | ------ | ----------------------------------------- |
| `--help` | `-h` | Prikaži pomoć |
| `--version` | `-v` | Ispiši broj verzije |
| `--print-logs` | | Ispis logova u stderr |
| `--log-level` | | Nivo logovanja (DEBUG, INFO, WARN, ERROR) |
| Opcija | Kratko | Opis |
| ------------------------------------------ | ------ | ----------------------------------------- |
| <nobr><code>{"--help"}</code></nobr> | `-h` | Prikaži pomoć |
| <nobr><code>{"--version"}</code></nobr> | `-v` | Ispiši broj verzije |
| <nobr><code>{"--print-logs"}</code></nobr> | | Ispis logova u stderr |
| <nobr><code>{"--log-level"}</code></nobr> | | Nivo logovanja (DEBUG, INFO, WARN, ERROR) |
---

View File

@@ -29,16 +29,19 @@ opencode [project]
#### Flags
| Flag | Short | Description |
| ------------ | ----- | ----------------------------------------------------------------------- |
| `--continue` | `-c` | Continue the last session |
| `--session` | `-s` | Session ID to continue |
| `--fork` | | Fork the session when continuing (use with `--continue` or `--session`) |
| `--prompt` | | Prompt to use |
| `--model` | `-m` | Model to use in the form of provider/model |
| `--agent` | | Agent to use |
| `--port` | | Port to listen on |
| `--hostname` | | Hostname to listen on |
| Flag | Short | Description |
| ------------------------------------------- | ----- | ----------------------------------------------------------------------- |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Continue the last session |
| <nobr><code>{"--session"}</code></nobr> | `-s` | Session ID to continue |
| <nobr><code>{"--fork"}</code></nobr> | | Fork the session when continuing (use with `--continue` or `--session`) |
| <nobr><code>{"--prompt"}</code></nobr> | | Prompt to use |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Model to use in the form of provider/model |
| <nobr><code>{"--agent"}</code></nobr> | | Agent to use |
| <nobr><code>{"--port"}</code></nobr> | | Port to listen on |
| <nobr><code>{"--hostname"}</code></nobr> | | Hostname to listen on |
| <nobr><code>{"--mdns"}</code></nobr> | | Enable mDNS discovery |
| <nobr><code>{"--mdns-domain"}</code></nobr> | | Custom mDNS domain name |
| <nobr><code>{"--cors"}</code></nobr> | | Additional browser origin(s) to allow CORS |
---
@@ -78,10 +81,14 @@ opencode attach http://10.20.30.40:4096
#### Flags
| Flag | Short | Description |
| ----------- | ----- | --------------------------------- |
| `--dir` | | Working directory to start TUI in |
| `--session` | `-s` | Session ID to continue |
| Flag | Short | Description |
| ---------------------------------------- | ----- | -------------------------------------------------------------------------- |
| <nobr><code>{"--dir"}</code></nobr> | | Working directory to start TUI in |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Continue the last session |
| <nobr><code>{"--session"}</code></nobr> | `-s` | Session ID to continue |
| <nobr><code>{"--fork"}</code></nobr> | | Fork the session when continuing (use with `--continue` or `--session`) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Basic auth password (defaults to `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Basic auth username (defaults to `OPENCODE_SERVER_USERNAME` or `opencode`) |
---
@@ -97,13 +104,13 @@ This command will guide you through creating a new agent with a custom system pr
#### Flags
| Flag | Description |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--path` | Directory to write the agent file to (defaults to global or `.opencode/agent` based on the prompt) |
| `--description` | What the agent should do |
| `--mode` | Agent mode: `all`, `primary`, or `subagent` |
| `--permissions` | Comma-separated list of permissions to allow (default: all). Available: `bash`, `read`, `edit`, `glob`, `grep`, `webfetch`, `task`, `todowrite`, `websearch`, `lsp`, `skill`. Anything omitted is denied. Alias: `--tools` |
| `--model`, `-m` | Model to use, in `provider/model` format |
| Flag | Short | Description |
| ------------------------------------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <nobr><code>{"--path"}</code></nobr> | | Directory to write the agent file to (defaults to global or `.opencode/agent` based on the prompt) |
| <nobr><code>{"--description"}</code></nobr> | | What the agent should do |
| <nobr><code>{"--mode"}</code></nobr> | | Agent mode: `all`, `primary`, or `subagent` |
| <nobr><code>{"--permissions"}</code></nobr> | | Comma-separated list of permissions to allow (default: all). Available: `bash`, `read`, `edit`, `glob`, `grep`, `webfetch`, `task`, `todowrite`, `websearch`, `lsp`, `skill`. Anything omitted is denied. Alias: `--tools` |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Model to use, in `provider/model` format |
Passing all of `--path`, `--description`, `--mode`, and `--permissions` runs the command non-interactively.
@@ -139,6 +146,13 @@ opencode auth login
When OpenCode starts up it loads the providers from the credentials file. And if there are any keys defined in your environments or a `.env` file in your project.
##### Flags
| Flag | Short | Description |
| ---------------------------------------- | ----- | ---------------------------------------------------- |
| <nobr><code>{"--provider"}</code></nobr> | `-p` | Provider ID or name to log in to |
| <nobr><code>{"--method"}</code></nobr> | `-m` | Login method label to use, skipping method selection |
---
#### list
@@ -199,10 +213,10 @@ opencode github run
##### Flags
| Flag | Description |
| --------- | -------------------------------------- |
| `--event` | GitHub mock event to run the agent for |
| `--token` | GitHub personal access token |
| Flag | Description |
| ------------------------------------- | -------------------------------------- |
| <nobr><code>{"--event"}</code></nobr> | GitHub mock event to run the agent for |
| <nobr><code>{"--token"}</code></nobr> | GitHub personal access token |
---
@@ -308,10 +322,10 @@ opencode models anthropic
#### Flags
| Flag | Description |
| ----------- | ------------------------------------------------------------ |
| `--refresh` | Refresh the models cache from models.dev |
| `--verbose` | Use more verbose model output (includes metadata like costs) |
| Flag | Description |
| --------------------------------------- | ------------------------------------------------------------ |
| <nobr><code>{"--refresh"}</code></nobr> | Refresh the models cache from models.dev |
| <nobr><code>{"--verbose"}</code></nobr> | Use more verbose model output (includes metadata like costs) |
Use the `--refresh` flag to update the cached model list. This is useful when new models have been added to a provider and you want to see them in OpenCode.
@@ -347,21 +361,26 @@ opencode run --attach http://localhost:4096 "Explain async/await in JavaScript"
#### Flags
| Flag | Short | Description |
| -------------------------------- | ----- | ----------------------------------------------------------------------- |
| `--command` | | The command to run, use message for args |
| `--continue` | `-c` | Continue the last session |
| `--session` | `-s` | Session ID to continue |
| `--fork` | | Fork the session when continuing (use with `--continue` or `--session`) |
| `--share` | | Share the session |
| `--model` | `-m` | Model to use in the form of provider/model |
| `--agent` | | Agent to use |
| `--file` | `-f` | File(s) to attach to message |
| `--format` | | Format: default (formatted) or json (raw JSON events) |
| `--title` | | Title for the session (uses truncated prompt if no value provided) |
| `--attach` | | Attach to a running opencode server (e.g., http://localhost:4096) |
| `--port` | | Port for the local server (defaults to random port) |
| `--dangerously-skip-permissions` | | Auto-approve permissions that are not explicitly denied (dangerous!) |
| Flag | Short | Description |
| ------------------------------------------------------------ | ----- | -------------------------------------------------------------------------- |
| <nobr><code>{"--command"}</code></nobr> | | The command to run, use message for args |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Continue the last session |
| <nobr><code>{"--session"}</code></nobr> | `-s` | Session ID to continue |
| <nobr><code>{"--fork"}</code></nobr> | | Fork the session when continuing (use with `--continue` or `--session`) |
| <nobr><code>{"--share"}</code></nobr> | | Share the session |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Model to use in the form of provider/model |
| <nobr><code>{"--agent"}</code></nobr> | | Agent to use |
| <nobr><code>{"--file"}</code></nobr> | `-f` | File(s) to attach to message |
| <nobr><code>{"--format"}</code></nobr> | | Format: default (formatted) or json (raw JSON events) |
| <nobr><code>{"--title"}</code></nobr> | | Title for the session (uses truncated prompt if no value provided) |
| <nobr><code>{"--attach"}</code></nobr> | | Attach to a running opencode server (e.g., http://localhost:4096) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Basic auth password (defaults to `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Basic auth username (defaults to `OPENCODE_SERVER_USERNAME` or `opencode`) |
| <nobr><code>{"--dir"}</code></nobr> | | Directory to run in, or path on the remote server when attaching |
| <nobr><code>{"--port"}</code></nobr> | | Port for the local server (defaults to random port) |
| <nobr><code>{"--variant"}</code></nobr> | | Model variant (provider-specific reasoning effort) |
| <nobr><code>{"--thinking"}</code></nobr> | | Show thinking blocks |
| <nobr><code>{"--dangerously-skip-permissions"}</code></nobr> | | Auto-approve permissions that are not explicitly denied (dangerous!) |
---
@@ -377,12 +396,13 @@ This starts an HTTP server that provides API access to opencode functionality wi
#### Flags
| Flag | Description |
| ------------ | ------------------------------------------ |
| `--port` | Port to listen on |
| `--hostname` | Hostname to listen on |
| `--mdns` | Enable mDNS discovery |
| `--cors` | Additional browser origin(s) to allow CORS |
| Flag | Description |
| ------------------------------------------- | ------------------------------------------ |
| <nobr><code>{"--port"}</code></nobr> | Port to listen on |
| <nobr><code>{"--hostname"}</code></nobr> | Hostname to listen on |
| <nobr><code>{"--mdns"}</code></nobr> | Enable mDNS discovery |
| <nobr><code>{"--mdns-domain"}</code></nobr> | Custom mDNS domain name |
| <nobr><code>{"--cors"}</code></nobr> | Additional browser origin(s) to allow CORS |
---
@@ -406,10 +426,20 @@ opencode session list
##### Flags
| Flag | Short | Description |
| ------------- | ----- | ------------------------------------ |
| `--max-count` | `-n` | Limit to N most recent sessions |
| `--format` | | Output format: table or json (table) |
| Flag | Short | Description |
| ----------------------------------------- | ----- | ------------------------------------ |
| <nobr><code>{"--max-count"}</code></nobr> | `-n` | Limit to N most recent sessions |
| <nobr><code>{"--format"}</code></nobr> | | Output format: table or json (table) |
---
#### delete
Delete an OpenCode session.
```bash
opencode session delete <sessionID>
```
---
@@ -423,12 +453,12 @@ opencode stats
#### Flags
| Flag | Description |
| ----------- | --------------------------------------------------------------------------- |
| `--days` | Show stats for the last N days (all time) |
| `--tools` | Number of tools to show (all) |
| `--models` | Show model usage breakdown (hidden by default). Pass a number to show top N |
| `--project` | Filter by project (all projects, empty string: current project) |
| Flag | Description |
| --------------------------------------- | --------------------------------------------------------------------------- |
| <nobr><code>{"--days"}</code></nobr> | Show stats for the last N days (all time) |
| <nobr><code>{"--tools"}</code></nobr> | Number of tools to show (all) |
| <nobr><code>{"--models"}</code></nobr> | Show model usage breakdown (hidden by default). Pass a number to show top N |
| <nobr><code>{"--project"}</code></nobr> | Filter by project (all projects, empty string: current project) |
---
@@ -442,6 +472,12 @@ opencode export [sessionID]
If you don't provide a session ID, you'll be prompted to select from available sessions.
#### Flags
| Flag | Description |
| ---------------------------------------- | ------------------------------------- |
| <nobr><code>{"--sanitize"}</code></nobr> | Redact sensitive transcript/file data |
---
### import
@@ -473,12 +509,13 @@ This starts an HTTP server and opens a web browser to access OpenCode through a
#### Flags
| Flag | Description |
| ------------ | ------------------------------------------ |
| `--port` | Port to listen on |
| `--hostname` | Hostname to listen on |
| `--mdns` | Enable mDNS discovery |
| `--cors` | Additional browser origin(s) to allow CORS |
| Flag | Description |
| ------------------------------------------- | ------------------------------------------ |
| <nobr><code>{"--port"}</code></nobr> | Port to listen on |
| <nobr><code>{"--hostname"}</code></nobr> | Hostname to listen on |
| <nobr><code>{"--mdns"}</code></nobr> | Enable mDNS discovery |
| <nobr><code>{"--mdns-domain"}</code></nobr> | Custom mDNS domain name |
| <nobr><code>{"--cors"}</code></nobr> | Additional browser origin(s) to allow CORS |
---
@@ -494,11 +531,83 @@ This command starts an ACP server that communicates via stdin/stdout using nd-JS
#### Flags
| Flag | Description |
| ------------ | --------------------- |
| `--cwd` | Working directory |
| `--port` | Port to listen on |
| `--hostname` | Hostname to listen on |
| Flag | Description |
| ------------------------------------------- | ------------------------------------------ |
| <nobr><code>{"--cwd"}</code></nobr> | Working directory |
| <nobr><code>{"--port"}</code></nobr> | Port to listen on |
| <nobr><code>{"--hostname"}</code></nobr> | Hostname to listen on |
| <nobr><code>{"--mdns"}</code></nobr> | Enable mDNS discovery |
| <nobr><code>{"--mdns-domain"}</code></nobr> | Custom mDNS domain name |
| <nobr><code>{"--cors"}</code></nobr> | Additional browser origin(s) to allow CORS |
---
### plugin
Install a plugin and update your config.
```bash
opencode plugin <module>
```
Or use the alias.
```bash
opencode plug <module>
```
#### Flags
| Flag | Short | Description |
| -------------------------------------- | ----- | ------------------------------- |
| <nobr><code>{"--global"}</code></nobr> | `-g` | Install in global config |
| <nobr><code>{"--force"}</code></nobr> | `-f` | Replace existing plugin version |
---
### pr
Fetch and checkout a GitHub PR branch, then run OpenCode.
```bash
opencode pr <number>
```
---
### db
Database tools.
```bash
opencode db [query]
```
#### Flags
| Flag | Description |
| -------------------------------------- | ------------------------------ |
| <nobr><code>{"--format"}</code></nobr> | Output format: `json` or `tsv` |
---
#### path
Print the database path.
```bash
opencode db path
```
---
### debug
Debugging and troubleshooting tools.
```bash
opencode debug [command]
```
---
@@ -512,12 +621,12 @@ opencode uninstall
#### Flags
| Flag | Short | Description |
| --------------- | ----- | ------------------------------------------- |
| `--keep-config` | `-c` | Keep configuration files |
| `--keep-data` | `-d` | Keep session data and snapshots |
| `--dry-run` | | Show what would be removed without removing |
| `--force` | `-f` | Skip confirmation prompts |
| Flag | Short | Description |
| ------------------------------------------- | ----- | ------------------------------------------- |
| <nobr><code>{"--keep-config"}</code></nobr> | `-c` | Keep configuration files |
| <nobr><code>{"--keep-data"}</code></nobr> | `-d` | Keep session data and snapshots |
| <nobr><code>{"--dry-run"}</code></nobr> | | Show what would be removed without removing |
| <nobr><code>{"--force"}</code></nobr> | `-f` | Skip confirmation prompts |
---
@@ -543,9 +652,9 @@ opencode upgrade v0.1.48
#### Flags
| Flag | Short | Description |
| ---------- | ----- | ----------------------------------------------------------------- |
| `--method` | `-m` | The installation method that was used; curl, npm, pnpm, bun, brew |
| Flag | Short | Description |
| -------------------------------------- | ----- | ----------------------------------------------------------------- |
| <nobr><code>{"--method"}</code></nobr> | `-m` | The installation method that was used; curl, npm, pnpm, bun, brew |
---
@@ -553,12 +662,13 @@ opencode upgrade v0.1.48
The opencode CLI takes the following global flags.
| Flag | Short | Description |
| -------------- | ----- | ------------------------------------ |
| `--help` | `-h` | Display help |
| `--version` | `-v` | Print version number |
| `--print-logs` | | Print logs to stderr |
| `--log-level` | | Log level (DEBUG, INFO, WARN, ERROR) |
| Flag | Short | Description |
| ------------------------------------------ | ----- | ------------------------------------ |
| <nobr><code>{"--help"}</code></nobr> | `-h` | Display help |
| <nobr><code>{"--version"}</code></nobr> | `-v` | Print version number |
| <nobr><code>{"--print-logs"}</code></nobr> | | Print logs to stderr |
| <nobr><code>{"--log-level"}</code></nobr> | | Log level (DEBUG, INFO, WARN, ERROR) |
| <nobr><code>{"--pure"}</code></nobr> | | Run without external plugins |
---

View File

@@ -29,16 +29,16 @@ opencode [project]
#### Flag
| Flag | Kort | Beskrivelse |
| ------------ | ---- | ---------------------------------------------------------------------------- |
| `--continue` | `-c` | Fortsæt sidste session |
| `--session` | `-s` | Sessions-id for at fortsætte |
| `--fork` | | Forgren sessionen ved fortsættelse (brug med `--continue` eller `--session`) |
| `--prompt` | | Spørg om at bruge |
| `--model` | `-m` | Model til brug i form af provider/model |
| `--agent` | | Agent hos bruge |
| `--port` | | Port at lytte på |
| `--hostname` | | Værtsnavn at lytte på |
| Flag | Kort | Beskrivelse |
| ---------------------------------------- | ---- | ---------------------------------------------------------------------------- |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Fortsæt sidste session |
| <nobr><code>{"--session"}</code></nobr> | `-s` | Sessions-id for at fortsætte |
| <nobr><code>{"--fork"}</code></nobr> | | Forgren sessionen ved fortsættelse (brug med `--continue` eller `--session`) |
| <nobr><code>{"--prompt"}</code></nobr> | | Spørg om at bruge |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Model til brug i form af provider/model |
| <nobr><code>{"--agent"}</code></nobr> | | Agent hos bruge |
| <nobr><code>{"--port"}</code></nobr> | | Port at lytte på |
| <nobr><code>{"--hostname"}</code></nobr> | | Værtsnavn at lytte på |
---
@@ -78,10 +78,14 @@ opencode attach http://10.20.30.40:4096
#### Flag
| Flag | Kort | Beskrivelse |
| ----------- | ---- | -------------------------------- |
| `--dir` | | Arbejdsmappe til at starte TUI i |
| `--session` | `-s` | Sessions-id for at fortsætte |
| Flag | Kort | Beskrivelse |
| ---------------------------------------- | ---- | --------------------------------------------------------------------------------- |
| <nobr><code>{"--dir"}</code></nobr> | | Arbejdsmappe til at starte TUI i |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Fortsæt den seneste session |
| <nobr><code>{"--session"}</code></nobr> | `-s` | Sessions-id for at fortsætte |
| <nobr><code>{"--fork"}</code></nobr> | | Forgren sessionen ved fortsættelse (brug med `--continue` eller `--session`) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Adgangskode til basic auth (standard: `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Brugernavn til basic auth (standard: `OPENCODE_SERVER_USERNAME` eller `opencode`) |
---
@@ -187,10 +191,10 @@ opencode github run
##### Flag
| Flag | Beskrivelse |
| --------- | ---------------------------------------------- |
| `--event` | GitHub mock begivenhed for at køre agenten for |
| `--token` | GitHub personlig adgangstoken |
| Flag | Beskrivelse |
| ------------------------------------- | ---------------------------------------------- |
| <nobr><code>{"--event"}</code></nobr> | GitHub mock begivenhed for at køre agenten for |
| <nobr><code>{"--token"}</code></nobr> | GitHub personlig adgangstoken |
---
@@ -296,10 +300,10 @@ opencode models anthropic
#### Flag
| Flag | Beskrivelse |
| ----------- | ----------------------------------------------------------------------- |
| `--refresh` | Opdater modelcachen fra models.dev |
| `--verbose` | Brug mere detaljeret modeloutput (inkluderer metadata som omkostninger) |
| Flag | Beskrivelse |
| --------------------------------------- | ----------------------------------------------------------------------- |
| <nobr><code>{"--refresh"}</code></nobr> | Opdater modelcachen fra models.dev |
| <nobr><code>{"--verbose"}</code></nobr> | Brug mere detaljeret modeloutput (inkluderer metadata som omkostninger) |
Brug flaget `--refresh` til at opdatere den cachelagrede modelliste. Dette er nyttigt, når nye modeller er blevet tilføjet til en udbyder, og du vil se dem i OpenCode.
@@ -335,20 +339,25 @@ opencode run --attach http://localhost:4096 "Explain async/await in JavaScript"
#### Flag
| Flag | Kort | Beskrivelse |
| ------------ | ---- | ----------------------------------------------------------------------------------- |
| `--command` | | Kommandoen til at køre, brug besked til args |
| `--continue` | `-c` | Fortsæt sidste session |
| `--session` | `-s` | Sessions-id for at fortsætte |
| `--fork` | | Forgren sessionen ved fortsættelse (brug med `--continue` eller `--session`) |
| `--share` | | Del sessionen |
| `--model` | `-m` | Model til brug i form af provider/model |
| `--agent` | | Agent til brug |
| `--file` | `-f` | Fil(er), der skal vedhæftes til meddelelsen |
| `--format` | | Format: standard (formateret) eller json (rå JSON hændelser) |
| `--title` | | Titel for sessionen (bruger trunkeret prompt, hvis der ikke er angivet nogen værdi) |
| `--attach` | | Tilslut til en kørende opencode-server (f.eks. http://localhost:4096) |
| `--port` | | Port til den lokale server (standard til vilkårlig port) |
| Flag | Kort | Beskrivelse |
| ---------------------------------------- | ---- | ----------------------------------------------------------------------------------- |
| <nobr><code>{"--command"}</code></nobr> | | Kommandoen til at køre, brug besked til args |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Fortsæt sidste session |
| <nobr><code>{"--session"}</code></nobr> | `-s` | Sessions-id for at fortsætte |
| <nobr><code>{"--fork"}</code></nobr> | | Forgren sessionen ved fortsættelse (brug med `--continue` eller `--session`) |
| <nobr><code>{"--share"}</code></nobr> | | Del sessionen |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Model til brug i form af provider/model |
| <nobr><code>{"--agent"}</code></nobr> | | Agent til brug |
| <nobr><code>{"--file"}</code></nobr> | `-f` | Fil(er), der skal vedhæftes til meddelelsen |
| <nobr><code>{"--format"}</code></nobr> | | Format: standard (formateret) eller json (rå JSON hændelser) |
| <nobr><code>{"--title"}</code></nobr> | | Titel for sessionen (bruger trunkeret prompt, hvis der ikke er angivet nogen værdi) |
| <nobr><code>{"--attach"}</code></nobr> | | Tilslut til en kørende opencode-server (f.eks. http://localhost:4096) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Adgangskode til basic auth (standard: `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Brugernavn til basic auth (standard: `OPENCODE_SERVER_USERNAME` eller `opencode`) |
| <nobr><code>{"--dir"}</code></nobr> | | Mappe at køre i, eller sti på fjernserveren ved tilkobling |
| <nobr><code>{"--variant"}</code></nobr> | | Modelvariant (udbyder-specifik ræsonneringsindsats) |
| <nobr><code>{"--thinking"}</code></nobr> | | Vis tænkeblokke |
| <nobr><code>{"--port"}</code></nobr> | | Port til den lokale server (standard til vilkårlig port) |
---
@@ -364,12 +373,12 @@ Dette starter en HTTP-server, der giver API-adgang til opencode-funktionalitet u
#### Flag
| Flag | Beskrivelse |
| ------------ | ------------------------------------------------ |
| `--port` | Port at lytte på |
| `--hostname` | Værtsnavn at lytte på |
| `--mdns` | Aktiver mDNS-opdagelse |
| `--cors` | Yderligere browseroprindelse til at tillade CORS |
| Flag | Beskrivelse |
| ---------------------------------------- | ------------------------------------------------ |
| <nobr><code>{"--port"}</code></nobr> | Port at lytte på |
| <nobr><code>{"--hostname"}</code></nobr> | Værtsnavn at lytte på |
| <nobr><code>{"--mdns"}</code></nobr> | Aktiver mDNS-opdagelse |
| <nobr><code>{"--cors"}</code></nobr> | Yderligere browseroprindelse til at tillade CORS |
---
@@ -393,10 +402,10 @@ opencode session list
##### Flag
| Flag | Kort | Beskrivelse |
| ------------- | ---- | -------------------------------------- |
| `--max-count` | `-n` | Begræns til N seneste sessioner |
| `--format` | | Outputformat: tabel eller json (tabel) |
| Flag | Kort | Beskrivelse |
| ----------------------------------------- | ---- | -------------------------------------- |
| <nobr><code>{"--max-count"}</code></nobr> | `-n` | Begræns til N seneste sessioner |
| <nobr><code>{"--format"}</code></nobr> | | Outputformat: tabel eller json (tabel) |
---
@@ -410,12 +419,12 @@ opencode stats
#### Flag
| Flag | Beskrivelse |
| ----------- | --------------------------------------------------------------------------- |
| `--days` | Vis statistik for de sidste N dage (hele tiden) |
| `--tools` | Antal værktøjer, der skal vises (alle) |
| `--models` | Vis modelbrugsopdeling (skjult som standard). Send et tal for at vise top N |
| `--project` | Filtre efter projekt (alle projekter, tom streng: nuværende projekt) |
| Flag | Beskrivelse |
| --------------------------------------- | --------------------------------------------------------------------------- |
| <nobr><code>{"--days"}</code></nobr> | Vis statistik for de sidste N dage (hele tiden) |
| <nobr><code>{"--tools"}</code></nobr> | Antal værktøjer, der skal vises (alle) |
| <nobr><code>{"--models"}</code></nobr> | Vis modelbrugsopdeling (skjult som standard). Send et tal for at vise top N |
| <nobr><code>{"--project"}</code></nobr> | Filtre efter projekt (alle projekter, tom streng: nuværende projekt) |
---
@@ -460,12 +469,12 @@ Dette starter en HTTP-server og åbner en webbrowser for at få adgang til OpenC
#### Flag
| Flag | Beskrivelse |
| ------------ | ------------------------------------------------ |
| `--port` | Port at lytte på |
| `--hostname` | Værtsnavn at lytte på |
| `--mdns` | Aktiver mDNS-opdagelse |
| `--cors` | Yderligere browseroprindelse til at tillade CORS |
| Flag | Beskrivelse |
| ---------------------------------------- | ------------------------------------------------ |
| <nobr><code>{"--port"}</code></nobr> | Port at lytte på |
| <nobr><code>{"--hostname"}</code></nobr> | Værtsnavn at lytte på |
| <nobr><code>{"--mdns"}</code></nobr> | Aktiver mDNS-opdagelse |
| <nobr><code>{"--cors"}</code></nobr> | Yderligere browseroprindelse til at tillade CORS |
---
@@ -481,11 +490,11 @@ Denne kommando starter en ACP-server, der kommunikerer via stdin/stdout ved hjæ
#### Flag
| Flag | Beskrivelse |
| ------------ | --------------------- |
| `--cwd` | Arbejdsmappe |
| `--port` | Port at lytte på |
| `--hostname` | Værtsnavn at lytte på |
| Flag | Beskrivelse |
| ---------------------------------------- | --------------------- |
| <nobr><code>{"--cwd"}</code></nobr> | Arbejdsmappe |
| <nobr><code>{"--port"}</code></nobr> | Port at lytte på |
| <nobr><code>{"--hostname"}</code></nobr> | Værtsnavn at lytte på |
---
@@ -499,12 +508,12 @@ opencode uninstall
#### Flag
| Flag | Kort | Beskrivelse |
| --------------- | ---- | ------------------------------------------------ |
| `--keep-config` | `-c` | Se konfigurationsfiler |
| `--keep-data` | `-d` | Gem sessionsdata og snapshots |
| `--dry-run` | | Vis, hvad der ville blive fjernet uden at fjerne |
| `--force` | `-f` | Spring bekræftelsesspørgsmål over |
| Flag | Kort | Beskrivelse |
| ------------------------------------------- | ---- | ------------------------------------------------ |
| <nobr><code>{"--keep-config"}</code></nobr> | `-c` | Se konfigurationsfiler |
| <nobr><code>{"--keep-data"}</code></nobr> | `-d` | Gem sessionsdata og snapshots |
| <nobr><code>{"--dry-run"}</code></nobr> | | Vis, hvad der ville blive fjernet uden at fjerne |
| <nobr><code>{"--force"}</code></nobr> | `-f` | Spring bekræftelsesspørgsmål over |
---
@@ -530,9 +539,9 @@ opencode upgrade v0.1.48
#### upgrade
| Flag | Kort | Beskrivelse |
| ---------- | ---- | ---------------------------------------------------------------- |
| `--method` | `-m` | Installationsmetoden, der blev brugt; curl, npm, pnpm, bun, brew |
| Flag | Kort | Beskrivelse |
| -------------------------------------- | ---- | ---------------------------------------------------------------- |
| <nobr><code>{"--method"}</code></nobr> | `-m` | Installationsmetoden, der blev brugt; curl, npm, pnpm, bun, brew |
---
@@ -540,12 +549,12 @@ opencode upgrade v0.1.48
opencode CLI tager følgende globale flag.
| Flag | Kort | Beskrivelse |
| -------------- | ---- | ------------------------------------ |
| `--help` | `-h` | Vis hjælp |
| `--version` | `-v` | Udskriftsversionsnummer |
| `--print-logs` | | Udskriv logfiler til stderr |
| `--log-level` | | Logniveau (DEBUG, INFO, WARN, ERROR) |
| Flag | Kort | Beskrivelse |
| ------------------------------------------ | ---- | ------------------------------------ |
| <nobr><code>{"--help"}</code></nobr> | `-h` | Vis hjælp |
| <nobr><code>{"--version"}</code></nobr> | `-v` | Udskriftsversionsnummer |
| <nobr><code>{"--print-logs"}</code></nobr> | | Udskriv logfiler til stderr |
| <nobr><code>{"--log-level"}</code></nobr> | | Logniveau (DEBUG, INFO, WARN, ERROR) |
---

View File

@@ -29,16 +29,16 @@ opencode [project]
#### Optionen
| Flag | Kurz | Beschreibung |
| ------------ | ---- | ---------------------------------------------------------------------- |
| `--continue` | `-c` | Setzen Sie die letzte Sitzung fort |
| `--session` | `-s` | Session-ID zum Fortfahren |
| `--fork` | | Sitzung beim Fortsetzen verzweigen (mit `--continue` oder `--session`) |
| `--prompt` | | Prompt zur Verwendung |
| `--model` | `-m` | Zu verwendendes Modell in der Form provider/model |
| `--agent` | | Zu verwendender Agent |
| `--port` | | Port zum Abhören |
| `--hostname` | | Hostname zum Abhören |
| Flag | Kurz | Beschreibung |
| ---------------------------------------- | ---- | ---------------------------------------------------------------------- |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Setzen Sie die letzte Sitzung fort |
| <nobr><code>{"--session"}</code></nobr> | `-s` | Session-ID zum Fortfahren |
| <nobr><code>{"--fork"}</code></nobr> | | Sitzung beim Fortsetzen verzweigen (mit `--continue` oder `--session`) |
| <nobr><code>{"--prompt"}</code></nobr> | | Prompt zur Verwendung |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Zu verwendendes Modell in der Form provider/model |
| <nobr><code>{"--agent"}</code></nobr> | | Zu verwendender Agent |
| <nobr><code>{"--port"}</code></nobr> | | Port zum Abhören |
| <nobr><code>{"--hostname"}</code></nobr> | | Hostname zum Abhören |
---
@@ -78,10 +78,14 @@ opencode attach http://10.20.30.40:4096
#### Optionen
| Flag | Kurz | Beschreibung |
| ----------- | ---- | ----------------------------------------- |
| `--dir` | | Arbeitsverzeichnis zum Starten von TUI in |
| `--session` | `-s` | Session-ID zum Fortfahren |
| Flag | Kurz | Beschreibung |
| ---------------------------------------- | ---- | ---------------------------------------------------------------------------------- |
| <nobr><code>{"--dir"}</code></nobr> | | Arbeitsverzeichnis zum Starten von TUI in |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Letzte Sitzung fortsetzen |
| <nobr><code>{"--session"}</code></nobr> | `-s` | Session-ID zum Fortfahren |
| <nobr><code>{"--fork"}</code></nobr> | | Sitzung beim Fortsetzen abzweigen (mit `--continue` oder `--session` verwenden) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Basic-Auth-Passwort (standardmäßig `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Basic-Auth-Benutzername (standardmäßig `OPENCODE_SERVER_USERNAME` oder `opencode`) |
---
@@ -187,10 +191,10 @@ opencode github run
##### Optionen
| Flag | Beschreibung |
| --------- | --------------------------------------------------- |
| `--event` | GitHub Scheinereignis zum Ausführen des Agenten für |
| `--token` | GitHub persönliches Zugriffstoken |
| Flag | Beschreibung |
| ------------------------------------- | --------------------------------------------------- |
| <nobr><code>{"--event"}</code></nobr> | GitHub Scheinereignis zum Ausführen des Agenten für |
| <nobr><code>{"--token"}</code></nobr> | GitHub persönliches Zugriffstoken |
---
@@ -296,10 +300,10 @@ opencode models anthropic
#### Optionen
| Flag | Beschreibung |
| ----------- | ------------------------------------------------------------------------------------- |
| `--refresh` | Aktualisieren Sie den Modellcache von models.dev |
| `--verbose` | Verwenden Sie eine ausführlichere Modellausgabe (einschließlich Metadaten wie Kosten) |
| Flag | Beschreibung |
| --------------------------------------- | ------------------------------------------------------------------------------------- |
| <nobr><code>{"--refresh"}</code></nobr> | Aktualisieren Sie den Modellcache von models.dev |
| <nobr><code>{"--verbose"}</code></nobr> | Verwenden Sie eine ausführlichere Modellausgabe (einschließlich Metadaten wie Kosten) |
Verwenden Sie das Flag `--refresh`, um die zwischengespeicherte Modellliste zu aktualisieren. Dies ist nützlich, wenn einem Anbieter neue Modelle hinzugefügt wurden und Sie diese in OpenCode sehen möchten.
@@ -335,20 +339,25 @@ opencode run --attach http://localhost:4096 "Explain async/await in JavaScript"
#### Optionen
| Flag | Kurz | Beschreibung |
| ------------ | ---- | --------------------------------------------------------------------------------------------------- |
| `--command` | | Der auszuführende Befehl, Argumente als Nachricht verwenden |
| `--continue` | `-c` | Setzen Sie die letzte Sitzung fort |
| `--session` | `-s` | Session-ID zum Fortfahren |
| `--fork` | | Sitzung beim Fortsetzen verzweigen (mit `--continue` oder `--session` verwenden) |
| `--share` | | Teilen Sie die Sitzung |
| `--model` | `-m` | Zu verwendendes Modell in der Form provider/model |
| `--agent` | | Zu verwendender Agent |
| `--file` | `-f` | Datei(en) zum Anhängen an die Nachricht |
| `--format` | | Format: default (formatiert) oder json (rohe JSON-Ereignisse) |
| `--title` | | Titel für die Sitzung (verwendet eine verkürzte Eingabeaufforderung, wenn kein Wert angegeben wird) |
| `--attach` | | An einen laufenden OpenCode-Server anschließen (z.B. http://localhost:4096) |
| `--port` | | Port für den lokalen Server (standardmäßig zufälliger Port) |
| Flag | Kurz | Beschreibung |
| ---------------------------------------- | ---- | --------------------------------------------------------------------------------------------------- |
| <nobr><code>{"--command"}</code></nobr> | | Der auszuführende Befehl, Argumente als Nachricht verwenden |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Setzen Sie die letzte Sitzung fort |
| <nobr><code>{"--session"}</code></nobr> | `-s` | Session-ID zum Fortfahren |
| <nobr><code>{"--fork"}</code></nobr> | | Sitzung beim Fortsetzen verzweigen (mit `--continue` oder `--session` verwenden) |
| <nobr><code>{"--share"}</code></nobr> | | Teilen Sie die Sitzung |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Zu verwendendes Modell in der Form provider/model |
| <nobr><code>{"--agent"}</code></nobr> | | Zu verwendender Agent |
| <nobr><code>{"--file"}</code></nobr> | `-f` | Datei(en) zum Anhängen an die Nachricht |
| <nobr><code>{"--format"}</code></nobr> | | Format: default (formatiert) oder json (rohe JSON-Ereignisse) |
| <nobr><code>{"--title"}</code></nobr> | | Titel für die Sitzung (verwendet eine verkürzte Eingabeaufforderung, wenn kein Wert angegeben wird) |
| <nobr><code>{"--attach"}</code></nobr> | | An einen laufenden OpenCode-Server anschließen (z.B. http://localhost:4096) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Basic-Auth-Passwort (standardmäßig `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Basic-Auth-Benutzername (standardmäßig `OPENCODE_SERVER_USERNAME` oder `opencode`) |
| <nobr><code>{"--dir"}</code></nobr> | | Verzeichnis für die Ausführung, oder Pfad auf dem Remote-Server beim Anhängen |
| <nobr><code>{"--variant"}</code></nobr> | | Modellvariante (anbieterspezifischer Reasoning-Aufwand) |
| <nobr><code>{"--thinking"}</code></nobr> | | Denkblöcke anzeigen |
| <nobr><code>{"--port"}</code></nobr> | | Port für den lokalen Server (standardmäßig zufälliger Port) |
---
@@ -364,12 +373,12 @@ Dadurch wird ein HTTP-Server gestartet, der API-Zugriff auf OpenCode-Funktionali
#### Optionen
| Flag | Beschreibung |
| ------------ | ----------------------------------------------- |
| `--port` | Port zum Abhören |
| `--hostname` | Hostname zum Abhören |
| `--mdns` | mDNS-Discovery aktivieren |
| `--cors` | Zusätzliche Browser-Ursprünge für CORS zulassen |
| Flag | Beschreibung |
| ---------------------------------------- | ----------------------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | Port zum Abhören |
| <nobr><code>{"--hostname"}</code></nobr> | Hostname zum Abhören |
| <nobr><code>{"--mdns"}</code></nobr> | mDNS-Discovery aktivieren |
| <nobr><code>{"--cors"}</code></nobr> | Zusätzliche Browser-Ursprünge für CORS zulassen |
---
@@ -393,10 +402,10 @@ opencode session list
##### Optionen
| Flag | Kurz | Beschreibung |
| ------------- | ---- | ---------------------------------------- |
| `--max-count` | `-n` | Beschränken auf die N neuesten Sitzungen |
| `--format` | | Ausgabeformat: table oder json (table) |
| Flag | Kurz | Beschreibung |
| ----------------------------------------- | ---- | ---------------------------------------- |
| <nobr><code>{"--max-count"}</code></nobr> | `-n` | Beschränken auf die N neuesten Sitzungen |
| <nobr><code>{"--format"}</code></nobr> | | Ausgabeformat: table oder json (table) |
---
@@ -410,12 +419,12 @@ opencode stats
#### Optionen
| Flag | Beschreibung |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `--days` | Statistiken für die letzten N Tage anzeigen (alle Zeiten) |
| `--tools` | Anzahl der angebotenen Werkzeuge (alle) |
| `--models` | Aufschlüsselung der Modellnutzung anzeigen (standardmäßig ausgeblendet). Übergeben Sie eine Zahl, um die obersten N anzuzeigen |
| `--project` | Nach Projekt filtern (alle Projekte, leere Zeichenfolge: aktuelles Projekt) |
| Flag | Beschreibung |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| <nobr><code>{"--days"}</code></nobr> | Statistiken für die letzten N Tage anzeigen (alle Zeiten) |
| <nobr><code>{"--tools"}</code></nobr> | Anzahl der angebotenen Werkzeuge (alle) |
| <nobr><code>{"--models"}</code></nobr> | Aufschlüsselung der Modellnutzung anzeigen (standardmäßig ausgeblendet). Übergeben Sie eine Zahl, um die obersten N anzuzeigen |
| <nobr><code>{"--project"}</code></nobr> | Nach Projekt filtern (alle Projekte, leere Zeichenfolge: aktuelles Projekt) |
---
@@ -460,12 +469,12 @@ Dadurch wird ein HTTP-Server gestartet und ein Webbrowser geöffnet, um über ei
#### Optionen
| Flag | Beschreibung |
| ------------ | ----------------------------------------------- |
| `--port` | Port zum Abhören |
| `--hostname` | Hostname zum Abhören |
| `--mdns` | mDNS-Discovery aktivieren |
| `--cors` | Zusätzliche Browser-Ursprünge für CORS zulassen |
| Flag | Beschreibung |
| ---------------------------------------- | ----------------------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | Port zum Abhören |
| <nobr><code>{"--hostname"}</code></nobr> | Hostname zum Abhören |
| <nobr><code>{"--mdns"}</code></nobr> | mDNS-Discovery aktivieren |
| <nobr><code>{"--cors"}</code></nobr> | Zusätzliche Browser-Ursprünge für CORS zulassen |
---
@@ -481,11 +490,11 @@ Dieser Befehl startet einen ACP-Server, der über stdin/stdout unter Verwendung
#### Optionen
| Flag | Beschreibung |
| ------------ | -------------------- |
| `--cwd` | Arbeitsverzeichnis |
| `--port` | Port zum Abhören |
| `--hostname` | Hostname zum Abhören |
| Flag | Beschreibung |
| ---------------------------------------- | -------------------- |
| <nobr><code>{"--cwd"}</code></nobr> | Arbeitsverzeichnis |
| <nobr><code>{"--port"}</code></nobr> | Port zum Abhören |
| <nobr><code>{"--hostname"}</code></nobr> | Hostname zum Abhören |
---
@@ -499,12 +508,12 @@ opencode uninstall
#### Optionen
| Flag | Kurz | Beschreibung |
| --------------- | ---- | --------------------------------------------------- |
| `--keep-config` | `-c` | Konfigurationsdateien behalten |
| `--keep-data` | `-d` | Sitzungsdaten und Snapshots aufbewahren |
| `--dry-run` | | Zeigt, was entfernt werden würde, ohne zu entfernen |
| `--force` | `-f` | Bestätigungsaufforderungen überspringen |
| Flag | Kurz | Beschreibung |
| ------------------------------------------- | ---- | --------------------------------------------------- |
| <nobr><code>{"--keep-config"}</code></nobr> | `-c` | Konfigurationsdateien behalten |
| <nobr><code>{"--keep-data"}</code></nobr> | `-d` | Sitzungsdaten und Snapshots aufbewahren |
| <nobr><code>{"--dry-run"}</code></nobr> | | Zeigt, was entfernt werden würde, ohne zu entfernen |
| <nobr><code>{"--force"}</code></nobr> | `-f` | Bestätigungsaufforderungen überspringen |
---
@@ -530,9 +539,9 @@ opencode upgrade v0.1.48
#### Optionen
| Flag | Kurz | Beschreibung |
| ---------- | ---- | ------------------------------------------------------------------- |
| `--method` | `-m` | Die zu verwendende Installationsmethode; curl, npm, pnpm, bun, brew |
| Flag | Kurz | Beschreibung |
| -------------------------------------- | ---- | ------------------------------------------------------------------- |
| <nobr><code>{"--method"}</code></nobr> | `-m` | Die zu verwendende Installationsmethode; curl, npm, pnpm, bun, brew |
---
@@ -540,12 +549,12 @@ opencode upgrade v0.1.48
Der OpenCode CLI akzeptiert die folgenden globalen Flags.
| Flag | Kurz | Beschreibung |
| -------------- | ---- | ----------------------------------------- |
| `--help` | `-h` | Hilfe anzeigen |
| `--version` | `-v` | Versionsnummer drucken |
| `--print-logs` | | Protokolle nach stderr drucken |
| `--log-level` | | Protokollebene (DEBUG, INFO, WARN, ERROR) |
| Flag | Kurz | Beschreibung |
| ------------------------------------------ | ---- | ----------------------------------------- |
| <nobr><code>{"--help"}</code></nobr> | `-h` | Hilfe anzeigen |
| <nobr><code>{"--version"}</code></nobr> | `-v` | Versionsnummer drucken |
| <nobr><code>{"--print-logs"}</code></nobr> | | Protokolle nach stderr drucken |
| <nobr><code>{"--log-level"}</code></nobr> | | Protokollebene (DEBUG, INFO, WARN, ERROR) |
---

View File

@@ -29,16 +29,16 @@ opencode [project]
#### Opciones
| Opción | Corta | Descripción |
| ------------ | ----- | --------------------------------------------------------------------- |
| `--continue` | `-c` | Continuar la última sesión |
| `--session` | `-s` | ID de sesión para continuar |
| `--fork` | | Bifurcar la sesión al continuar (usar con `--continue` o `--session`) |
| `--prompt` | | Aviso de uso |
| `--model` | `-m` | Modelo a utilizar en forma de proveedor/modelo |
| `--agent` | | Agente a utilizar |
| `--port` | | Puerto para escuchar |
| `--hostname` | | Nombre de host para escuchar |
| Opción | Corta | Descripción |
| ---------------------------------------- | ----- | --------------------------------------------------------------------- |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Continuar la última sesión |
| <nobr><code>{"--session"}</code></nobr> | `-s` | ID de sesión para continuar |
| <nobr><code>{"--fork"}</code></nobr> | | Bifurcar la sesión al continuar (usar con `--continue` o `--session`) |
| <nobr><code>{"--prompt"}</code></nobr> | | Aviso de uso |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Modelo a utilizar en forma de proveedor/modelo |
| <nobr><code>{"--agent"}</code></nobr> | | Agente a utilizar |
| <nobr><code>{"--port"}</code></nobr> | | Puerto para escuchar |
| <nobr><code>{"--hostname"}</code></nobr> | | Nombre de host para escuchar |
---
@@ -78,10 +78,14 @@ opencode attach http://10.20.30.40:4096
#### Opciones
| Opción | Corta | Descripción |
| ----------- | ----- | ----------------------------------------- |
| `--dir` | | Directorio de trabajo para iniciar TUI en |
| `--session` | `-s` | ID de sesión para continuar |
| Opción | Corta | Descripción |
| ---------------------------------------- | ----- | ----------------------------------------------------------------------------------------- |
| <nobr><code>{"--dir"}</code></nobr> | | Directorio de trabajo para iniciar TUI en |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Continuar la última sesión |
| <nobr><code>{"--session"}</code></nobr> | `-s` | ID de sesión para continuar |
| <nobr><code>{"--fork"}</code></nobr> | | Bifurcar la sesión al continuar (usar con `--continue` o `--session`) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Contraseña de autenticación básica (predeterminada: `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Usuario de autenticación básica (predeterminado: `OPENCODE_SERVER_USERNAME` u `opencode`) |
---
@@ -187,10 +191,10 @@ opencode github run
##### Opciones
| Opción | Descripción |
| --------- | ---------------------------------------------- |
| `--event` | GitHub evento simulado para ejecutar el agente |
| `--token` | GitHub token de acceso personal |
| Opción | Descripción |
| ------------------------------------- | ---------------------------------------------- |
| <nobr><code>{"--event"}</code></nobr> | GitHub evento simulado para ejecutar el agente |
| <nobr><code>{"--token"}</code></nobr> | GitHub token de acceso personal |
---
@@ -296,10 +300,10 @@ opencode models anthropic
#### Opciones
| Opción | Descripción |
| ----------- | --------------------------------------------------------------------------- |
| `--refresh` | Actualizar la caché de modelos desde models.dev |
| `--verbose` | Utilice una salida del modelo más detallada (incluye metadatos como costos) |
| Opción | Descripción |
| --------------------------------------- | --------------------------------------------------------------------------- |
| <nobr><code>{"--refresh"}</code></nobr> | Actualizar la caché de modelos desde models.dev |
| <nobr><code>{"--verbose"}</code></nobr> | Utilice una salida del modelo más detallada (incluye metadatos como costos) |
Utilice el indicador `--refresh` para actualizar la lista de modelos almacenados en caché. Esto es útil cuando se han agregado nuevos modelos a un proveedor y desea verlos en OpenCode.
@@ -335,20 +339,25 @@ opencode run --attach http://localhost:4096 "Explain async/await in JavaScript"
#### Opciones
| Opción | Corta | Descripción |
| ------------ | ----- | ----------------------------------------------------------------------------------- |
| `--command` | | El comando a ejecutar, use mensaje para args |
| `--continue` | `-c` | Continuar la última sesión |
| `--session` | `-s` | ID de sesión para continuar |
| `--fork` | | Bifurcar la sesión al continuar (usar con `--continue` o `--session`) |
| `--share` | | Comparte la sesión |
| `--model` | `-m` | Modelo a utilizar en forma de proveedor/modelo |
| `--agent` | | Agente a utilizar |
| `--file` | `-f` | Archivo(s) para adjuntar al mensaje |
| `--format` | | Formato: predeterminado (formateado) o json (eventos JSON sin formato) |
| `--title` | | Título de la sesión (utiliza un mensaje truncado si no se proporciona ningún valor) |
| `--attach` | | Adjuntar a un servidor opencode en ejecución (por ejemplo, http://localhost:4096) |
| `--port` | | Puerto para el servidor local (el puerto predeterminado es aleatorio) |
| Opción | Corta | Descripción |
| ---------------------------------------- | ----- | ----------------------------------------------------------------------------------------- |
| <nobr><code>{"--command"}</code></nobr> | | El comando a ejecutar, use mensaje para args |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Continuar la última sesión |
| <nobr><code>{"--session"}</code></nobr> | `-s` | ID de sesión para continuar |
| <nobr><code>{"--fork"}</code></nobr> | | Bifurcar la sesión al continuar (usar con `--continue` o `--session`) |
| <nobr><code>{"--share"}</code></nobr> | | Comparte la sesión |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Modelo a utilizar en forma de proveedor/modelo |
| <nobr><code>{"--agent"}</code></nobr> | | Agente a utilizar |
| <nobr><code>{"--file"}</code></nobr> | `-f` | Archivo(s) para adjuntar al mensaje |
| <nobr><code>{"--format"}</code></nobr> | | Formato: predeterminado (formateado) o json (eventos JSON sin formato) |
| <nobr><code>{"--title"}</code></nobr> | | Título de la sesión (utiliza un mensaje truncado si no se proporciona ningún valor) |
| <nobr><code>{"--attach"}</code></nobr> | | Adjuntar a un servidor opencode en ejecución (por ejemplo, http://localhost:4096) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Contraseña de autenticación básica (predeterminada: `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Usuario de autenticación básica (predeterminado: `OPENCODE_SERVER_USERNAME` u `opencode`) |
| <nobr><code>{"--dir"}</code></nobr> | | Directorio de ejecución, o ruta en el servidor remoto al adjuntar |
| <nobr><code>{"--variant"}</code></nobr> | | Variante del modelo (esfuerzo de razonamiento específico del proveedor) |
| <nobr><code>{"--thinking"}</code></nobr> | | Mostrar bloques de pensamiento |
| <nobr><code>{"--port"}</code></nobr> | | Puerto para el servidor local (el puerto predeterminado es aleatorio) |
---
@@ -364,12 +373,12 @@ Esto inicia un servidor HTTP que proporciona acceso API a la funcionalidad openc
#### Opciones
| Opción | Descripción |
| ------------ | ---------------------------------------------------- |
| `--port` | Puerto para escuchar |
| `--hostname` | Nombre de host para escuchar |
| `--mdns` | Habilitar el descubrimiento de mDNS |
| `--cors` | Orígenes de navegador adicionales para permitir CORS |
| Opción | Descripción |
| ---------------------------------------- | ---------------------------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | Puerto para escuchar |
| <nobr><code>{"--hostname"}</code></nobr> | Nombre de host para escuchar |
| <nobr><code>{"--mdns"}</code></nobr> | Habilitar el descubrimiento de mDNS |
| <nobr><code>{"--cors"}</code></nobr> | Orígenes de navegador adicionales para permitir CORS |
---
@@ -393,10 +402,10 @@ opencode session list
##### Opciones
| Opción | Corta | Descripción |
| ------------- | ----- | --------------------------------------- |
| `--max-count` | `-n` | Limitar a N sesiones más recientes |
| `--format` | | Formato de salida: tabla o json (tabla) |
| Opción | Corta | Descripción |
| ----------------------------------------- | ----- | --------------------------------------- |
| <nobr><code>{"--max-count"}</code></nobr> | `-n` | Limitar a N sesiones más recientes |
| <nobr><code>{"--format"}</code></nobr> | | Formato de salida: tabla o json (tabla) |
---
@@ -410,12 +419,12 @@ opencode stats
#### Opciones
| Opción | Descripción |
| ----------- | ------------------------------------------------------------------------------------------------------------------------ |
| `--days` | Mostrar estadísticas de los últimos N días (todo el tiempo) |
| `--tools` | Número de herramientas para mostrar (todas) |
| `--models` | Mostrar el desglose del uso del modelo (oculto de forma predeterminada). Pase un número para mostrar la parte superior N |
| `--project` | Filtrar por proyecto (todos los proyectos, cadena vacía: proyecto actual) |
| Opción | Descripción |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| <nobr><code>{"--days"}</code></nobr> | Mostrar estadísticas de los últimos N días (todo el tiempo) |
| <nobr><code>{"--tools"}</code></nobr> | Número de herramientas para mostrar (todas) |
| <nobr><code>{"--models"}</code></nobr> | Mostrar el desglose del uso del modelo (oculto de forma predeterminada). Pase un número para mostrar la parte superior N |
| <nobr><code>{"--project"}</code></nobr> | Filtrar por proyecto (todos los proyectos, cadena vacía: proyecto actual) |
---
@@ -460,12 +469,12 @@ Esto inicia un servidor HTTP y abre un navegador web para acceder a OpenCode a t
#### Opciones
| Opción | Descripción |
| ------------ | ---------------------------------------------------- |
| `--port` | Puerto para escuchar |
| `--hostname` | Nombre de host para escuchar |
| `--mdns` | Habilitar el descubrimiento de mDNS |
| `--cors` | Orígenes de navegador adicionales para permitir CORS |
| Opción | Descripción |
| ---------------------------------------- | ---------------------------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | Puerto para escuchar |
| <nobr><code>{"--hostname"}</code></nobr> | Nombre de host para escuchar |
| <nobr><code>{"--mdns"}</code></nobr> | Habilitar el descubrimiento de mDNS |
| <nobr><code>{"--cors"}</code></nobr> | Orígenes de navegador adicionales para permitir CORS |
---
@@ -481,11 +490,11 @@ Este comando inicia un servidor ACP que se comunica a través de stdin/stdout us
#### Opciones
| Opción | Descripción |
| ------------ | ---------------------------- |
| `--cwd` | Directorio de trabajo |
| `--port` | Puerto para escuchar |
| `--hostname` | Nombre de host para escuchar |
| Opción | Descripción |
| ---------------------------------------- | ---------------------------- |
| <nobr><code>{"--cwd"}</code></nobr> | Directorio de trabajo |
| <nobr><code>{"--port"}</code></nobr> | Puerto para escuchar |
| <nobr><code>{"--hostname"}</code></nobr> | Nombre de host para escuchar |
---
@@ -499,12 +508,12 @@ opencode uninstall
#### Opciones
| Opción | Corta | Descripción |
| --------------- | ----- | ----------------------------------------- |
| `--keep-config` | `-c` | Mantener archivos de configuración |
| `--keep-data` | `-d` | Conservar datos de sesión e instantáneas |
| `--dry-run` | | Mostrar lo que se eliminaría sin eliminar |
| `--force` | `-f` | Saltar mensajes de confirmación |
| Opción | Corta | Descripción |
| ------------------------------------------- | ----- | ----------------------------------------- |
| <nobr><code>{"--keep-config"}</code></nobr> | `-c` | Mantener archivos de configuración |
| <nobr><code>{"--keep-data"}</code></nobr> | `-d` | Conservar datos de sesión e instantáneas |
| <nobr><code>{"--dry-run"}</code></nobr> | | Mostrar lo que se eliminaría sin eliminar |
| <nobr><code>{"--force"}</code></nobr> | `-f` | Saltar mensajes de confirmación |
---
@@ -530,9 +539,9 @@ opencode upgrade v0.1.48
#### Opciones
| Opción | Corta | Descripción |
| ---------- | ----- | ------------------------------------------------------------------- |
| `--method` | `-m` | El método de instalación que se utilizó; curl, npm, pnpm, bun, brew |
| Opción | Corta | Descripción |
| -------------------------------------- | ----- | ------------------------------------------------------------------- |
| <nobr><code>{"--method"}</code></nobr> | `-m` | El método de instalación que se utilizó; curl, npm, pnpm, bun, brew |
---
@@ -540,12 +549,12 @@ opencode upgrade v0.1.48
La CLI de OpenCode toma las siguientes banderas globales.
| Opción | Corta | Descripción |
| -------------- | ----- | -------------------------------------------- |
| `--help` | `-h` | Mostrar ayuda |
| `--version` | `-v` | Número de versión de impresión |
| `--print-logs` | | Imprimir registros en stderr |
| `--log-level` | | Nivel de registro (DEBUG, INFO, WARN, ERROR) |
| Opción | Corta | Descripción |
| ------------------------------------------ | ----- | -------------------------------------------- |
| <nobr><code>{"--help"}</code></nobr> | `-h` | Mostrar ayuda |
| <nobr><code>{"--version"}</code></nobr> | `-v` | Número de versión de impresión |
| <nobr><code>{"--print-logs"}</code></nobr> | | Imprimir registros en stderr |
| <nobr><code>{"--log-level"}</code></nobr> | | Nivel de registro (DEBUG, INFO, WARN, ERROR) |
---

View File

@@ -29,16 +29,16 @@ opencode [project]
#### Options
| Option | Court | Description |
| ------------ | ----- | ----------------------------------------------------------------------------- |
| `--continue` | `-c` | Continuer la dernière session |
| `--session` | `-s` | ID de session pour continuer |
| `--fork` | | Forker la session en continuant (à utiliser avec `--continue` ou `--session`) |
| `--prompt` | | Prompt à utiliser |
| `--model` | `-m` | Modèle à utiliser sous forme de fournisseur/modèle |
| `--agent` | | Agent à utiliser |
| `--port` | | Port d'écoute |
| `--hostname` | | Nom d'hôte d'écoute |
| Option | Court | Description |
| ---------------------------------------- | ----- | ----------------------------------------------------------------------------- |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Continuer la dernière session |
| <nobr><code>{"--session"}</code></nobr> | `-s` | ID de session pour continuer |
| <nobr><code>{"--fork"}</code></nobr> | | Forker la session en continuant (à utiliser avec `--continue` ou `--session`) |
| <nobr><code>{"--prompt"}</code></nobr> | | Prompt à utiliser |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Modèle à utiliser sous forme de fournisseur/modèle |
| <nobr><code>{"--agent"}</code></nobr> | | Agent à utiliser |
| <nobr><code>{"--port"}</code></nobr> | | Port d'écoute |
| <nobr><code>{"--hostname"}</code></nobr> | | Nom d'hôte d'écoute |
---
@@ -78,10 +78,14 @@ opencode attach http://10.20.30.40:4096
#### Options
| Option | Court | Description |
| ----------- | ----- | ---------------------------------------------- |
| `--dir` | | Répertoire de travail dans lequel démarrer TUI |
| `--session` | `-s` | ID de session pour continuer |
| Option | Court | Description |
| ---------------------------------------- | ----- | -------------------------------------------------------------------------------------------------- |
| <nobr><code>{"--dir"}</code></nobr> | | Répertoire de travail dans lequel démarrer TUI |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Continuer la dernière session |
| <nobr><code>{"--session"}</code></nobr> | `-s` | ID de session pour continuer |
| <nobr><code>{"--fork"}</code></nobr> | | Dupliquer la session lors de la reprise (à utiliser avec `--continue` ou `--session`) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Mot de passe d'authentification de base (par défaut `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Nom d'utilisateur d'authentification de base (par défaut `OPENCODE_SERVER_USERNAME` ou `opencode`) |
---
@@ -187,10 +191,10 @@ opencode github run
##### Options
| Option | Description |
| --------- | ---------------------------------------------------- |
| `--event` | Événement simulé GitHub pour lequel exécuter l'agent |
| `--token` | Jeton d'accès personnel GitHub |
| Option | Description |
| ------------------------------------- | ---------------------------------------------------- |
| <nobr><code>{"--event"}</code></nobr> | Événement simulé GitHub pour lequel exécuter l'agent |
| <nobr><code>{"--token"}</code></nobr> | Jeton d'accès personnel GitHub |
---
@@ -296,10 +300,10 @@ opencode models anthropic
#### Options
| Option | Description |
| ----------- | ------------------------------------------------------------------------------------------ |
| `--refresh` | Actualisez le cache des modèles à partir de models.dev |
| `--verbose` | Utiliser une sortie de modèle plus détaillée (inclut des métadonnées telles que les coûts) |
| Option | Description |
| --------------------------------------- | ------------------------------------------------------------------------------------------ |
| <nobr><code>{"--refresh"}</code></nobr> | Actualisez le cache des modèles à partir de models.dev |
| <nobr><code>{"--verbose"}</code></nobr> | Utiliser une sortie de modèle plus détaillée (inclut des métadonnées telles que les coûts) |
Utilisez l'option `--refresh` pour mettre à jour la liste des modèles mis en cache. Ceci est utile lorsque de nouveaux modèles ont été ajoutés à un fournisseur et que vous souhaitez les voir dans OpenCode.
@@ -335,20 +339,25 @@ opencode run --attach http://localhost:4096 "Explain async/await in JavaScript"
#### Options
| Option | Court | Description |
| ------------ | ----- | ---------------------------------------------------------------------------------------------- |
| `--command` | | La commande à exécuter, utilisez le message pour les arguments |
| `--continue` | `-c` | Continuer la dernière session |
| `--session` | `-s` | ID de session pour continuer |
| `--fork` | | Forker la session en continuant (à utiliser avec `--continue` ou `--session`) |
| `--share` | | Partager la session |
| `--model` | `-m` | Modèle à utiliser sous forme de fournisseur/modèle |
| `--agent` | | Agent à utiliser |
| `--file` | `-f` | Fichier(s) à joindre au message |
| `--format` | | Format : par défaut (formaté) ou json (événements JSON bruts) |
| `--title` | | Titre de la session (utilise un prompt tronqué si aucune valeur n'est fournie) |
| `--attach` | | Connectez-vous à un serveur opencode en cours d'exécution (par exemple, http://localhost:4096) |
| `--port` | | Port du serveur local (port aléatoire par défaut) |
| Option | Court | Description |
| ---------------------------------------- | ----- | -------------------------------------------------------------------------------------------------- |
| <nobr><code>{"--command"}</code></nobr> | | La commande à exécuter, utilisez le message pour les arguments |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Continuer la dernière session |
| <nobr><code>{"--session"}</code></nobr> | `-s` | ID de session pour continuer |
| <nobr><code>{"--fork"}</code></nobr> | | Forker la session en continuant (à utiliser avec `--continue` ou `--session`) |
| <nobr><code>{"--share"}</code></nobr> | | Partager la session |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Modèle à utiliser sous forme de fournisseur/modèle |
| <nobr><code>{"--agent"}</code></nobr> | | Agent à utiliser |
| <nobr><code>{"--file"}</code></nobr> | `-f` | Fichier(s) à joindre au message |
| <nobr><code>{"--format"}</code></nobr> | | Format : par défaut (formaté) ou json (événements JSON bruts) |
| <nobr><code>{"--title"}</code></nobr> | | Titre de la session (utilise un prompt tronqué si aucune valeur n'est fournie) |
| <nobr><code>{"--attach"}</code></nobr> | | Connectez-vous à un serveur opencode en cours d'exécution (par exemple, http://localhost:4096) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Mot de passe d'authentification de base (par défaut `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Nom d'utilisateur d'authentification de base (par défaut `OPENCODE_SERVER_USERNAME` ou `opencode`) |
| <nobr><code>{"--dir"}</code></nobr> | | Répertoire d'exécution, ou chemin sur le serveur distant lors de l'attachement |
| <nobr><code>{"--variant"}</code></nobr> | | Variante du modèle (effort de raisonnement spécifique au fournisseur) |
| <nobr><code>{"--thinking"}</code></nobr> | | Afficher les blocs de réflexion |
| <nobr><code>{"--port"}</code></nobr> | | Port du serveur local (port aléatoire par défaut) |
---
@@ -364,12 +373,12 @@ Cela démarre un serveur HTTP qui fournit un accès API aux fonctionnalités d'O
#### Options
| Option | Description |
| ------------ | ---------------------------------------------------------- |
| `--port` | Port d'écoute |
| `--hostname` | Nom d'hôte d'écoute |
| `--mdns` | Activer la découverte mDNS |
| `--cors` | Origines de navigateur supplémentaires pour autoriser CORS |
| Option | Description |
| ---------------------------------------- | ---------------------------------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | Port d'écoute |
| <nobr><code>{"--hostname"}</code></nobr> | Nom d'hôte d'écoute |
| <nobr><code>{"--mdns"}</code></nobr> | Activer la découverte mDNS |
| <nobr><code>{"--cors"}</code></nobr> | Origines de navigateur supplémentaires pour autoriser CORS |
---
@@ -393,10 +402,10 @@ opencode session list
##### Options
| Option | Court | Description |
| ------------- | ----- | -------------------------------------------- |
| `--max-count` | `-n` | Limiter aux N sessions les plus récentes |
| `--format` | | Format de sortie : tableau ou json (tableau) |
| Option | Court | Description |
| ----------------------------------------- | ----- | -------------------------------------------- |
| <nobr><code>{"--max-count"}</code></nobr> | `-n` | Limiter aux N sessions les plus récentes |
| <nobr><code>{"--format"}</code></nobr> | | Format de sortie : tableau ou json (tableau) |
---
@@ -410,12 +419,12 @@ opencode stats
#### Options
| Option | Description |
| ----------- | --------------------------------------------------------------------------------------------------------------------- |
| `--days` | Afficher les statistiques des N derniers jours (depuis le début) |
| `--tools` | Nombre d'outils à afficher (tous) |
| `--models` | Afficher la répartition de l'utilisation du modèle (masqué par défaut). Passez un numéro pour afficher les N premiers |
| `--project` | Filtrer par projet (tous les projets, chaîne vide : projet actuel) |
| Option | Description |
| --------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| <nobr><code>{"--days"}</code></nobr> | Afficher les statistiques des N derniers jours (depuis le début) |
| <nobr><code>{"--tools"}</code></nobr> | Nombre d'outils à afficher (tous) |
| <nobr><code>{"--models"}</code></nobr> | Afficher la répartition de l'utilisation du modèle (masqué par défaut). Passez un numéro pour afficher les N premiers |
| <nobr><code>{"--project"}</code></nobr> | Filtrer par projet (tous les projets, chaîne vide : projet actuel) |
---
@@ -460,12 +469,12 @@ Cela démarre un serveur HTTP et ouvre un navigateur Web pour accéder à OpenCo
#### Options
| Option | Description |
| ------------ | ---------------------------------------------------------- |
| `--port` | Port d'écoute |
| `--hostname` | Nom d'hôte d'écoute |
| `--mdns` | Activer la découverte mDNS |
| `--cors` | Origines de navigateur supplémentaires pour autoriser CORS |
| Option | Description |
| ---------------------------------------- | ---------------------------------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | Port d'écoute |
| <nobr><code>{"--hostname"}</code></nobr> | Nom d'hôte d'écoute |
| <nobr><code>{"--mdns"}</code></nobr> | Activer la découverte mDNS |
| <nobr><code>{"--cors"}</code></nobr> | Origines de navigateur supplémentaires pour autoriser CORS |
---
@@ -481,11 +490,11 @@ Cette commande démarre un serveur ACP qui communique via stdin/stdout en utilis
#### Options
| Option | Description |
| ------------ | --------------------- |
| `--cwd` | Répertoire de travail |
| `--port` | Port d'écoute |
| `--hostname` | Nom d'hôte d'écoute |
| Option | Description |
| ---------------------------------------- | --------------------- |
| <nobr><code>{"--cwd"}</code></nobr> | Répertoire de travail |
| <nobr><code>{"--port"}</code></nobr> | Port d'écoute |
| <nobr><code>{"--hostname"}</code></nobr> | Nom d'hôte d'écoute |
---
@@ -499,12 +508,12 @@ opencode uninstall
#### Options
| Option | Court | Description |
| --------------- | ----- | --------------------------------------------------- |
| `--keep-config` | `-c` | Conserver les fichiers de configuration |
| `--keep-data` | `-d` | Conserver les données de session et les instantanés |
| `--dry-run` | | Afficher ce qui serait supprimé sans supprimer |
| `--force` | `-f` | Ignorer les invites de confirmation |
| Option | Court | Description |
| ------------------------------------------- | ----- | --------------------------------------------------- |
| <nobr><code>{"--keep-config"}</code></nobr> | `-c` | Conserver les fichiers de configuration |
| <nobr><code>{"--keep-data"}</code></nobr> | `-d` | Conserver les données de session et les instantanés |
| <nobr><code>{"--dry-run"}</code></nobr> | | Afficher ce qui serait supprimé sans supprimer |
| <nobr><code>{"--force"}</code></nobr> | `-f` | Ignorer les invites de confirmation |
---
@@ -530,9 +539,9 @@ opencode upgrade v0.1.48
#### Options
| Option | Court | Description |
| ---------- | ----- | --------------------------------------------------------------- |
| `--method` | `-m` | La méthode d'installation utilisée ; curl, npm, pnpm, bun, brew |
| Option | Court | Description |
| -------------------------------------- | ----- | --------------------------------------------------------------- |
| <nobr><code>{"--method"}</code></nobr> | `-m` | La méthode d'installation utilisée ; curl, npm, pnpm, bun, brew |
---
@@ -540,12 +549,12 @@ opencode upgrade v0.1.48
La CLI opencode prend les flags globaux suivants.
| Option | Court | Description |
| -------------- | ----- | ---------------------------------------- |
| `--help` | `-h` | Afficher l'aide |
| `--version` | `-v` | Afficher le numéro de version |
| `--print-logs` | | Afficher les logs sur stderr |
| `--log-level` | | Niveau de log (DEBUG, INFO, WARN, ERROR) |
| Option | Court | Description |
| ------------------------------------------ | ----- | ---------------------------------------- |
| <nobr><code>{"--help"}</code></nobr> | `-h` | Afficher l'aide |
| <nobr><code>{"--version"}</code></nobr> | `-v` | Afficher le numéro de version |
| <nobr><code>{"--print-logs"}</code></nobr> | | Afficher les logs sur stderr |
| <nobr><code>{"--log-level"}</code></nobr> | | Niveau de log (DEBUG, INFO, WARN, ERROR) |
---

View File

@@ -29,16 +29,16 @@ opencode [project]
#### Flag
| Flag | Breve | Descrizione |
| ------------ | ----- | ------------------------------------------------------------------------ |
| `--continue` | `-c` | Continua l'ultima sessione |
| `--session` | `-s` | ID sessione da continuare |
| `--fork` | | Duplica la sessione quando continui (usa con `--continue` o `--session`) |
| `--prompt` | | Prompt da usare |
| `--model` | `-m` | Modello nel formato provider/model |
| `--agent` | | Agente da usare |
| `--port` | | Porta su cui mettersi in ascolto |
| `--hostname` | | Hostname su cui mettersi in ascolto |
| Flag | Breve | Descrizione |
| ---------------------------------------- | ----- | ------------------------------------------------------------------------ |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Continua l'ultima sessione |
| <nobr><code>{"--session"}</code></nobr> | `-s` | ID sessione da continuare |
| <nobr><code>{"--fork"}</code></nobr> | | Duplica la sessione quando continui (usa con `--continue` o `--session`) |
| <nobr><code>{"--prompt"}</code></nobr> | | Prompt da usare |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Modello nel formato provider/model |
| <nobr><code>{"--agent"}</code></nobr> | | Agente da usare |
| <nobr><code>{"--port"}</code></nobr> | | Porta su cui mettersi in ascolto |
| <nobr><code>{"--hostname"}</code></nobr> | | Hostname su cui mettersi in ascolto |
---
@@ -78,10 +78,14 @@ opencode attach http://10.20.30.40:4096
#### Flag
| Flag | Breve | Descrizione |
| ----------- | ----- | --------------------------------------- |
| `--dir` | | Working directory in cui avviare la TUI |
| `--session` | `-s` | ID sessione da continuare |
| Flag | Breve | Descrizione |
| ---------------------------------------- | ----- | ----------------------------------------------------------------------------------------------- |
| <nobr><code>{"--dir"}</code></nobr> | | Working directory in cui avviare la TUI |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Continua l'ultima sessione |
| <nobr><code>{"--session"}</code></nobr> | `-s` | ID sessione da continuare |
| <nobr><code>{"--fork"}</code></nobr> | | Crea un fork della sessione durante la continuazione (usa con `--continue` o `--session`) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Password per l'autenticazione di base (predefinita: `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Nome utente per l'autenticazione di base (predefinito: `OPENCODE_SERVER_USERNAME` o `opencode`) |
---
@@ -187,10 +191,10 @@ opencode github run
##### Flag
| Flag | Descrizione |
| --------- | -------------------------------------------- |
| `--event` | Evento GitHub mock per cui eseguire l'agente |
| `--token` | GitHub personal access token |
| Flag | Descrizione |
| ------------------------------------- | -------------------------------------------- |
| <nobr><code>{"--event"}</code></nobr> | Evento GitHub mock per cui eseguire l'agente |
| <nobr><code>{"--token"}</code></nobr> | GitHub personal access token |
---
@@ -296,10 +300,10 @@ opencode models anthropic
#### Flag
| Flag | Descrizione |
| ----------- | -------------------------------------------------- |
| `--refresh` | Aggiorna la cache modelli da models.dev |
| `--verbose` | Output più verboso (include metadati come i costi) |
| Flag | Descrizione |
| --------------------------------------- | -------------------------------------------------- |
| <nobr><code>{"--refresh"}</code></nobr> | Aggiorna la cache modelli da models.dev |
| <nobr><code>{"--verbose"}</code></nobr> | Output più verboso (include metadati come i costi) |
Usa `--refresh` per aggiornare l'elenco modelli in cache. È utile quando nuovi modelli vengono aggiunti a un provider e vuoi vederli in OpenCode.
@@ -335,20 +339,25 @@ opencode run --attach http://localhost:4096 "Explain async/await in JavaScript"
#### Flag
| Flag | Breve | Descrizione |
| ------------ | ----- | ------------------------------------------------------------------------ |
| `--command` | | Il comando da eseguire; usa message per gli argomenti |
| `--continue` | `-c` | Continua l'ultima sessione |
| `--session` | `-s` | ID sessione da continuare |
| `--fork` | | Duplica la sessione quando continui (usa con `--continue` o `--session`) |
| `--share` | | Condividi la sessione |
| `--model` | `-m` | Modello nel formato provider/model |
| `--agent` | | Agente da usare |
| `--file` | `-f` | File da allegare al messaggio |
| `--format` | | Formato: default (formattato) o json (eventi JSON grezzi) |
| `--title` | | Titolo sessione (usa prompt troncato se non viene fornito un valore) |
| `--attach` | | Attach a un server opencode in esecuzione (es. http://localhost:4096) |
| `--port` | | Porta per il server locale (di default una porta casuale) |
| Flag | Breve | Descrizione |
| ---------------------------------------- | ----- | ----------------------------------------------------------------------------------------------- |
| <nobr><code>{"--command"}</code></nobr> | | Il comando da eseguire; usa message per gli argomenti |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Continua l'ultima sessione |
| <nobr><code>{"--session"}</code></nobr> | `-s` | ID sessione da continuare |
| <nobr><code>{"--fork"}</code></nobr> | | Duplica la sessione quando continui (usa con `--continue` o `--session`) |
| <nobr><code>{"--share"}</code></nobr> | | Condividi la sessione |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Modello nel formato provider/model |
| <nobr><code>{"--agent"}</code></nobr> | | Agente da usare |
| <nobr><code>{"--file"}</code></nobr> | `-f` | File da allegare al messaggio |
| <nobr><code>{"--format"}</code></nobr> | | Formato: default (formattato) o json (eventi JSON grezzi) |
| <nobr><code>{"--title"}</code></nobr> | | Titolo sessione (usa prompt troncato se non viene fornito un valore) |
| <nobr><code>{"--attach"}</code></nobr> | | Attach a un server opencode in esecuzione (es. http://localhost:4096) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Password per l'autenticazione di base (predefinita: `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Nome utente per l'autenticazione di base (predefinito: `OPENCODE_SERVER_USERNAME` o `opencode`) |
| <nobr><code>{"--dir"}</code></nobr> | | Directory di esecuzione, o percorso sul server remoto durante il collegamento |
| <nobr><code>{"--variant"}</code></nobr> | | Variante del modello (sforzo di ragionamento specifico del provider) |
| <nobr><code>{"--thinking"}</code></nobr> | | Mostra blocchi di pensiero |
| <nobr><code>{"--port"}</code></nobr> | | Porta per il server locale (di default una porta casuale) |
---
@@ -364,12 +373,12 @@ Avvia un server HTTP che espone accesso API alle funzionalità di opencode senza
#### Flag
| Flag | Descrizione |
| ------------ | ---------------------------------------------- |
| `--port` | Porta su cui mettersi in ascolto |
| `--hostname` | Hostname su cui mettersi in ascolto |
| `--mdns` | Abilita discovery mDNS |
| `--cors` | Origin browser addizionali per consentire CORS |
| Flag | Descrizione |
| ---------------------------------------- | ---------------------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | Porta su cui mettersi in ascolto |
| <nobr><code>{"--hostname"}</code></nobr> | Hostname su cui mettersi in ascolto |
| <nobr><code>{"--mdns"}</code></nobr> | Abilita discovery mDNS |
| <nobr><code>{"--cors"}</code></nobr> | Origin browser addizionali per consentire CORS |
---
@@ -393,10 +402,10 @@ opencode session list
##### Flag
| Flag | Breve | Descrizione |
| ------------- | ----- | ------------------------------------ |
| `--max-count` | `-n` | Limita alle N sessioni più recenti |
| `--format` | | Formato output: table o json (table) |
| Flag | Breve | Descrizione |
| ----------------------------------------- | ----- | ------------------------------------ |
| <nobr><code>{"--max-count"}</code></nobr> | `-n` | Limita alle N sessioni più recenti |
| <nobr><code>{"--format"}</code></nobr> | | Formato output: table o json (table) |
---
@@ -410,12 +419,12 @@ opencode stats
#### Flag
| Flag | Descrizione |
| ----------- | ------------------------------------------------------------------------------------- |
| `--days` | Mostra statistiche per gli ultimi N giorni (all time) |
| `--tools` | Numero di strumenti da mostrare (all) |
| `--models` | Mostra breakdown di utilizzo modelli (nascosto di default). Passa un numero per top N |
| `--project` | Filtra per progetto (tutti i progetti; stringa vuota: progetto corrente) |
| Flag | Descrizione |
| --------------------------------------- | ------------------------------------------------------------------------------------- |
| <nobr><code>{"--days"}</code></nobr> | Mostra statistiche per gli ultimi N giorni (all time) |
| <nobr><code>{"--tools"}</code></nobr> | Numero di strumenti da mostrare (all) |
| <nobr><code>{"--models"}</code></nobr> | Mostra breakdown di utilizzo modelli (nascosto di default). Passa un numero per top N |
| <nobr><code>{"--project"}</code></nobr> | Filtra per progetto (tutti i progetti; stringa vuota: progetto corrente) |
---
@@ -460,12 +469,12 @@ Avvia un server HTTP e apre un browser per accedere a OpenCode tramite interfacc
#### Flag
| Flag | Descrizione |
| ------------ | ---------------------------------------------- |
| `--port` | Porta su cui mettersi in ascolto |
| `--hostname` | Hostname su cui mettersi in ascolto |
| `--mdns` | Abilita discovery mDNS |
| `--cors` | Origin browser addizionali per consentire CORS |
| Flag | Descrizione |
| ---------------------------------------- | ---------------------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | Porta su cui mettersi in ascolto |
| <nobr><code>{"--hostname"}</code></nobr> | Hostname su cui mettersi in ascolto |
| <nobr><code>{"--mdns"}</code></nobr> | Abilita discovery mDNS |
| <nobr><code>{"--cors"}</code></nobr> | Origin browser addizionali per consentire CORS |
---
@@ -481,11 +490,11 @@ Questo comando avvia un server ACP che comunica via stdin/stdout usando nd-JSON.
#### Flag
| Flag | Descrizione |
| ------------ | ----------------------------------- |
| `--cwd` | Directory di lavoro |
| `--port` | Porta su cui mettersi in ascolto |
| `--hostname` | Hostname su cui mettersi in ascolto |
| Flag | Descrizione |
| ---------------------------------------- | ----------------------------------- |
| <nobr><code>{"--cwd"}</code></nobr> | Directory di lavoro |
| <nobr><code>{"--port"}</code></nobr> | Porta su cui mettersi in ascolto |
| <nobr><code>{"--hostname"}</code></nobr> | Hostname su cui mettersi in ascolto |
---
@@ -499,12 +508,12 @@ opencode uninstall
#### Flag
| Flag | Breve | Descrizione |
| --------------- | ----- | -------------------------------------------- |
| `--keep-config` | `-c` | Mantieni i file di configurazione |
| `--keep-data` | `-d` | Mantieni dati di sessione e snapshot |
| `--dry-run` | | Mostra cosa verrebbe rimosso senza rimuovere |
| `--force` | `-f` | Salta le richieste di conferma |
| Flag | Breve | Descrizione |
| ------------------------------------------- | ----- | -------------------------------------------- |
| <nobr><code>{"--keep-config"}</code></nobr> | `-c` | Mantieni i file di configurazione |
| <nobr><code>{"--keep-data"}</code></nobr> | `-d` | Mantieni dati di sessione e snapshot |
| <nobr><code>{"--dry-run"}</code></nobr> | | Mostra cosa verrebbe rimosso senza rimuovere |
| <nobr><code>{"--force"}</code></nobr> | `-f` | Salta le richieste di conferma |
---
@@ -530,9 +539,9 @@ opencode upgrade v0.1.48
#### Flag
| Flag | Breve | Descrizione |
| ---------- | ----- | --------------------------------------------------------- |
| `--method` | `-m` | Metodo di installazione usato: curl, npm, pnpm, bun, brew |
| Flag | Breve | Descrizione |
| -------------------------------------- | ----- | --------------------------------------------------------- |
| <nobr><code>{"--method"}</code></nobr> | `-m` | Metodo di installazione usato: curl, npm, pnpm, bun, brew |
---
@@ -540,12 +549,12 @@ opencode upgrade v0.1.48
La CLI di opencode accetta i seguenti flag globali.
| Flag | Breve | Descrizione |
| -------------- | ----- | -------------------------------------- |
| `--help` | `-h` | Mostra l'help |
| `--version` | `-v` | Stampa il numero di versione |
| `--print-logs` | | Stampa i log su stderr |
| `--log-level` | | Livello log (DEBUG, INFO, WARN, ERROR) |
| Flag | Breve | Descrizione |
| ------------------------------------------ | ----- | -------------------------------------- |
| <nobr><code>{"--help"}</code></nobr> | `-h` | Mostra l'help |
| <nobr><code>{"--version"}</code></nobr> | `-v` | Stampa il numero di versione |
| <nobr><code>{"--print-logs"}</code></nobr> | | Stampa i log su stderr |
| <nobr><code>{"--log-level"}</code></nobr> | | Livello log (DEBUG, INFO, WARN, ERROR) |
---

View File

@@ -29,16 +29,16 @@ opencode [project]
#### フラグ
| フラグ | ショート | 説明 |
| ------------ | ----------- | ---------------------------------------------------------- |
| `--continue` | `-c` | 最後のセッションを続行 |
| `--session` | | 続行時にセッションをフォーク (`-s` または `--fork` と併用) |
| `--continue` | `--session` | 続行するセッション ID |
| `--prompt` | | 使用のプロンプト |
| `--model` | `-m` | プロバイダー/モデルの形式で使用するモデル |
| `--agent` | | 使用するエージェント |
| `--port` | | リッスンするポート |
| `--hostname` | | リッスンするホスト名 |
| フラグ | ショート | 説明 |
| ---------------------------------------- | --------------------------------------- | ---------------------------------------------------------- |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | 最後のセッションを続行 |
| <nobr><code>{"--session"}</code></nobr> | | 続行時にセッションをフォーク (`-s` または `--fork` と併用) |
| <nobr><code>{"--continue"}</code></nobr> | <nobr><code>{"--session"}</code></nobr> | 続行するセッション ID |
| <nobr><code>{"--prompt"}</code></nobr> | | 使用のプロンプト |
| <nobr><code>{"--model"}</code></nobr> | `-m` | プロバイダー/モデルの形式で使用するモデル |
| <nobr><code>{"--agent"}</code></nobr> | | 使用するエージェント |
| <nobr><code>{"--port"}</code></nobr> | | リッスンするポート |
| <nobr><code>{"--hostname"}</code></nobr> | | リッスンするホスト名 |
---
@@ -78,10 +78,14 @@ opencode attach http://10.20.30.40:4096
#### フラグ
| フラグ | ショート | 説明 |
| ----------- | -------- | ------------------------------ |
| `--dir` | | TUI を開始する作業ディレクトリ |
| `--session` | `-s` | 続行するセッション ID |
| フラグ | ショート | 説明 |
| ---------------------------------------- | -------- | --------------------------------------------------------------------------------- |
| <nobr><code>{"--dir"}</code></nobr> | | TUI を開始する作業ディレクトリ |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | 最後のセッションを続行 |
| <nobr><code>{"--session"}</code></nobr> | `-s` | 続行するセッション ID |
| <nobr><code>{"--fork"}</code></nobr> | | 続行時にセッションをフォーク(`--continue` または `--session` と使用) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Basic 認証パスワード(デフォルトは `OPENCODE_SERVER_PASSWORD` |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Basic 認証ユーザー名(デフォルトは `OPENCODE_SERVER_USERNAME` または `opencode` |
---
@@ -187,10 +191,10 @@ opencode github run
##### フラグ
| フラグ | 説明 |
| --------- | --------------------------------------------------- |
| `--event` | エージェントを実行するための GitHub モック イベント |
| `--token` | GitHub 個人アクセストークン |
| フラグ | 説明 |
| ------------------------------------- | --------------------------------------------------- |
| <nobr><code>{"--event"}</code></nobr> | エージェントを実行するための GitHub モック イベント |
| <nobr><code>{"--token"}</code></nobr> | GitHub 個人アクセストークン |
---
@@ -296,10 +300,10 @@ opencode models anthropic
#### フラグ
| フラグ | 説明 |
| ----------- | --------------------------------------------------------------- |
| `--refresh` | models.dev からモデルキャッシュを更新します。 |
| `--verbose` | より詳細なモデル出力を使用します (コストなどのメタデータを含む) |
| フラグ | 説明 |
| --------------------------------------- | --------------------------------------------------------------- |
| <nobr><code>{"--refresh"}</code></nobr> | models.dev からモデルキャッシュを更新します。 |
| <nobr><code>{"--verbose"}</code></nobr> | より詳細なモデル出力を使用します (コストなどのメタデータを含む) |
`--refresh` フラグを使用して、キャッシュされたモデルリストを更新します。これは、新しいモデルがプロバイダーに追加され、それを OpenCode で確認したい場合に便利です。
@@ -335,20 +339,25 @@ opencode run --attach http://localhost:4096 "Explain async/await in JavaScript"
#### フラグ
| フラグ | ショート | 説明 |
| ------------ | -------- | ----------------------------------------------------------------------------------------- |
| `--command` | | 実行するコマンド。引数には message を使用します。 |
| `--continue` | `-c` | 最後のセッションを続行 |
| `--session` | `-s` | 続行するセッション ID |
| `--fork` | | 続行時にセッションをフォーク (`--continue` または `--session` と併用) |
| `--share` | | セッションを共有する |
| `--model` | `-m` | プロバイダー/モデルの形式で使用するモデル |
| `--agent` | | 使用するエージェント |
| `--file` | `-f` | メッセージに添付するファイル |
| `--format` | | 形式: デフォルト (フォーマット済み) または json (生の JSON イベント) |
| `--title` | | セッションのタイトル (値が指定されていない場合は、切り詰められたプロンプトが使用されます) |
| `--attach` | | 実行中の opencode サーバー (http://localhost:4096 など) に接続します。 |
| `--port` | | ローカルサーバーのポート (デフォルトはランダムポート) |
| フラグ | ショート | 説明 |
| ---------------------------------------- | -------- | ----------------------------------------------------------------------------------------- |
| <nobr><code>{"--command"}</code></nobr> | | 実行するコマンド。引数には message を使用します。 |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | 最後のセッションを続行 |
| <nobr><code>{"--session"}</code></nobr> | `-s` | 続行するセッション ID |
| <nobr><code>{"--fork"}</code></nobr> | | 続行時にセッションをフォーク (`--continue` または `--session` と併用) |
| <nobr><code>{"--share"}</code></nobr> | | セッションを共有する |
| <nobr><code>{"--model"}</code></nobr> | `-m` | プロバイダー/モデルの形式で使用するモデル |
| <nobr><code>{"--agent"}</code></nobr> | | 使用するエージェント |
| <nobr><code>{"--file"}</code></nobr> | `-f` | メッセージに添付するファイル |
| <nobr><code>{"--format"}</code></nobr> | | 形式: デフォルト (フォーマット済み) または json (生の JSON イベント) |
| <nobr><code>{"--title"}</code></nobr> | | セッションのタイトル (値が指定されていない場合は、切り詰められたプロンプトが使用されます) |
| <nobr><code>{"--attach"}</code></nobr> | | 実行中の opencode サーバー (http://localhost:4096 など) に接続します。 |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Basic 認証パスワード(デフォルトは `OPENCODE_SERVER_PASSWORD` |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Basic 認証ユーザー名(デフォルトは `OPENCODE_SERVER_USERNAME` または `opencode` |
| <nobr><code>{"--dir"}</code></nobr> | | 実行ディレクトリ、またはアタッチ時のリモートサーバー上のパス |
| <nobr><code>{"--variant"}</code></nobr> | | モデルバリアント(プロバイダー固有の推論レベル) |
| <nobr><code>{"--thinking"}</code></nobr> | | 思考ブロックを表示 |
| <nobr><code>{"--port"}</code></nobr> | | ローカルサーバーのポート (デフォルトはランダムポート) |
---
@@ -364,12 +373,12 @@ opencode serve
#### フラグ
| フラグ | 説明 |
| ------------ | --------------------------------------- |
| `--port` | リッスンするポート |
| `--hostname` | リッスンするホスト名 |
| `--mdns` | mDNS 検出を有効にする |
| `--cors` | CORS を許可する追加のブラウザーオリジン |
| フラグ | 説明 |
| ---------------------------------------- | --------------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | リッスンするポート |
| <nobr><code>{"--hostname"}</code></nobr> | リッスンするホスト名 |
| <nobr><code>{"--mdns"}</code></nobr> | mDNS 検出を有効にする |
| <nobr><code>{"--cors"}</code></nobr> | CORS を許可する追加のブラウザーオリジン |
---
@@ -393,10 +402,10 @@ opencode session list
##### フラグ
| フラグ | ショート | 説明 |
| ------------- | -------- | ---------------------------------------- |
| `--max-count` | `-n` | 最新のセッションを N 個に制限 |
| `--format` | | 出力形式: テーブルまたは json (テーブル) |
| フラグ | ショート | 説明 |
| ----------------------------------------- | -------- | ---------------------------------------- |
| <nobr><code>{"--max-count"}</code></nobr> | `-n` | 最新のセッションを N 個に制限 |
| <nobr><code>{"--format"}</code></nobr> | | 出力形式: テーブルまたは json (テーブル) |
---
@@ -410,12 +419,12 @@ opencode stats
#### フラグ
| フラグ | 説明 |
| ----------- | ------------------------------------------------------------------------------------------ |
| `--days` | 過去 N 日間の統計を表示 (全期間) |
| `--tools` | 表示するツールの数 (すべて) |
| `--models` | モデルの使用状況の内訳を表示 (デフォルトでは非表示)。上位 N 件を表示するには数値を渡します |
| `--project` | プロジェクトでフィルタリング (全プロジェクト、空文字列: 現在のプロジェクト) |
| フラグ | 説明 |
| --------------------------------------- | ------------------------------------------------------------------------------------------ |
| <nobr><code>{"--days"}</code></nobr> | 過去 N 日間の統計を表示 (全期間) |
| <nobr><code>{"--tools"}</code></nobr> | 表示するツールの数 (すべて) |
| <nobr><code>{"--models"}</code></nobr> | モデルの使用状況の内訳を表示 (デフォルトでは非表示)。上位 N 件を表示するには数値を渡します |
| <nobr><code>{"--project"}</code></nobr> | プロジェクトでフィルタリング (全プロジェクト、空文字列: 現在のプロジェクト) |
---
@@ -460,12 +469,12 @@ opencode web
#### フラグ
| フラグ | 説明 |
| ------------ | --------------------------------------- |
| `--port` | リッスンするポート |
| `--hostname` | リッスンするホスト名 |
| `--mdns` | mDNS 検出を有効にする |
| `--cors` | CORS を許可する追加のブラウザーオリジン |
| フラグ | 説明 |
| ---------------------------------------- | --------------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | リッスンするポート |
| <nobr><code>{"--hostname"}</code></nobr> | リッスンするホスト名 |
| <nobr><code>{"--mdns"}</code></nobr> | mDNS 検出を有効にする |
| <nobr><code>{"--cors"}</code></nobr> | CORS を許可する追加のブラウザーオリジン |
---
@@ -481,11 +490,11 @@ opencode acp
#### フラグ
| フラグ | 説明 |
| ------------ | -------------------- |
| `--cwd` | 作業ディレクトリ |
| `--port` | リッスンするポート |
| `--hostname` | リッスンするホスト名 |
| フラグ | 説明 |
| ---------------------------------------- | -------------------- |
| <nobr><code>{"--cwd"}</code></nobr> | 作業ディレクトリ |
| <nobr><code>{"--port"}</code></nobr> | リッスンするポート |
| <nobr><code>{"--hostname"}</code></nobr> | リッスンするホスト名 |
---
@@ -499,12 +508,12 @@ opencode uninstall
#### フラグ
| フラグ | ショート | 説明 |
| --------------- | -------- | -------------------------------------------- |
| `--keep-config` | `-c` | 構成ファイルを保持する |
| `--keep-data` | `-d` | セッションデータとスナップショットを保持する |
| `--dry-run` | | 削除せずに削除される内容を表示する |
| `--force` | `-f` | 確認プロンプトをスキップする |
| フラグ | ショート | 説明 |
| ------------------------------------------- | -------- | -------------------------------------------- |
| <nobr><code>{"--keep-config"}</code></nobr> | `-c` | 構成ファイルを保持する |
| <nobr><code>{"--keep-data"}</code></nobr> | `-d` | セッションデータとスナップショットを保持する |
| <nobr><code>{"--dry-run"}</code></nobr> | | 削除せずに削除される内容を表示する |
| <nobr><code>{"--force"}</code></nobr> | `-f` | 確認プロンプトをスキップする |
---
@@ -530,9 +539,9 @@ opencode upgrade v0.1.48
#### フラグ
| フラグ | ショート | 説明 |
| ---------- | -------- | ------------------------------------------------------ |
| `--method` | `-m` | 使用されたインストール方法。curl, npm, pnpm, bun, brew |
| フラグ | ショート | 説明 |
| -------------------------------------- | -------- | ------------------------------------------------------ |
| <nobr><code>{"--method"}</code></nobr> | `-m` | 使用されたインストール方法。curl, npm, pnpm, bun, brew |
---
@@ -540,12 +549,12 @@ opencode upgrade v0.1.48
opencode CLI は次のグローバルフラグを受け取ります。
| フラグ | ショート | 説明 |
| -------------- | -------- | ------------------------------------- |
| `--help` | `-h` | ヘルプを表示 |
| `--version` | `-v` | バージョン番号を出力 |
| `--print-logs` | | ログを標準エラー出力に出力 |
| `--log-level` | | ログレベル (DEBUG、INFO、WARN、ERROR) |
| フラグ | ショート | 説明 |
| ------------------------------------------ | -------- | ------------------------------------- |
| <nobr><code>{"--help"}</code></nobr> | `-h` | ヘルプを表示 |
| <nobr><code>{"--version"}</code></nobr> | `-v` | バージョン番号を出力 |
| <nobr><code>{"--print-logs"}</code></nobr> | | ログを標準エラー出力に出力 |
| <nobr><code>{"--log-level"}</code></nobr> | | ログレベル (DEBUG、INFO、WARN、ERROR) |
---

View File

@@ -29,16 +29,16 @@ opencode [project]
#### 플래그
| 플래그 | 축약 | 설명 |
| ------------ | ---- | ---------------------------------------------------------------------- |
| `--continue` | `-c` | 마지막 세션 이어서 실행 |
| `--session` | `-s` | 이어서 실행할 세션 ID |
| `--fork` | | 세션을 이어갈 때 포크 생성 (`--continue` 또는 `--session`과 함께 사용) |
| `--prompt` | | 사용할 프롬프트 |
| `--model` | `-m` | 사용할 모델 (`provider/model` 형식) |
| `--agent` | | 사용할 에이전트 |
| `--port` | | 수신 포트 |
| `--hostname` | | 수신 호스트명 |
| 플래그 | 축약 | 설명 |
| ---------------------------------------- | ---- | ---------------------------------------------------------------------- |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | 마지막 세션 이어서 실행 |
| <nobr><code>{"--session"}</code></nobr> | `-s` | 이어서 실행할 세션 ID |
| <nobr><code>{"--fork"}</code></nobr> | | 세션을 이어갈 때 포크 생성 (`--continue` 또는 `--session`과 함께 사용) |
| <nobr><code>{"--prompt"}</code></nobr> | | 사용할 프롬프트 |
| <nobr><code>{"--model"}</code></nobr> | `-m` | 사용할 모델 (`provider/model` 형식) |
| <nobr><code>{"--agent"}</code></nobr> | | 사용할 에이전트 |
| <nobr><code>{"--port"}</code></nobr> | | 수신 포트 |
| <nobr><code>{"--hostname"}</code></nobr> | | 수신 호스트명 |
---
@@ -78,10 +78,14 @@ opencode attach http://10.20.30.40:4096
#### 플래그
| 플래그 | 축약 | 설명 |
| ----------- | ---- | -------------------------- |
| `--dir` | | TUI를 시작할 작업 디렉터리 |
| `--session` | `-s` | 이어서 실행할 세션 ID |
| 플래그 | 축약 | 설명 |
| ---------------------------------------- | ---- | -------------------------------------------------------------------------- |
| <nobr><code>{"--dir"}</code></nobr> | | TUI를 시작할 작업 디렉터리 |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | 마지막 세션 이어서 실행 |
| <nobr><code>{"--session"}</code></nobr> | `-s` | 이어서 실행할 세션 ID |
| <nobr><code>{"--fork"}</code></nobr> | | 이어서 실행할 때 세션 포크 (`--continue` 또는 `--session`과 함께 사용) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | 기본 인증 비밀번호 (기본값: `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | 기본 인증 사용자 이름 (기본값: `OPENCODE_SERVER_USERNAME` 또는 `opencode`) |
---
@@ -187,10 +191,10 @@ opencode github run
##### 플래그
| 플래그 | 설명 |
| --------- | ------------------------- |
| `--event` | 실행할 GitHub 모의 이벤트 |
| `--token` | GitHub 개인 액세스 토큰 |
| 플래그 | 설명 |
| ------------------------------------- | ------------------------- |
| <nobr><code>{"--event"}</code></nobr> | 실행할 GitHub 모의 이벤트 |
| <nobr><code>{"--token"}</code></nobr> | GitHub 개인 액세스 토큰 |
---
@@ -296,10 +300,10 @@ opencode models anthropic
#### 플래그
| 플래그 | 설명 |
| ----------- | ------------------------------------------------- |
| `--refresh` | models.dev에서 모델 캐시 새로고침 |
| `--verbose` | 더 자세한 모델 출력 사용(비용 등 메타데이터 포함) |
| 플래그 | 설명 |
| --------------------------------------- | ------------------------------------------------- |
| <nobr><code>{"--refresh"}</code></nobr> | models.dev에서 모델 캐시 새로고침 |
| <nobr><code>{"--verbose"}</code></nobr> | 더 자세한 모델 출력 사용(비용 등 메타데이터 포함) |
`--refresh` 플래그를 사용하면 캐시된 모델 목록을 갱신할 수 있습니다. provider에 새 모델이 추가된 뒤 OpenCode에서 바로 확인하고 싶을 때 유용합니다.
@@ -335,20 +339,25 @@ opencode run --attach http://localhost:4096 "Explain async/await in JavaScript"
#### 플래그
| 플래그 | 축약 | 설명 |
| ------------ | ---- | ---------------------------------------------------------------------- |
| `--command` | | 실행할 명령(인수는 message로 전달) |
| `--continue` | `-c` | 마지막 세션 이어서 실행 |
| `--session` | `-s` | 이어서 실행할 세션 ID |
| `--fork` | | 세션을 이어갈 때 포크 생성 (`--continue` 또는 `--session`과 함께 사용) |
| `--share` | | 세션 공유 |
| `--model` | `-m` | 사용할 모델 (`provider/model` 형식) |
| `--agent` | | 사용할 에이전트 |
| `--file` | `-f` | 메시지에 첨부할 파일 |
| `--format` | | 출력 형식: default(포맷됨) 또는 json(원시 JSON 이벤트) |
| `--title` | | 세션 제목(값이 없으면 프롬프트를 잘라 자동 생성) |
| `--attach` | | 실행 중인 opencode 서버에 연결(예: http://localhost:4096) |
| `--port` | | 로컬 서버 포트(기본값: 랜덤 포트) |
| 플래그 | 축약 | 설명 |
| ---------------------------------------- | ---- | -------------------------------------------------------------------------- |
| <nobr><code>{"--command"}</code></nobr> | | 실행할 명령(인수는 message로 전달) |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | 마지막 세션 이어서 실행 |
| <nobr><code>{"--session"}</code></nobr> | `-s` | 이어서 실행할 세션 ID |
| <nobr><code>{"--fork"}</code></nobr> | | 세션을 이어갈 때 포크 생성 (`--continue` 또는 `--session`과 함께 사용) |
| <nobr><code>{"--share"}</code></nobr> | | 세션 공유 |
| <nobr><code>{"--model"}</code></nobr> | `-m` | 사용할 모델 (`provider/model` 형식) |
| <nobr><code>{"--agent"}</code></nobr> | | 사용할 에이전트 |
| <nobr><code>{"--file"}</code></nobr> | `-f` | 메시지에 첨부할 파일 |
| <nobr><code>{"--format"}</code></nobr> | | 출력 형식: default(포맷됨) 또는 json(원시 JSON 이벤트) |
| <nobr><code>{"--title"}</code></nobr> | | 세션 제목(값이 없으면 프롬프트를 잘라 자동 생성) |
| <nobr><code>{"--attach"}</code></nobr> | | 실행 중인 opencode 서버에 연결(예: http://localhost:4096) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | 기본 인증 비밀번호 (기본값: `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | 기본 인증 사용자 이름 (기본값: `OPENCODE_SERVER_USERNAME` 또는 `opencode`) |
| <nobr><code>{"--dir"}</code></nobr> | | 실행할 디렉터리, 또는 연결 시 원격 서버 경로 |
| <nobr><code>{"--variant"}</code></nobr> | | 모델 변형 (제공자별 추론 수준) |
| <nobr><code>{"--thinking"}</code></nobr> | | 사고 블록 표시 |
| <nobr><code>{"--port"}</code></nobr> | | 로컬 서버 포트(기본값: 랜덤 포트) |
---
@@ -364,12 +373,12 @@ opencode serve
#### 플래그
| 플래그 | 설명 |
| ------------ | --------------------------------- |
| `--port` | 수신 포트 |
| `--hostname` | 수신 호스트명 |
| `--mdns` | mDNS 검색 활성화 |
| `--cors` | 허용할 추가 브라우저 origin(CORS) |
| 플래그 | 설명 |
| ---------------------------------------- | --------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | 수신 포트 |
| <nobr><code>{"--hostname"}</code></nobr> | 수신 호스트명 |
| <nobr><code>{"--mdns"}</code></nobr> | mDNS 검색 활성화 |
| <nobr><code>{"--cors"}</code></nobr> | 허용할 추가 브라우저 origin(CORS) |
---
@@ -393,10 +402,10 @@ opencode session list
##### 플래그
| 플래그 | 축약 | 설명 |
| ------------- | ---- | -------------------------------------- |
| `--max-count` | `-n` | 최근 N개 세션만 표시 |
| `--format` | | 출력 형식: table 또는 json(기본 table) |
| 플래그 | 축약 | 설명 |
| ----------------------------------------- | ---- | -------------------------------------- |
| <nobr><code>{"--max-count"}</code></nobr> | `-n` | 최근 N개 세션만 표시 |
| <nobr><code>{"--format"}</code></nobr> | | 출력 형식: table 또는 json(기본 table) |
---
@@ -410,12 +419,12 @@ opencode stats
#### 플래그
| 플래그 | 설명 |
| ----------- | ------------------------------------------------------------ |
| `--days` | 최근 N일 통계 표시(기본값: 전체 기간) |
| `--tools` | 표시할 도구 개수(기본값: 전체) |
| `--models` | 모델 사용량 상세 표시(기본 숨김). 숫자를 주면 상위 N개 표시 |
| `--project` | 프로젝트 필터(기본: 전체 프로젝트, 빈 문자열: 현재 프로젝트) |
| 플래그 | 설명 |
| --------------------------------------- | ------------------------------------------------------------ |
| <nobr><code>{"--days"}</code></nobr> | 최근 N일 통계 표시(기본값: 전체 기간) |
| <nobr><code>{"--tools"}</code></nobr> | 표시할 도구 개수(기본값: 전체) |
| <nobr><code>{"--models"}</code></nobr> | 모델 사용량 상세 표시(기본 숨김). 숫자를 주면 상위 N개 표시 |
| <nobr><code>{"--project"}</code></nobr> | 프로젝트 필터(기본: 전체 프로젝트, 빈 문자열: 현재 프로젝트) |
---
@@ -460,12 +469,12 @@ opencode web
#### 플래그
| 플래그 | 설명 |
| ------------ | --------------------------------- |
| `--port` | 수신 포트 |
| `--hostname` | 수신 호스트명 |
| `--mdns` | mDNS 검색 활성화 |
| `--cors` | 허용할 추가 브라우저 origin(CORS) |
| 플래그 | 설명 |
| ---------------------------------------- | --------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | 수신 포트 |
| <nobr><code>{"--hostname"}</code></nobr> | 수신 호스트명 |
| <nobr><code>{"--mdns"}</code></nobr> | mDNS 검색 활성화 |
| <nobr><code>{"--cors"}</code></nobr> | 허용할 추가 브라우저 origin(CORS) |
---
@@ -481,11 +490,11 @@ opencode acp
#### 플래그
| 플래그 | 설명 |
| ------------ | ------------- |
| `--cwd` | 작업 디렉터리 |
| `--port` | 수신 포트 |
| `--hostname` | 수신 호스트명 |
| 플래그 | 설명 |
| ---------------------------------------- | ------------- |
| <nobr><code>{"--cwd"}</code></nobr> | 작업 디렉터리 |
| <nobr><code>{"--port"}</code></nobr> | 수신 포트 |
| <nobr><code>{"--hostname"}</code></nobr> | 수신 호스트명 |
---
@@ -499,12 +508,12 @@ opencode uninstall
#### 플래그
| 플래그 | 축약 | 설명 |
| --------------- | ---- | ------------------------------- |
| `--keep-config` | `-c` | 설정 파일 유지 |
| `--keep-data` | `-d` | 세션 데이터와 스냅샷 유지 |
| `--dry-run` | | 실제 삭제 없이 삭제 대상만 표시 |
| `--force` | `-f` | 확인 프롬프트 건너뛰기 |
| 플래그 | 축약 | 설명 |
| ------------------------------------------- | ---- | ------------------------------- |
| <nobr><code>{"--keep-config"}</code></nobr> | `-c` | 설정 파일 유지 |
| <nobr><code>{"--keep-data"}</code></nobr> | `-d` | 세션 데이터와 스냅샷 유지 |
| <nobr><code>{"--dry-run"}</code></nobr> | | 실제 삭제 없이 삭제 대상만 표시 |
| <nobr><code>{"--force"}</code></nobr> | `-f` | 확인 프롬프트 건너뛰기 |
---
@@ -530,9 +539,9 @@ opencode upgrade v0.1.48
#### 플래그
| 플래그 | 축약 | 설명 |
| ---------- | ---- | ------------------------------------------ |
| `--method` | `-m` | 설치 방식 지정: curl, npm, pnpm, bun, brew |
| 플래그 | 축약 | 설명 |
| -------------------------------------- | ---- | ------------------------------------------ |
| <nobr><code>{"--method"}</code></nobr> | `-m` | 설치 방식 지정: curl, npm, pnpm, bun, brew |
---
@@ -540,12 +549,12 @@ opencode upgrade v0.1.48
opencode CLI는 아래 전역 플래그를 지원합니다.
| 플래그 | 축약 | 설명 |
| -------------- | ---- | ----------------------------------- |
| `--help` | `-h` | 도움말 표시 |
| `--version` | `-v` | 버전 출력 |
| `--print-logs` | | 로그를 stderr로 출력 |
| `--log-level` | | 로그 레벨(DEBUG, INFO, WARN, ERROR) |
| 플래그 | 축약 | 설명 |
| ------------------------------------------ | ---- | ----------------------------------- |
| <nobr><code>{"--help"}</code></nobr> | `-h` | 도움말 표시 |
| <nobr><code>{"--version"}</code></nobr> | `-v` | 버전 출력 |
| <nobr><code>{"--print-logs"}</code></nobr> | | 로그를 stderr로 출력 |
| <nobr><code>{"--log-level"}</code></nobr> | | 로그 레벨(DEBUG, INFO, WARN, ERROR) |
---

View File

@@ -29,16 +29,16 @@ opencode [project]
#### Flagg
| Flagg | Kort | Beskrivelse |
| ------------ | ---- | ------------------------------------------------------------------------ |
| `--continue` | `-c` | Fortsett siste økt |
| `--session` | `-s` | Økt ID for å fortsette |
| `--fork` | | Forgren økten ved fortsettelse (bruk med `--continue` eller `--session`) |
| `--prompt` | | Ledetekst som skal brukes |
| `--model` | `-m` | Modell å bruke i form av leverandør/modell |
| `--agent` | | Agent som skal brukes |
| `--port` | | Port å lytte på |
| `--hostname` | | Vertsnavn å lytte på |
| Flagg | Kort | Beskrivelse |
| ---------------------------------------- | ---- | ------------------------------------------------------------------------ |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Fortsett siste økt |
| <nobr><code>{"--session"}</code></nobr> | `-s` | Økt ID for å fortsette |
| <nobr><code>{"--fork"}</code></nobr> | | Forgren økten ved fortsettelse (bruk med `--continue` eller `--session`) |
| <nobr><code>{"--prompt"}</code></nobr> | | Ledetekst som skal brukes |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Modell å bruke i form av leverandør/modell |
| <nobr><code>{"--agent"}</code></nobr> | | Agent som skal brukes |
| <nobr><code>{"--port"}</code></nobr> | | Port å lytte på |
| <nobr><code>{"--hostname"}</code></nobr> | | Vertsnavn å lytte på |
---
@@ -78,10 +78,14 @@ opencode attach http://10.20.30.40:4096
#### Flagg
| Flagg | Kort | Beskrivelse |
| ----------- | ---- | --------------------------------- |
| `--dir` | | Arbeidskatalog for å starte TUI i |
| `--session` | `-s` | Økt ID for å fortsette |
| Flagg | Kort | Beskrivelse |
| ---------------------------------------- | ---- | -------------------------------------------------------------------------------------------------- |
| <nobr><code>{"--dir"}</code></nobr> | | Arbeidskatalog for å starte TUI i |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Fortsett siste økt |
| <nobr><code>{"--session"}</code></nobr> | `-s` | Økt ID for å fortsette |
| <nobr><code>{"--fork"}</code></nobr> | | Forgren økten ved fortsettelse (bruk med `--continue` eller `--session`) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Passord for grunnleggende autentisering (standard: `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Brukernavn for grunnleggende autentisering (standard: `OPENCODE_SERVER_USERNAME` eller `opencode`) |
---
@@ -187,10 +191,10 @@ opencode github run
##### Flagg
| Flagg | Beskrivelse |
| --------- | -------------------------------------------- |
| `--event` | GitHub mock-hendelse agenten skal kjøres for |
| `--token` | GitHub personlig tilgangsnøkkel |
| Flagg | Beskrivelse |
| ------------------------------------- | -------------------------------------------- |
| <nobr><code>{"--event"}</code></nobr> | GitHub mock-hendelse agenten skal kjøres for |
| <nobr><code>{"--token"}</code></nobr> | GitHub personlig tilgangsnøkkel |
---
@@ -296,10 +300,10 @@ opencode models anthropic
#### Flagg
| Flagg | Beskrivelse |
| ----------- | ------------------------------------------------------------------- |
| `--refresh` | Oppdater modellbufferen fra models.dev |
| `--verbose` | Bruk mer detaljert modellutdata (inkluderer metadata som kostnader) |
| Flagg | Beskrivelse |
| --------------------------------------- | ------------------------------------------------------------------- |
| <nobr><code>{"--refresh"}</code></nobr> | Oppdater modellbufferen fra models.dev |
| <nobr><code>{"--verbose"}</code></nobr> | Bruk mer detaljert modellutdata (inkluderer metadata som kostnader) |
Bruk `--refresh`-flagget for å oppdatere den bufrede modelllisten. Dette er nyttig når nye modeller er lagt til en leverandør og du vil se dem i OpenCode.
@@ -335,20 +339,25 @@ opencode run --attach http://localhost:4096 "Explain async/await in JavaScript"
#### Flagg
| Flagg | Kort | Beskrivelse |
| ------------ | ---- | ------------------------------------------------------------------------ |
| `--command` | | Kommandoen for å kjøre, bruk melding for args |
| `--continue` | `-c` | Fortsett siste økt |
| `--session` | `-s` | Økt ID for å fortsette |
| `--fork` | | Forgren økten ved fortsettelse (bruk med `--continue` eller `--session`) |
| `--share` | | Del økten |
| `--model` | `-m` | Modell å bruke i form av leverandør/modell |
| `--agent` | | Agent å bruke |
| `--file` | `-f` | Fil(er) som skal legges ved meldingen |
| `--format` | | Format: standard (formatert) eller json (rå JSON hendelser) |
| `--title` | | Tittel for økten (bruker avkortet ledetekst hvis ingen verdi er oppgitt) |
| `--attach` | | Koble til en kjørende OpenCode-server (f.eks. http://localhost:4096) |
| `--port` | | Port for den lokale serveren (standard til tilfeldig port) |
| Flagg | Kort | Beskrivelse |
| ---------------------------------------- | ---- | -------------------------------------------------------------------------------------------------- |
| <nobr><code>{"--command"}</code></nobr> | | Kommandoen for å kjøre, bruk melding for args |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Fortsett siste økt |
| <nobr><code>{"--session"}</code></nobr> | `-s` | Økt ID for å fortsette |
| <nobr><code>{"--fork"}</code></nobr> | | Forgren økten ved fortsettelse (bruk med `--continue` eller `--session`) |
| <nobr><code>{"--share"}</code></nobr> | | Del økten |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Modell å bruke i form av leverandør/modell |
| <nobr><code>{"--agent"}</code></nobr> | | Agent å bruke |
| <nobr><code>{"--file"}</code></nobr> | `-f` | Fil(er) som skal legges ved meldingen |
| <nobr><code>{"--format"}</code></nobr> | | Format: standard (formatert) eller json (rå JSON hendelser) |
| <nobr><code>{"--title"}</code></nobr> | | Tittel for økten (bruker avkortet ledetekst hvis ingen verdi er oppgitt) |
| <nobr><code>{"--attach"}</code></nobr> | | Koble til en kjørende OpenCode-server (f.eks. http://localhost:4096) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Passord for grunnleggende autentisering (standard: `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Brukernavn for grunnleggende autentisering (standard: `OPENCODE_SERVER_USERNAME` eller `opencode`) |
| <nobr><code>{"--dir"}</code></nobr> | | Katalog å kjøre i, eller sti på fjernserveren ved tilkobling |
| <nobr><code>{"--variant"}</code></nobr> | | Modellvariant (leverandørspesifikk resonneringsinnsats) |
| <nobr><code>{"--thinking"}</code></nobr> | | Vis tenkeblokker |
| <nobr><code>{"--port"}</code></nobr> | | Port for den lokale serveren (standard til tilfeldig port) |
---
@@ -364,12 +373,12 @@ Dette starter en HTTP-server som gir API tilgang til OpenCode-funksjonalitet ute
#### Flagg
| Flagg | Beskrivelse |
| ------------ | -------------------------------------------------- |
| `--port` | Port å lytte på |
| `--hostname` | Vertsnavn å lytte på |
| `--mdns` | Aktiver mDNS-oppdagelse |
| `--cors` | Ytterligere nettleseropprinnelse som tillater CORS |
| Flagg | Beskrivelse |
| ---------------------------------------- | -------------------------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | Port å lytte på |
| <nobr><code>{"--hostname"}</code></nobr> | Vertsnavn å lytte på |
| <nobr><code>{"--mdns"}</code></nobr> | Aktiver mDNS-oppdagelse |
| <nobr><code>{"--cors"}</code></nobr> | Ytterligere nettleseropprinnelse som tillater CORS |
---
@@ -393,10 +402,10 @@ opencode session list
##### Flagg
| Flagg | Kort | Beskrivelse |
| ------------- | ---- | ---------------------------------------- |
| `--max-count` | `-n` | Begrens til N siste økter |
| `--format` | | Utdataformat: tabell eller json (tabell) |
| Flagg | Kort | Beskrivelse |
| ----------------------------------------- | ---- | ---------------------------------------- |
| <nobr><code>{"--max-count"}</code></nobr> | `-n` | Begrens til N siste økter |
| <nobr><code>{"--format"}</code></nobr> | | Utdataformat: tabell eller json (tabell) |
---
@@ -410,12 +419,12 @@ opencode stats
#### Flagg
| Flagg | Beskrivelse |
| ----------- | -------------------------------------------------------------------------------- |
| `--days` | Vis statistikk for de siste N dagene (hele tiden) |
| `--tools` | Antall verktøy som skal vises (alle) |
| `--models` | Vis oversikt over modellbruk (skjult som standard). Gi et tall for å vise topp N |
| `--project` | Filtrer etter prosjekt (alle prosjekter, tom streng: gjeldende prosjekt) |
| Flagg | Beskrivelse |
| --------------------------------------- | -------------------------------------------------------------------------------- |
| <nobr><code>{"--days"}</code></nobr> | Vis statistikk for de siste N dagene (hele tiden) |
| <nobr><code>{"--tools"}</code></nobr> | Antall verktøy som skal vises (alle) |
| <nobr><code>{"--models"}</code></nobr> | Vis oversikt over modellbruk (skjult som standard). Gi et tall for å vise topp N |
| <nobr><code>{"--project"}</code></nobr> | Filtrer etter prosjekt (alle prosjekter, tom streng: gjeldende prosjekt) |
---
@@ -460,12 +469,12 @@ Dette starter en HTTP-server og åpner en nettleser for å få tilgang til OpenC
#### Flagg
| Flagg | Beskrivelse |
| ------------ | -------------------------------------------------- |
| `--port` | Port å lytte på |
| `--hostname` | Vertsnavn å lytte på |
| `--mdns` | Aktiver mDNS-oppdagelse |
| `--cors` | Ytterligere nettleseropprinnelse som tillater CORS |
| Flagg | Beskrivelse |
| ---------------------------------------- | -------------------------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | Port å lytte på |
| <nobr><code>{"--hostname"}</code></nobr> | Vertsnavn å lytte på |
| <nobr><code>{"--mdns"}</code></nobr> | Aktiver mDNS-oppdagelse |
| <nobr><code>{"--cors"}</code></nobr> | Ytterligere nettleseropprinnelse som tillater CORS |
---
@@ -481,11 +490,11 @@ Denne kommandoen starter en ACP-server som kommuniserer via stdin/stdout ved å
#### Flagg
| Flagg | Beskrivelse |
| ------------ | -------------------- |
| `--cwd` | Arbeidskatalog |
| `--port` | Port å lytte på |
| `--hostname` | Vertsnavn å lytte på |
| Flagg | Beskrivelse |
| ---------------------------------------- | -------------------- |
| <nobr><code>{"--cwd"}</code></nobr> | Arbeidskatalog |
| <nobr><code>{"--port"}</code></nobr> | Port å lytte på |
| <nobr><code>{"--hostname"}</code></nobr> | Vertsnavn å lytte på |
---
@@ -499,12 +508,12 @@ opencode uninstall
#### Flagg
| Flagg | Kort | Beskrivelse |
| --------------- | ---- | --------------------------------------------- |
| `--keep-config` | `-c` | Behold konfigurasjonsfiler |
| `--keep-data` | `-d` | Behold øktdata og øyeblikksbilder |
| `--dry-run` | | Vis hva som ville blitt fjernet uten å fjerne |
| `--force` | `-f` | Hopp over bekreftelsesforespørsler |
| Flagg | Kort | Beskrivelse |
| ------------------------------------------- | ---- | --------------------------------------------- |
| <nobr><code>{"--keep-config"}</code></nobr> | `-c` | Behold konfigurasjonsfiler |
| <nobr><code>{"--keep-data"}</code></nobr> | `-d` | Behold øktdata og øyeblikksbilder |
| <nobr><code>{"--dry-run"}</code></nobr> | | Vis hva som ville blitt fjernet uten å fjerne |
| <nobr><code>{"--force"}</code></nobr> | `-f` | Hopp over bekreftelsesforespørsler |
---
@@ -530,9 +539,9 @@ opencode upgrade v0.1.48
#### Flagg
| Flagg | Kort | Beskrivelse |
| ---------- | ---- | -------------------------------------------------------------- |
| `--method` | `-m` | Installasjonsmetoden som ble brukt: curl, npm, pnpm, bun, brew |
| Flagg | Kort | Beskrivelse |
| -------------------------------------- | ---- | -------------------------------------------------------------- |
| <nobr><code>{"--method"}</code></nobr> | `-m` | Installasjonsmetoden som ble brukt: curl, npm, pnpm, bun, brew |
---
@@ -540,12 +549,12 @@ opencode upgrade v0.1.48
OpenCode CLI bruker følgende globale flagg.
| Flagg | Kort | Beskrivelse |
| -------------- | ---- | ----------------------------------- |
| `--help` | `-h` | Vis hjelp |
| `--version` | `-v` | Skriv ut versjonsnummer |
| `--print-logs` | | Skriv ut logger til stderr |
| `--log-level` | | Loggnivå (DEBUG, INFO, WARN, ERROR) |
| Flagg | Kort | Beskrivelse |
| ------------------------------------------ | ---- | ----------------------------------- |
| <nobr><code>{"--help"}</code></nobr> | `-h` | Vis hjelp |
| <nobr><code>{"--version"}</code></nobr> | `-v` | Skriv ut versjonsnummer |
| <nobr><code>{"--print-logs"}</code></nobr> | | Skriv ut logger til stderr |
| <nobr><code>{"--log-level"}</code></nobr> | | Loggnivå (DEBUG, INFO, WARN, ERROR) |
---

View File

@@ -29,16 +29,16 @@ opencode [project]
#### Flagi
| Flaga | Skrót | Opis |
| ------------ | ----- | ----------------------------------------------------------------------- |
| `--continue` | `-c` | Kontynuuj ostatnią sesję |
| `--session` | `-s` | Identyfikator sesji do kontynuowania |
| `--fork` | | Sklonuj sesję podczas kontynuacji (użyj z `--continue` lub `--session`) |
| `--prompt` | | Monit do użycia |
| `--model` | `-m` | Model do użycia w formacie dostawca/model |
| `--agent` | | Agent do użycia |
| `--port` | | Port do nasłuchiwania |
| `--hostname` | | Nazwa hosta, do której należy się powiązać |
| Flaga | Skrót | Opis |
| ---------------------------------------- | ----- | ----------------------------------------------------------------------- |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Kontynuuj ostatnią sesję |
| <nobr><code>{"--session"}</code></nobr> | `-s` | Identyfikator sesji do kontynuowania |
| <nobr><code>{"--fork"}</code></nobr> | | Sklonuj sesję podczas kontynuacji (użyj z `--continue` lub `--session`) |
| <nobr><code>{"--prompt"}</code></nobr> | | Monit do użycia |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Model do użycia w formacie dostawca/model |
| <nobr><code>{"--agent"}</code></nobr> | | Agent do użycia |
| <nobr><code>{"--port"}</code></nobr> | | Port do nasłuchiwania |
| <nobr><code>{"--hostname"}</code></nobr> | | Nazwa hosta, do której należy się powiązać |
---
@@ -78,10 +78,14 @@ opencode attach http://10.20.30.40:4096
#### Flagi
| Flaga | Skrót | Opis |
| ----------- | ----- | --------------------------------------- |
| `--dir` | | Katalog roboczy, w którym uruchomić TUI |
| `--session` | `-s` | Identyfikator sesji do kontynuowania |
| Flaga | Skrót | Opis |
| ---------------------------------------- | ----- | ----------------------------------------------------------------------------------------------------- |
| <nobr><code>{"--dir"}</code></nobr> | | Katalog roboczy, w którym uruchomić TUI |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Kontynuuj ostatnią sesję |
| <nobr><code>{"--session"}</code></nobr> | `-s` | Identyfikator sesji do kontynuowania |
| <nobr><code>{"--fork"}</code></nobr> | | Rozgałęź sesję podczas kontynuowania (użyj z `--continue` lub `--session`) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Hasło uwierzytelniania podstawowego (domyślnie `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Nazwa użytkownika uwierzytelniania podstawowego (domyślnie `OPENCODE_SERVER_USERNAME` lub `opencode`) |
---
@@ -187,10 +191,10 @@ opencode github run
##### Flagi
| Flaga | Opis |
| --------- | ---------------------------------------- |
| `--event` | Zdarzenie GitHub, które wyzwoliło agenta |
| `--token` | Osobisty token dostępu GitHub |
| Flaga | Opis |
| ------------------------------------- | ---------------------------------------- |
| <nobr><code>{"--event"}</code></nobr> | Zdarzenie GitHub, które wyzwoliło agenta |
| <nobr><code>{"--token"}</code></nobr> | Osobisty token dostępu GitHub |
---
@@ -296,10 +300,10 @@ opencode models anthropic
#### Flagi
| Flaga | Opis |
| ----------- | ------------------------------------------------------------------------------- |
| `--refresh` | Odśwież pamięć podręczną modeli |
| `--verbose` | Bardziej szczegółowe dane wyjściowe modelu (zawiera metadane, takie jak koszty) |
| Flaga | Opis |
| --------------------------------------- | ------------------------------------------------------------------------------- |
| <nobr><code>{"--refresh"}</code></nobr> | Odśwież pamięć podręczną modeli |
| <nobr><code>{"--verbose"}</code></nobr> | Bardziej szczegółowe dane wyjściowe modelu (zawiera metadane, takie jak koszty) |
Użyj flagi `--refresh`, aby zaktualizować listę modeli w pamięci podręcznej. Jest to przydatne, gdy dostawca dodał nowe modele, które chcesz zobaczyć w OpenCode.
@@ -335,20 +339,25 @@ opencode run --attach http://localhost:4096 "Explain async/await in JavaScript"
#### Flagi
| Flaga | Skrót | Opis |
| ------------ | ----- | ----------------------------------------------------------------------- |
| `--command` | | Polecenie do uruchomienia, reszta to argumenty |
| `--continue` | `-c` | Kontynuuj ostatnią sesję |
| `--session` | `-s` | Identyfikator sesji do kontynuowania |
| `--fork` | | Sklonuj sesję podczas kontynuacji (użyj z `--continue` lub `--session`) |
| `--share` | | Udostępnij sesję po zakończeniu |
| `--model` | `-m` | Model do użycia w formacie dostawca/model |
| `--agent` | | Agent do użycia |
| `--file` | `-f` | Pliki do załączenia do wiadomości |
| `--format` | | Format wyjściowy: `default` (sformatowany) lub `json` (surowy JSON) |
| `--title` | | Tytuł sesji (jeśli nie podano, zostanie wygenerowany z promptu) |
| `--attach` | | Dołącz do działającego serwera OpenCode (np. http://localhost:4096) |
| `--port` | | Port dla serwera lokalnego (domyślnie losowy) |
| Flaga | Skrót | Opis |
| ---------------------------------------- | ----- | ----------------------------------------------------------------------------------------------------- |
| <nobr><code>{"--command"}</code></nobr> | | Polecenie do uruchomienia, reszta to argumenty |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Kontynuuj ostatnią sesję |
| <nobr><code>{"--session"}</code></nobr> | `-s` | Identyfikator sesji do kontynuowania |
| <nobr><code>{"--fork"}</code></nobr> | | Sklonuj sesję podczas kontynuacji (użyj z `--continue` lub `--session`) |
| <nobr><code>{"--share"}</code></nobr> | | Udostępnij sesję po zakończeniu |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Model do użycia w formacie dostawca/model |
| <nobr><code>{"--agent"}</code></nobr> | | Agent do użycia |
| <nobr><code>{"--file"}</code></nobr> | `-f` | Pliki do załączenia do wiadomości |
| <nobr><code>{"--format"}</code></nobr> | | Format wyjściowy: `default` (sformatowany) lub `json` (surowy JSON) |
| <nobr><code>{"--title"}</code></nobr> | | Tytuł sesji (jeśli nie podano, zostanie wygenerowany z promptu) |
| <nobr><code>{"--attach"}</code></nobr> | | Dołącz do działającego serwera OpenCode (np. http://localhost:4096) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Hasło uwierzytelniania podstawowego (domyślnie `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Nazwa użytkownika uwierzytelniania podstawowego (domyślnie `OPENCODE_SERVER_USERNAME` lub `opencode`) |
| <nobr><code>{"--dir"}</code></nobr> | | Katalog do uruchomienia lub ścieżka na zdalnym serwerze podczas dołączania |
| <nobr><code>{"--variant"}</code></nobr> | | Wariant modelu (poziom wnioskowania specyficzny dla dostawcy) |
| <nobr><code>{"--thinking"}</code></nobr> | | Pokaż bloki myślenia |
| <nobr><code>{"--port"}</code></nobr> | | Port dla serwera lokalnego (domyślnie losowy) |
---
@@ -364,12 +373,12 @@ Uruchamia to serwer HTTP, który zapewnia dostęp do API OpenCode bez interfejsu
#### Flagi
| Flaga | Opis |
| ------------ | ------------------------------------------ |
| `--port` | Port do nasłuchiwania |
| `--hostname` | Nazwa hosta, do której należy się powiązać |
| `--mdns` | Włącz wykrywanie mDNS |
| `--cors` | Dodatkowe dozwolone źródła CORS |
| Flaga | Opis |
| ---------------------------------------- | ------------------------------------------ |
| <nobr><code>{"--port"}</code></nobr> | Port do nasłuchiwania |
| <nobr><code>{"--hostname"}</code></nobr> | Nazwa hosta, do której należy się powiązać |
| <nobr><code>{"--mdns"}</code></nobr> | Włącz wykrywanie mDNS |
| <nobr><code>{"--cors"}</code></nobr> | Dodatkowe dozwolone źródła CORS |
---
@@ -393,10 +402,10 @@ opencode session list
##### Flagi
| Flaga | Skrót | Opis |
| ------------- | ----- | ------------------------------------------ |
| `--max-count` | `-n` | Ogranicz do ostatnich N sesji |
| `--format` | | Format wyjściowy: tabela lub json (tabela) |
| Flaga | Skrót | Opis |
| ----------------------------------------- | ----- | ------------------------------------------ |
| <nobr><code>{"--max-count"}</code></nobr> | `-n` | Ogranicz do ostatnich N sesji |
| <nobr><code>{"--format"}</code></nobr> | | Format wyjściowy: tabela lub json (tabela) |
---
@@ -410,12 +419,12 @@ opencode stats
#### Flagi
| Flaga | Opis |
| ----------- | ------------------------------------------------------------------------------------- |
| `--days` | Pokaż statystyki z ostatnich N dni (domyślnie: cały czas) |
| `--tools` | Pokaż użycie poszczególnych narzędzi (domyślnie: wszystkie) |
| `--models` | Pokaż podział na modele (domyślnie ukryty). Podaj liczbę, aby pokazać N najczęstszych |
| `--project` | Filtruj według projektu (domyślnie: wszystkie projekty, pusty ciąg: bieżący projekt) |
| Flaga | Opis |
| --------------------------------------- | ------------------------------------------------------------------------------------- |
| <nobr><code>{"--days"}</code></nobr> | Pokaż statystyki z ostatnich N dni (domyślnie: cały czas) |
| <nobr><code>{"--tools"}</code></nobr> | Pokaż użycie poszczególnych narzędzi (domyślnie: wszystkie) |
| <nobr><code>{"--models"}</code></nobr> | Pokaż podział na modele (domyślnie ukryty). Podaj liczbę, aby pokazać N najczęstszych |
| <nobr><code>{"--project"}</code></nobr> | Filtruj według projektu (domyślnie: wszystkie projekty, pusty ciąg: bieżący projekt) |
---
@@ -460,12 +469,12 @@ Uruchamia to serwer HTTP i udostępnia OpenCode przez interfejs przeglądarkowy.
#### Flagi
| Flaga | Opis |
| ------------ | ------------------------------------------ |
| `--port` | Port do nasłuchiwania |
| `--hostname` | Nazwa hosta, do której należy się powiązać |
| `--mdns` | Włącz wykrywanie mDNS |
| `--cors` | Dodatkowe dozwolone źródła CORS |
| Flaga | Opis |
| ---------------------------------------- | ------------------------------------------ |
| <nobr><code>{"--port"}</code></nobr> | Port do nasłuchiwania |
| <nobr><code>{"--hostname"}</code></nobr> | Nazwa hosta, do której należy się powiązać |
| <nobr><code>{"--mdns"}</code></nobr> | Włącz wykrywanie mDNS |
| <nobr><code>{"--cors"}</code></nobr> | Dodatkowe dozwolone źródła CORS |
---
@@ -481,11 +490,11 @@ Uruchamia serwer ACP, który komunikuje się przez stdin/stdout przy użyciu JSO
#### Flagi
| Flaga | Opis |
| ------------ | ------------------------------------------ |
| `--cwd` | Katalog roboczy |
| `--port` | Port do nasłuchiwania |
| `--hostname` | Nazwa hosta, do której należy się powiązać |
| Flaga | Opis |
| ---------------------------------------- | ------------------------------------------ |
| <nobr><code>{"--cwd"}</code></nobr> | Katalog roboczy |
| <nobr><code>{"--port"}</code></nobr> | Port do nasłuchiwania |
| <nobr><code>{"--hostname"}</code></nobr> | Nazwa hosta, do której należy się powiązać |
---
@@ -499,12 +508,12 @@ opencode uninstall
#### Flagi
| Flaga | Skrót | Opis |
| --------------- | ----- | ----------------------------- |
| `--keep-config` | `-c` | Zachowaj pliki konfiguracyjne |
| `--keep-data` | `-d` | Zachowaj dane sesji i migawki |
| `--dry-run` | | Pokaż co zostanie usunięte |
| `--force` | `-f` | Pomiń monity o potwierdzenie |
| Flaga | Skrót | Opis |
| ------------------------------------------- | ----- | ----------------------------- |
| <nobr><code>{"--keep-config"}</code></nobr> | `-c` | Zachowaj pliki konfiguracyjne |
| <nobr><code>{"--keep-data"}</code></nobr> | `-d` | Zachowaj dane sesji i migawki |
| <nobr><code>{"--dry-run"}</code></nobr> | | Pokaż co zostanie usunięte |
| <nobr><code>{"--force"}</code></nobr> | `-f` | Pomiń monity o potwierdzenie |
---
@@ -530,9 +539,9 @@ opencode upgrade v0.1.48
#### Flagi
| Flaga | Skrót | Opis |
| ---------- | ----- | --------------------------------------------------- |
| `--method` | `-m` | Wymuś metodę instalacji: curl, npm, pnpm, bun, brew |
| Flaga | Skrót | Opis |
| -------------------------------------- | ----- | --------------------------------------------------- |
| <nobr><code>{"--method"}</code></nobr> | `-m` | Wymuś metodę instalacji: curl, npm, pnpm, bun, brew |
---
@@ -540,12 +549,12 @@ opencode upgrade v0.1.48
Interfejs CLI OpenCode przyjmuje następujące flagi globalne dla każdego polecenia.
| Flaga | Skrót | Opis |
| -------------- | ----- | ------------------------------------------- |
| `--help` | `-h` | Wyświetl pomoc |
| `--version` | `-v` | Wydrukuj numer wersji |
| `--print-logs` | | Drukuj logi na stderr |
| `--log-level` | | Poziom logowania (DEBUG, INFO, WARN, ERROR) |
| Flaga | Skrót | Opis |
| ------------------------------------------ | ----- | ------------------------------------------- |
| <nobr><code>{"--help"}</code></nobr> | `-h` | Wyświetl pomoc |
| <nobr><code>{"--version"}</code></nobr> | `-v` | Wydrukuj numer wersji |
| <nobr><code>{"--print-logs"}</code></nobr> | | Drukuj logi na stderr |
| <nobr><code>{"--log-level"}</code></nobr> | | Poziom logowania (DEBUG, INFO, WARN, ERROR) |
---

View File

@@ -29,16 +29,16 @@ opencode [project]
#### Opções
| Flag | Curto | Descrição |
| ------------ | ----- | -------------------------------------------------------------------------- |
| `--continue` | `-c` | Continue a última sessão |
| `--session` | `-s` | ID da sessão para continuar |
| `--fork` | | Criar um fork da sessão ao continuar (use com `--continue` ou `--session`) |
| `--prompt` | | Prompt a ser usado |
| `--model` | `-m` | Modelo a ser usado na forma de provider/model |
| `--agent` | | Agente a ser usado |
| `--port` | | Porta para escutar |
| `--hostname` | | Nome do host para escutar |
| Flag | Curto | Descrição |
| ---------------------------------------- | ----- | -------------------------------------------------------------------------- |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Continue a última sessão |
| <nobr><code>{"--session"}</code></nobr> | `-s` | ID da sessão para continuar |
| <nobr><code>{"--fork"}</code></nobr> | | Criar um fork da sessão ao continuar (use com `--continue` ou `--session`) |
| <nobr><code>{"--prompt"}</code></nobr> | | Prompt a ser usado |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Modelo a ser usado na forma de provider/model |
| <nobr><code>{"--agent"}</code></nobr> | | Agente a ser usado |
| <nobr><code>{"--port"}</code></nobr> | | Porta para escutar |
| <nobr><code>{"--hostname"}</code></nobr> | | Nome do host para escutar |
---
@@ -78,10 +78,14 @@ opencode attach http://10.20.30.40:4096
#### Opções
| Flag | Curto | Descrição |
| ----------- | ----- | ---------------------------------------- |
| `--dir` | | Diretório de trabalho para iniciar o TUI |
| `--session` | `-s` | ID da sessão para continuar |
| Flag | Curto | Descrição |
| ---------------------------------------- | ----- | --------------------------------------------------------------------------------- |
| <nobr><code>{"--dir"}</code></nobr> | | Diretório de trabalho para iniciar o TUI |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Continuar a última sessão |
| <nobr><code>{"--session"}</code></nobr> | `-s` | ID da sessão para continuar |
| <nobr><code>{"--fork"}</code></nobr> | | Bifurcar a sessão ao continuar (use com `--continue` ou `--session`) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Senha de autenticação básica (padrão: `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Usuário de autenticação básica (padrão: `OPENCODE_SERVER_USERNAME` ou `opencode`) |
---
@@ -187,10 +191,10 @@ opencode github run
##### Opções
| Flag | Descrição |
| --------- | ------------------------------------------------ |
| `--event` | Evento simulado do GitHub para executar o agente |
| `--token` | Token de acesso pessoal do GitHub |
| Flag | Descrição |
| ------------------------------------- | ------------------------------------------------ |
| <nobr><code>{"--event"}</code></nobr> | Evento simulado do GitHub para executar o agente |
| <nobr><code>{"--token"}</code></nobr> | Token de acesso pessoal do GitHub |
---
@@ -296,10 +300,10 @@ opencode models anthropic
#### Opções
| Flag | Descrição |
| ----------- | --------------------------------------------------------------------- |
| `--refresh` | Atualiza o cache de modelos a partir do models.dev |
| `--verbose` | Use uma saída de modelo mais detalhada (inclui metadados como custos) |
| Flag | Descrição |
| --------------------------------------- | --------------------------------------------------------------------- |
| <nobr><code>{"--refresh"}</code></nobr> | Atualiza o cache de modelos a partir do models.dev |
| <nobr><code>{"--verbose"}</code></nobr> | Use uma saída de modelo mais detalhada (inclui metadados como custos) |
Use a flag `--refresh` para atualizar a lista de modelos em cache. Isso é útil quando novos modelos foram adicionados a um provedor e você deseja vê-los no opencode.
@@ -335,20 +339,25 @@ opencode run --attach http://localhost:4096 "Explique async/await em JavaScript"
#### Opções
| Flag | Curto | Descrição |
| ------------ | ----- | ----------------------------------------------------------------------------- |
| `--command` | | O comando a ser executado, use mensagem para argumentos |
| `--continue` | `-c` | Continue a última sessão |
| `--session` | `-s` | ID da sessão para continuar |
| `--fork` | | Criar um fork da sessão ao continuar (use com `--continue` ou `--session`) |
| `--share` | | Compartilhe a sessão |
| `--model` | `-m` | Modelo a ser usado na forma de provider/model |
| `--agent` | | Agente a ser usado |
| `--file` | `-f` | Arquivo(s) a serem anexados à mensagem |
| `--format` | | Formato: padrão (formatado) ou json (eventos JSON brutos) |
| `--title` | | Título para a sessão (usa o prompt truncado se nenhum valor for fornecido) |
| `--attach` | | Anexe a um servidor opencode em execução (por exemplo, http://localhost:4096) |
| `--port` | | Porta para o servidor local (padrão para porta aleatória) |
| Flag | Curto | Descrição |
| ---------------------------------------- | ----- | --------------------------------------------------------------------------------- |
| <nobr><code>{"--command"}</code></nobr> | | O comando a ser executado, use mensagem para argumentos |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Continue a última sessão |
| <nobr><code>{"--session"}</code></nobr> | `-s` | ID da sessão para continuar |
| <nobr><code>{"--fork"}</code></nobr> | | Criar um fork da sessão ao continuar (use com `--continue` ou `--session`) |
| <nobr><code>{"--share"}</code></nobr> | | Compartilhe a sessão |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Modelo a ser usado na forma de provider/model |
| <nobr><code>{"--agent"}</code></nobr> | | Agente a ser usado |
| <nobr><code>{"--file"}</code></nobr> | `-f` | Arquivo(s) a serem anexados à mensagem |
| <nobr><code>{"--format"}</code></nobr> | | Formato: padrão (formatado) ou json (eventos JSON brutos) |
| <nobr><code>{"--title"}</code></nobr> | | Título para a sessão (usa o prompt truncado se nenhum valor for fornecido) |
| <nobr><code>{"--attach"}</code></nobr> | | Anexe a um servidor opencode em execução (por exemplo, http://localhost:4096) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Senha de autenticação básica (padrão: `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Usuário de autenticação básica (padrão: `OPENCODE_SERVER_USERNAME` ou `opencode`) |
| <nobr><code>{"--dir"}</code></nobr> | | Diretório de execução, ou caminho no servidor remoto ao anexar |
| <nobr><code>{"--variant"}</code></nobr> | | Variante do modelo (nível de raciocínio específico do provedor) |
| <nobr><code>{"--thinking"}</code></nobr> | | Mostrar blocos de pensamento |
| <nobr><code>{"--port"}</code></nobr> | | Porta para o servidor local (padrão para porta aleatória) |
---
@@ -364,12 +373,12 @@ Isso inicia um servidor HTTP que fornece acesso à funcionalidade do opencode se
#### Opções
| Flag | Descrição |
| ------------ | ----------------------------------------------------- |
| `--port` | Porta para escutar |
| `--hostname` | Nome do host para escutar |
| `--mdns` | Habilitar descoberta mDNS |
| `--cors` | Origem(ns) de navegador adicionais para permitir CORS |
| Flag | Descrição |
| ---------------------------------------- | ----------------------------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | Porta para escutar |
| <nobr><code>{"--hostname"}</code></nobr> | Nome do host para escutar |
| <nobr><code>{"--mdns"}</code></nobr> | Habilitar descoberta mDNS |
| <nobr><code>{"--cors"}</code></nobr> | Origem(ns) de navegador adicionais para permitir CORS |
---
@@ -393,10 +402,10 @@ opencode session list
##### Opções
| Flag | Curto | Descrição |
| ------------- | ----- | ----------------------------------------- |
| `--max-count` | `-n` | Limitar às N sessões mais recentes |
| `--format` | | Formato de saída: tabela ou json (tabela) |
| Flag | Curto | Descrição |
| ----------------------------------------- | ----- | ----------------------------------------- |
| <nobr><code>{"--max-count"}</code></nobr> | `-n` | Limitar às N sessões mais recentes |
| <nobr><code>{"--format"}</code></nobr> | | Formato de saída: tabela ou json (tabela) |
---
@@ -410,12 +419,12 @@ opencode stats
#### Opções
| Flag | Descrição |
| ----------- | ---------------------------------------------------------------------------------------------------- |
| `--days` | Mostre estatísticas dos últimos N dias (todo o tempo) |
| `--tools` | Número de ferramentas a serem mostradas (todas) |
| `--models` | Mostre a divisão do uso de modelos (oculto por padrão). Passe um número para mostrar os N principais |
| `--project` | Filtrar por projeto (todos os projetos, string vazia: projeto atual) |
| Flag | Descrição |
| --------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| <nobr><code>{"--days"}</code></nobr> | Mostre estatísticas dos últimos N dias (todo o tempo) |
| <nobr><code>{"--tools"}</code></nobr> | Número de ferramentas a serem mostradas (todas) |
| <nobr><code>{"--models"}</code></nobr> | Mostre a divisão do uso de modelos (oculto por padrão). Passe um número para mostrar os N principais |
| <nobr><code>{"--project"}</code></nobr> | Filtrar por projeto (todos os projetos, string vazia: projeto atual) |
---
@@ -460,12 +469,12 @@ Isso inicia um servidor HTTP e abre um navegador para acessar o opencode atravé
#### Opções
| Flag | Descrição |
| ------------ | ----------------------------------------------------- |
| `--port` | Porta para escutar |
| `--hostname` | Nome do host para escutar |
| `--mdns` | Habilitar descoberta mDNS |
| `--cors` | Origem(ns) de navegador adicionais para permitir CORS |
| Flag | Descrição |
| ---------------------------------------- | ----------------------------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | Porta para escutar |
| <nobr><code>{"--hostname"}</code></nobr> | Nome do host para escutar |
| <nobr><code>{"--mdns"}</code></nobr> | Habilitar descoberta mDNS |
| <nobr><code>{"--cors"}</code></nobr> | Origem(ns) de navegador adicionais para permitir CORS |
---
@@ -481,11 +490,11 @@ Este comando inicia um servidor ACP que se comunica via stdin/stdout usando nd-J
#### Opções
| Flag | Descrição |
| ------------ | ------------------------- |
| `--cwd` | Diretório de trabalho |
| `--port` | Porta para escutar |
| `--hostname` | Nome do host para escutar |
| Flag | Descrição |
| ---------------------------------------- | ------------------------- |
| <nobr><code>{"--cwd"}</code></nobr> | Diretório de trabalho |
| <nobr><code>{"--port"}</code></nobr> | Porta para escutar |
| <nobr><code>{"--hostname"}</code></nobr> | Nome do host para escutar |
---
@@ -499,12 +508,12 @@ opencode uninstall
#### Opções
| Flag | Curto | Descrição |
| --------------- | ----- | ---------------------------------------- |
| `--keep-config` | `-c` | Manter arquivos de configuração |
| `--keep-data` | `-d` | Manter dados de sessão e snapshots |
| `--dry-run` | | Mostrar o que seria removido sem remover |
| `--force` | `-f` | Pular prompts de confirmação |
| Flag | Curto | Descrição |
| ------------------------------------------- | ----- | ---------------------------------------- |
| <nobr><code>{"--keep-config"}</code></nobr> | `-c` | Manter arquivos de configuração |
| <nobr><code>{"--keep-data"}</code></nobr> | `-d` | Manter dados de sessão e snapshots |
| <nobr><code>{"--dry-run"}</code></nobr> | | Mostrar o que seria removido sem remover |
| <nobr><code>{"--force"}</code></nobr> | `-f` | Pular prompts de confirmação |
---
@@ -530,9 +539,9 @@ opencode upgrade v0.1.48
#### Opções
| Flag | Curto | Descrição |
| ---------- | ----- | ---------------------------------------------------------------- |
| `--method` | `-m` | O método de instalação que foi usado; curl, npm, pnpm, bun, brew |
| Flag | Curto | Descrição |
| -------------------------------------- | ----- | ---------------------------------------------------------------- |
| <nobr><code>{"--method"}</code></nobr> | `-m` | O método de instalação que foi usado; curl, npm, pnpm, bun, brew |
---
@@ -540,12 +549,12 @@ opencode upgrade v0.1.48
A CLI do opencode aceita as seguintes flags globais.
| Flag | Curto | Descrição |
| -------------- | ----- | --------------------------------------- |
| `--help` | `-h` | Exibir ajuda |
| `--version` | `-v` | Imprimir número da versão |
| `--print-logs` | | Imprimir logs no stderr |
| `--log-level` | | Nível de log (DEBUG, INFO, WARN, ERROR) |
| Flag | Curto | Descrição |
| ------------------------------------------ | ----- | --------------------------------------- |
| <nobr><code>{"--help"}</code></nobr> | `-h` | Exibir ajuda |
| <nobr><code>{"--version"}</code></nobr> | `-v` | Imprimir número da versão |
| <nobr><code>{"--print-logs"}</code></nobr> | | Imprimir logs no stderr |
| <nobr><code>{"--log-level"}</code></nobr> | | Nível de log (DEBUG, INFO, WARN, ERROR) |
---

View File

@@ -29,16 +29,16 @@ opencode [project]
#### Флаги
| Флаг | Короткий | Описание |
| ------------ | -------- | ----------------------------------------------------------------------------- |
| `--continue` | `-c` | Продолжить последний сеанс |
| `--session` | `-s` | Идентификатор сеанса для продолжения |
| `--fork` | | Разветвить сеанс при продолжении (используйте с `--continue` или `--session`) |
| `--prompt` | | Промпт для использования |
| `--model` | `-m` | Модель для использования в виде поставщика/модели. |
| `--agent` | | Агент для использования |
| `--port` | | Порт для прослушивания |
| `--hostname` | | Имя хоста для прослушивания |
| Флаг | Короткий | Описание |
| ---------------------------------------- | -------- | ----------------------------------------------------------------------------- |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Продолжить последний сеанс |
| <nobr><code>{"--session"}</code></nobr> | `-s` | Идентификатор сеанса для продолжения |
| <nobr><code>{"--fork"}</code></nobr> | | Разветвить сеанс при продолжении (используйте с `--continue` или `--session`) |
| <nobr><code>{"--prompt"}</code></nobr> | | Промпт для использования |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Модель для использования в виде поставщика/модели. |
| <nobr><code>{"--agent"}</code></nobr> | | Агент для использования |
| <nobr><code>{"--port"}</code></nobr> | | Порт для прослушивания |
| <nobr><code>{"--hostname"}</code></nobr> | | Имя хоста для прослушивания |
---
@@ -78,10 +78,14 @@ opencode attach http://10.20.30.40:4096
#### Флаги
| Флаг | Короткий | Описание |
| ----------- | -------- | ------------------------------------ |
| `--dir` | | Рабочий каталог для запуска TUI |
| `--session` | `-s` | Идентификатор сеанса для продолжения |
| Флаг | Короткий | Описание |
| ---------------------------------------- | -------- | ------------------------------------------------------------------------------------------------ |
| <nobr><code>{"--dir"}</code></nobr> | | Рабочий каталог для запуска TUI |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Продолжить последний сеанс |
| <nobr><code>{"--session"}</code></nobr> | `-s` | Идентификатор сеанса для продолжения |
| <nobr><code>{"--fork"}</code></nobr> | | Создать ответвление сеанса при продолжении (используйте с `--continue` или `--session`) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Пароль базовой аутентификации (по умолчанию `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Имя пользователя базовой аутентификации (по умолчанию `OPENCODE_SERVER_USERNAME` или `opencode`) |
---
@@ -187,10 +191,10 @@ opencode github run
##### Флаги
| Флаг | Описание |
| --------- | --------------------------------------------- |
| `--event` | Имитирующее событие GitHub для запуска агента |
| `--token` | Токен личного доступа GitHub |
| Флаг | Описание |
| ------------------------------------- | --------------------------------------------- |
| <nobr><code>{"--event"}</code></nobr> | Имитирующее событие GitHub для запуска агента |
| <nobr><code>{"--token"}</code></nobr> | Токен личного доступа GitHub |
---
@@ -296,10 +300,10 @@ opencode models anthropic
#### Флаги
| Флаг | Описание |
| ----------- | --------------------------------------------------------------------------------- |
| `--refresh` | Обновите кеш моделей на сайте models.dev. |
| `--verbose` | Используйте более подробный вывод модели (включая метаданные, такие как затраты). |
| Флаг | Описание |
| --------------------------------------- | --------------------------------------------------------------------------------- |
| <nobr><code>{"--refresh"}</code></nobr> | Обновите кеш моделей на сайте models.dev. |
| <nobr><code>{"--verbose"}</code></nobr> | Используйте более подробный вывод модели (включая метаданные, такие как затраты). |
Используйте флаг `--refresh` для обновления списка кэшированных моделей. Это полезно, когда к поставщику добавлены новые модели и вы хотите увидеть их в opencode.
@@ -335,20 +339,25 @@ opencode run --attach http://localhost:4096 "Explain async/await in JavaScript"
#### Флаги
| Флаг | Короткий | Описание |
| ------------ | -------- | -------------------------------------------------------------------------------- |
| `--command` | | Команда для запуска, используйте сообщение для аргументов |
| `--continue` | `-c` | Продолжить последний сеанс |
| `--session` | `-s` | Идентификатор сеанса для продолжения |
| `--fork` | | Разветвить сеанс при продолжении (используйте с `--continue` или `--session`) |
| `--share` | | Поделиться сеансом |
| `--model` | `-m` | Модель для использования в виде поставщика/модели. |
| `--agent` | | Агент для использования |
| `--file` | `-f` | Файл(ы) для прикрепления к сообщению |
| `--format` | | Формат: по умолчанию (отформатированный) или json (необработанные события JSON). |
| `--title` | | Название сеанса (использует усеченное приглашение, если значение не указано) |
| `--attach` | | Подключитесь к работающему серверу opencode (например, http://localhost:4096) |
| `--port` | | Порт локального сервера (по умолчанию случайный порт) |
| Флаг | Короткий | Описание |
| ---------------------------------------- | -------- | ------------------------------------------------------------------------------------------------ |
| <nobr><code>{"--command"}</code></nobr> | | Команда для запуска, используйте сообщение для аргументов |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Продолжить последний сеанс |
| <nobr><code>{"--session"}</code></nobr> | `-s` | Идентификатор сеанса для продолжения |
| <nobr><code>{"--fork"}</code></nobr> | | Разветвить сеанс при продолжении (используйте с `--continue` или `--session`) |
| <nobr><code>{"--share"}</code></nobr> | | Поделиться сеансом |
| <nobr><code>{"--model"}</code></nobr> | `-m` | Модель для использования в виде поставщика/модели. |
| <nobr><code>{"--agent"}</code></nobr> | | Агент для использования |
| <nobr><code>{"--file"}</code></nobr> | `-f` | Файл(ы) для прикрепления к сообщению |
| <nobr><code>{"--format"}</code></nobr> | | Формат: по умолчанию (отформатированный) или json (необработанные события JSON). |
| <nobr><code>{"--title"}</code></nobr> | | Название сеанса (использует усеченное приглашение, если значение не указано) |
| <nobr><code>{"--attach"}</code></nobr> | | Подключитесь к работающему серверу opencode (например, http://localhost:4096) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Пароль базовой аутентификации (по умолчанию `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Имя пользователя базовой аутентификации (по умолчанию `OPENCODE_SERVER_USERNAME` или `opencode`) |
| <nobr><code>{"--dir"}</code></nobr> | | Каталог для выполнения или путь на удалённом сервере при подключении |
| <nobr><code>{"--variant"}</code></nobr> | | Вариант модели (уровень рассуждений для провайдера) |
| <nobr><code>{"--thinking"}</code></nobr> | | Показать блоки размышлений |
| <nobr><code>{"--port"}</code></nobr> | | Порт локального сервера (по умолчанию случайный порт) |
---
@@ -364,12 +373,12 @@ opencode serve
#### Флаги
| Флаг | Описание |
| ------------ | ------------------------------------------------------------- |
| `--port` | Порт для прослушивания |
| `--hostname` | Имя хоста для прослушивания |
| `--mdns` | Включить обнаружение mDNS |
| `--cors` | Дополнительные источники браузера, позволяющие разрешить CORS |
| Флаг | Описание |
| ---------------------------------------- | ------------------------------------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | Порт для прослушивания |
| <nobr><code>{"--hostname"}</code></nobr> | Имя хоста для прослушивания |
| <nobr><code>{"--mdns"}</code></nobr> | Включить обнаружение mDNS |
| <nobr><code>{"--cors"}</code></nobr> | Дополнительные источники браузера, позволяющие разрешить CORS |
---
@@ -393,10 +402,10 @@ opencode session list
##### Флаги
| Флаг | Короткий | Описание |
| ------------- | -------- | ----------------------------------------- |
| `--max-count` | `-n` | Ограничить N последних сеансов. |
| `--format` | | Формат вывода: таблица или json (таблица) |
| Флаг | Короткий | Описание |
| ----------------------------------------- | -------- | ----------------------------------------- |
| <nobr><code>{"--max-count"}</code></nobr> | `-n` | Ограничить N последних сеансов. |
| <nobr><code>{"--format"}</code></nobr> | | Формат вывода: таблица или json (таблица) |
---
@@ -410,12 +419,12 @@ opencode stats
#### Флаги
| Флаг | Описание |
| ----------- | ---------------------------------------------------------------------------------------------------------- |
| `--days` | Показать статистику за последние N дней (все время) |
| `--tools` | Количество инструментов для отображения (все) |
| `--models` | Показать разбивку по использованию модели (по умолчанию скрыто). Передайте номер, чтобы показать верхнюю N |
| `--project` | Фильтровать по проекту (все проекты, пустая строка: текущий проект) |
| Флаг | Описание |
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| <nobr><code>{"--days"}</code></nobr> | Показать статистику за последние N дней (все время) |
| <nobr><code>{"--tools"}</code></nobr> | Количество инструментов для отображения (все) |
| <nobr><code>{"--models"}</code></nobr> | Показать разбивку по использованию модели (по умолчанию скрыто). Передайте номер, чтобы показать верхнюю N |
| <nobr><code>{"--project"}</code></nobr> | Фильтровать по проекту (все проекты, пустая строка: текущий проект) |
---
@@ -460,12 +469,12 @@ opencode web
#### Флаги
| Флаг | Описание |
| ------------ | ------------------------------------------------------------- |
| `--port` | Порт для прослушивания |
| `--hostname` | Имя хоста для прослушивания |
| `--mdns` | Включить обнаружение mDNS |
| `--cors` | Дополнительные источники браузера, позволяющие разрешить CORS |
| Флаг | Описание |
| ---------------------------------------- | ------------------------------------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | Порт для прослушивания |
| <nobr><code>{"--hostname"}</code></nobr> | Имя хоста для прослушивания |
| <nobr><code>{"--mdns"}</code></nobr> | Включить обнаружение mDNS |
| <nobr><code>{"--cors"}</code></nobr> | Дополнительные источники браузера, позволяющие разрешить CORS |
---
@@ -481,11 +490,11 @@ opencode acp
#### Флаги
| Флаг | Описание |
| ------------ | --------------------------- |
| `--cwd` | Рабочий каталог |
| `--port` | Порт для прослушивания |
| `--hostname` | Имя хоста для прослушивания |
| Флаг | Описание |
| ---------------------------------------- | --------------------------- |
| <nobr><code>{"--cwd"}</code></nobr> | Рабочий каталог |
| <nobr><code>{"--port"}</code></nobr> | Порт для прослушивания |
| <nobr><code>{"--hostname"}</code></nobr> | Имя хоста для прослушивания |
---
@@ -499,12 +508,12 @@ opencode uninstall
#### Флаги
| Флаг | Короткий | Описание |
| --------------- | -------- | ------------------------------------------ |
| `--keep-config` | `-c` | Сохраняйте файлы конфигурации |
| `--keep-data` | `-d` | Храните данные сеанса и снимки |
| `--dry-run` | | Покажите, что было бы удалено без удаления |
| `--force` | `-f` | Пропустить запросы подтверждения |
| Флаг | Короткий | Описание |
| ------------------------------------------- | -------- | ------------------------------------------ |
| <nobr><code>{"--keep-config"}</code></nobr> | `-c` | Сохраняйте файлы конфигурации |
| <nobr><code>{"--keep-data"}</code></nobr> | `-d` | Храните данные сеанса и снимки |
| <nobr><code>{"--dry-run"}</code></nobr> | | Покажите, что было бы удалено без удаления |
| <nobr><code>{"--force"}</code></nobr> | `-f` | Пропустить запросы подтверждения |
---
@@ -530,9 +539,9 @@ opencode upgrade v0.1.48
#### Флаги
| Флаг | Короткий | Описание |
| ---------- | -------- | --------------------------------------------------------- |
| `--method` | `-m` | Используемый метод установки: local, npm, pnpm, bun, brew |
| Флаг | Короткий | Описание |
| -------------------------------------- | -------- | --------------------------------------------------------- |
| <nobr><code>{"--method"}</code></nobr> | `-m` | Используемый метод установки: local, npm, pnpm, bun, brew |
---
@@ -540,12 +549,12 @@ opencode upgrade v0.1.48
CLI opencode принимает следующие глобальные флаги.
| Флаг | Короткий | Описание |
| -------------- | -------- | ------------------------------------------ |
| `--help` | `-h` | Отобразить справку |
| `--version` | `-v` | Распечатать номер версии |
| `--print-logs` | | Печать журналов в stderr |
| `--log-level` | | Уровень журнала (DEBUG, INFO, WARN, ERROR) |
| Флаг | Короткий | Описание |
| ------------------------------------------ | -------- | ------------------------------------------ |
| <nobr><code>{"--help"}</code></nobr> | `-h` | Отобразить справку |
| <nobr><code>{"--version"}</code></nobr> | `-v` | Распечатать номер версии |
| <nobr><code>{"--print-logs"}</code></nobr> | | Печать журналов в stderr |
| <nobr><code>{"--log-level"}</code></nobr> | | Уровень журнала (DEBUG, INFO, WARN, ERROR) |
---

View File

@@ -29,16 +29,16 @@ opencode [project]
#### แฟล็ก
| แฟล็ก | สั้น | คำอธิบาย |
| ------------ | ---- | ---------------------------------------------------------- |
| `--continue` | `-c` | ดำเนินการต่อจากเซสชันล่าสุด |
| `--session` | `-s` | ID เซสชันเพื่อดำเนินการต่อ |
| `--fork` | | แยกเซสชันเมื่อทำต่อ (ใช้กับ `--continue` หรือ `--session`) |
| `--prompt` | | พรอมต์เริ่มต้นที่จะใช้ |
| `--model` | `-m` | โมเดลที่จะใช้ในรูปแบบ provider/model |
| `--agent` | | เอเจนต์ที่จะใช้ |
| `--port` | | พอร์ตที่จะฟัง |
| `--hostname` | | ชื่อโฮสต์ที่จะฟัง |
| แฟล็ก | สั้น | คำอธิบาย |
| ---------------------------------------- | ---- | ---------------------------------------------------------- |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | ดำเนินการต่อจากเซสชันล่าสุด |
| <nobr><code>{"--session"}</code></nobr> | `-s` | ID เซสชันเพื่อดำเนินการต่อ |
| <nobr><code>{"--fork"}</code></nobr> | | แยกเซสชันเมื่อทำต่อ (ใช้กับ `--continue` หรือ `--session`) |
| <nobr><code>{"--prompt"}</code></nobr> | | พรอมต์เริ่มต้นที่จะใช้ |
| <nobr><code>{"--model"}</code></nobr> | `-m` | โมเดลที่จะใช้ในรูปแบบ provider/model |
| <nobr><code>{"--agent"}</code></nobr> | | เอเจนต์ที่จะใช้ |
| <nobr><code>{"--port"}</code></nobr> | | พอร์ตที่จะฟัง |
| <nobr><code>{"--hostname"}</code></nobr> | | ชื่อโฮสต์ที่จะฟัง |
---
@@ -78,10 +78,14 @@ opencode attach http://10.20.30.40:4096
#### แฟล็ก
| แฟล็ก | สั้น | คำอธิบาย |
| ----------- | ---- | -------------------------------------- |
| `--dir` | | ไดเร็กทอรีการทำงานเพื่อเริ่มต้น TUI ใน |
| `--session` | `-s` | ID เซสชันเพื่อดำเนินการต่อ |
| แฟล็ก | สั้น | คำอธิบาย |
| ---------------------------------------- | ---- | ------------------------------------------------------------------------------------------- |
| <nobr><code>{"--dir"}</code></nobr> | | ไดเร็กทอรีการทำงานเพื่อเริ่มต้น TUI ใน |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | ดำเนินการต่อจากเซสชันล่าสุด |
| <nobr><code>{"--session"}</code></nobr> | `-s` | ID เซสชันเพื่อดำเนินการต่อ |
| <nobr><code>{"--fork"}</code></nobr> | | แยกเซสชันเมื่อดำเนินการต่อ (ใช้กับ `--continue` หรือ `--session`) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | รหัสผ่านการยืนยันตัวตนพื้นฐาน (ค่าเริ่มต้นคือ `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | ชื่อผู้ใช้การยืนยันตัวตนพื้นฐาน (ค่าเริ่มต้นคือ `OPENCODE_SERVER_USERNAME` หรือ `opencode`) |
---
@@ -187,10 +191,10 @@ opencode github run
##### แฟล็ก
| แฟล็ก | คำอธิบาย |
| --------- | -------------------------------------- |
| `--event` | เหตุการณ์ GitHub เพื่อทริกเกอร์เอเจนต์ |
| `--token` | GitHub token |
| แฟล็ก | คำอธิบาย |
| ------------------------------------- | -------------------------------------- |
| <nobr><code>{"--event"}</code></nobr> | เหตุการณ์ GitHub เพื่อทริกเกอร์เอเจนต์ |
| <nobr><code>{"--token"}</code></nobr> | GitHub token |
---
@@ -296,11 +300,11 @@ opencode models anthropic
#### แฟล็ก
| แฟล็ก | คำอธิบาย |
| ----------- | ------------------------------------------------------ |
| `--refresh` | รีเฟรชแคชโมเดลจาก models.dev |
| `--verbose` | แสดงรายละเอียดโมเดลเพิ่มเติม (รวมข้อมูลเมตาเช่นต้นทุน) |
| `--json` | แสดงผลลัพธ์เป็น JSON |
| แฟล็ก | คำอธิบาย |
| --------------------------------------- | ------------------------------------------------------ |
| <nobr><code>{"--refresh"}</code></nobr> | รีเฟรชแคชโมเดลจาก models.dev |
| <nobr><code>{"--verbose"}</code></nobr> | แสดงรายละเอียดโมเดลเพิ่มเติม (รวมข้อมูลเมตาเช่นต้นทุน) |
| <nobr><code>{"--json"}</code></nobr> | แสดงผลลัพธ์เป็น JSON |
ใช้แฟล็ก `--refresh` เพื่ออัปเดตรายการโมเดลที่แคชไว้ มีประโยชน์เมื่อมีการเพิ่มโมเดลใหม่ให้กับผู้ให้บริการและคุณต้องการเห็นใน OpenCode
@@ -336,20 +340,25 @@ opencode run --attach http://localhost:4096 "Explain async/await in JavaScript"
#### แฟล็ก
| แฟล็ก | สั้น | คำอธิบาย |
| ------------ | ---- | ---------------------------------------------------------------------- |
| `--command` | | คำสั่งที่จะรัน (ใช้ส่วนที่เหลือของ args เป็นอาร์กิวเมนต์) |
| `--continue` | `-c` | ดำเนินการต่อจากเซสชันล่าสุด |
| `--session` | `-s` | ID เซสชันเพื่อดำเนินการต่อ |
| `--fork` | | แยกเซสชันเมื่อทำต่อ (ใช้กับ `--continue` หรือ `--session`) |
| `--share` | | สร้างลิงก์แชร์สำหรับเซสชัน |
| `--model` | `-m` | โมเดลที่จะใช้ในรูปแบบ provider/model |
| `--agent` | | เอเจนต์ที่จะใช้ |
| `--file` | `-f` | แนบไฟล์ไปกับข้อความ |
| `--format` | | รูปแบบเอาต์พุต: text (จัดรูปแบบ) หรือ json (JSON ดิบ) |
| `--title` | | ชื่อสำหรับเซสชัน (หากไม่ได้ระบุ จะสร้างจากพรอมต์) |
| `--attach` | | แนบไปกับเซิร์ฟเวอร์ opencode ที่ทำงานอยู่ (เช่น http://localhost:4096) |
| `--port` | | พอร์ตสำหรับเซิร์ฟเวอร์ภายในเครื่อง (หากไม่ได้ระบุ จะใช้พอร์ตสุ่ม) |
| แฟล็ก | สั้น | คำอธิบาย |
| ---------------------------------------- | ---- | ------------------------------------------------------------------------------------------- |
| <nobr><code>{"--command"}</code></nobr> | | คำสั่งที่จะรัน (ใช้ส่วนที่เหลือของ args เป็นอาร์กิวเมนต์) |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | ดำเนินการต่อจากเซสชันล่าสุด |
| <nobr><code>{"--session"}</code></nobr> | `-s` | ID เซสชันเพื่อดำเนินการต่อ |
| <nobr><code>{"--fork"}</code></nobr> | | แยกเซสชันเมื่อทำต่อ (ใช้กับ `--continue` หรือ `--session`) |
| <nobr><code>{"--share"}</code></nobr> | | สร้างลิงก์แชร์สำหรับเซสชัน |
| <nobr><code>{"--model"}</code></nobr> | `-m` | โมเดลที่จะใช้ในรูปแบบ provider/model |
| <nobr><code>{"--agent"}</code></nobr> | | เอเจนต์ที่จะใช้ |
| <nobr><code>{"--file"}</code></nobr> | `-f` | แนบไฟล์ไปกับข้อความ |
| <nobr><code>{"--format"}</code></nobr> | | รูปแบบเอาต์พุต: text (จัดรูปแบบ) หรือ json (JSON ดิบ) |
| <nobr><code>{"--title"}</code></nobr> | | ชื่อสำหรับเซสชัน (หากไม่ได้ระบุ จะสร้างจากพรอมต์) |
| <nobr><code>{"--attach"}</code></nobr> | | แนบไปกับเซิร์ฟเวอร์ opencode ที่ทำงานอยู่ (เช่น http://localhost:4096) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | รหัสผ่านการยืนยันตัวตนพื้นฐาน (ค่าเริ่มต้นคือ `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | ชื่อผู้ใช้การยืนยันตัวตนพื้นฐาน (ค่าเริ่มต้นคือ `OPENCODE_SERVER_USERNAME` หรือ `opencode`) |
| <nobr><code>{"--dir"}</code></nobr> | | ไดเร็กทอรีสำหรับรัน หรือเส้นทางบนเซิร์ฟเวอร์ระยะไกลเมื่อแนบ |
| <nobr><code>{"--variant"}</code></nobr> | | ตัวแปรโมเดล (ระดับการใช้เหตุผลเฉพาะผู้ให้บริการ) |
| <nobr><code>{"--thinking"}</code></nobr> | | แสดงบล็อกความคิด |
| <nobr><code>{"--port"}</code></nobr> | | พอร์ตสำหรับเซิร์ฟเวอร์ภายในเครื่อง (หากไม่ได้ระบุ จะใช้พอร์ตสุ่ม) |
---
@@ -365,12 +374,12 @@ opencode serve
#### แฟล็ก
| แฟล็ก | คำอธิบาย |
| ------------ | -------------------------------------- |
| `--port` | พอร์ตที่จะฟัง |
| `--hostname` | ชื่อโฮสต์ที่จะฟัง |
| `--mdns` | เปิดใช้งานการค้นหา mDNS |
| `--cors` | ต้นกำเนิดเพิ่มเติมที่อนุญาตสำหรับ CORS |
| แฟล็ก | คำอธิบาย |
| ---------------------------------------- | -------------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | พอร์ตที่จะฟัง |
| <nobr><code>{"--hostname"}</code></nobr> | ชื่อโฮสต์ที่จะฟัง |
| <nobr><code>{"--mdns"}</code></nobr> | เปิดใช้งานการค้นหา mDNS |
| <nobr><code>{"--cors"}</code></nobr> | ต้นกำเนิดเพิ่มเติมที่อนุญาตสำหรับ CORS |
---
@@ -394,10 +403,10 @@ opencode session list
##### แฟล็ก
| แฟล็ก | สั้น | คำอธิบาย |
| ------------- | ---- | ----------------------------- |
| `--max-count` | `-n` | จำกัดการแสดงผล N รายการล่าสุด |
| `--format` | | รูปแบบ table หรือ json |
| แฟล็ก | สั้น | คำอธิบาย |
| ----------------------------------------- | ---- | ----------------------------- |
| <nobr><code>{"--max-count"}</code></nobr> | `-n` | จำกัดการแสดงผล N รายการล่าสุด |
| <nobr><code>{"--format"}</code></nobr> | | รูปแบบ table หรือ json |
---
@@ -411,12 +420,12 @@ opencode stats
#### แฟล็ก
| แฟล็ก | คำอธิบาย |
| ----------- | ---------------------------------------------------- |
| `--days` | แสดงสถิติของ N วันที่ผ่านมา (ค่าเริ่มต้น: ตลอดเวลา) |
| `--tools` | แสดงสถิติการใช้เครื่องมือ |
| `--models` | แสดงรายละเอียดการใช้งานโมเดล (ซ่อนไว้ตามค่าเริ่มต้น) |
| `--project` | กรองตามโครงการ (ค่าเริ่มต้น: โครงการปัจจุบัน) |
| แฟล็ก | คำอธิบาย |
| --------------------------------------- | ---------------------------------------------------- |
| <nobr><code>{"--days"}</code></nobr> | แสดงสถิติของ N วันที่ผ่านมา (ค่าเริ่มต้น: ตลอดเวลา) |
| <nobr><code>{"--tools"}</code></nobr> | แสดงสถิติการใช้เครื่องมือ |
| <nobr><code>{"--models"}</code></nobr> | แสดงรายละเอียดการใช้งานโมเดล (ซ่อนไว้ตามค่าเริ่มต้น) |
| <nobr><code>{"--project"}</code></nobr> | กรองตามโครงการ (ค่าเริ่มต้น: โครงการปัจจุบัน) |
---
@@ -461,12 +470,12 @@ opencode web
#### แฟล็ก
| แฟล็ก | คำอธิบาย |
| ------------ | -------------------------------------- |
| `--port` | พอร์ตที่จะฟัง |
| `--hostname` | ชื่อโฮสต์ที่จะฟัง |
| `--mdns` | เปิดใช้งานการค้นหา mDNS |
| `--cors` | ต้นกำเนิดเพิ่มเติมที่อนุญาตสำหรับ CORS |
| แฟล็ก | คำอธิบาย |
| ---------------------------------------- | -------------------------------------- |
| <nobr><code>{"--port"}</code></nobr> | พอร์ตที่จะฟัง |
| <nobr><code>{"--hostname"}</code></nobr> | ชื่อโฮสต์ที่จะฟัง |
| <nobr><code>{"--mdns"}</code></nobr> | เปิดใช้งานการค้นหา mDNS |
| <nobr><code>{"--cors"}</code></nobr> | ต้นกำเนิดเพิ่มเติมที่อนุญาตสำหรับ CORS |
---
@@ -482,11 +491,11 @@ opencode acp
#### แฟล็ก
| แฟล็ก | คำอธิบาย |
| ------------ | ------------------ |
| `--cwd` | ไดเร็กทอรีการทำงาน |
| `--port` | พอร์ตที่จะฟัง |
| `--hostname` | ชื่อโฮสต์ที่จะฟัง |
| แฟล็ก | คำอธิบาย |
| ---------------------------------------- | ------------------ |
| <nobr><code>{"--cwd"}</code></nobr> | ไดเร็กทอรีการทำงาน |
| <nobr><code>{"--port"}</code></nobr> | พอร์ตที่จะฟัง |
| <nobr><code>{"--hostname"}</code></nobr> | ชื่อโฮสต์ที่จะฟัง |
---
@@ -500,12 +509,12 @@ opencode uninstall
#### แฟล็ก
| แฟล็ก | สั้น | คำอธิบาย |
| --------------- | ---- | ----------------------------------- |
| `--keep-config` | `-c` | เก็บไฟล์การกำหนดค่าไว้ |
| `--keep-data` | `-d` | เก็บไฟล์ข้อมูล (เซสชันและสแน็ปช็อต) |
| `--dry-run` | | แสดงสิ่งที่จะลบออกโดยไม่ต้องทำจริง |
| `--force` | `-f` | บังคับลบโดยไม่มีการแจ้งเตือน |
| แฟล็ก | สั้น | คำอธิบาย |
| ------------------------------------------- | ---- | ----------------------------------- |
| <nobr><code>{"--keep-config"}</code></nobr> | `-c` | เก็บไฟล์การกำหนดค่าไว้ |
| <nobr><code>{"--keep-data"}</code></nobr> | `-d` | เก็บไฟล์ข้อมูล (เซสชันและสแน็ปช็อต) |
| <nobr><code>{"--dry-run"}</code></nobr> | | แสดงสิ่งที่จะลบออกโดยไม่ต้องทำจริง |
| <nobr><code>{"--force"}</code></nobr> | `-f` | บังคับลบโดยไม่มีการแจ้งเตือน |
---
@@ -531,9 +540,9 @@ opencode upgrade v0.1.48
#### แฟล็ก
| แฟล็ก | สั้น | คำอธิบาย |
| ---------- | ---- | ----------------------------------------------- |
| `--method` | `-m` | วิธีการติดตั้งที่ใช้ curl, npm, pnpm, bun, brew |
| แฟล็ก | สั้น | คำอธิบาย |
| -------------------------------------- | ---- | ----------------------------------------------- |
| <nobr><code>{"--method"}</code></nobr> | `-m` | วิธีการติดตั้งที่ใช้ curl, npm, pnpm, bun, brew |
---
@@ -541,12 +550,12 @@ opencode upgrade v0.1.48
OpenCode CLI ยอมรับแฟล็กสากลต่อไปนี้สำหรับทุกคำสั่ง
| แฟล็ก | สั้น | คำอธิบาย |
| -------------- | ---- | ----------------------------------------- |
| `--help` | `-h` | แสดงความช่วยเหลือ |
| `--version` | `-v` | พิมพ์เวอร์ชัน |
| `--print-logs` | | พิมพ์บันทึกไปยัง stderr |
| `--log-level` | | ระดับการบันทึก (DEBUG, INFO, WARN, ERROR) |
| แฟล็ก | สั้น | คำอธิบาย |
| ------------------------------------------ | ---- | ----------------------------------------- |
| <nobr><code>{"--help"}</code></nobr> | `-h` | แสดงความช่วยเหลือ |
| <nobr><code>{"--version"}</code></nobr> | `-v` | พิมพ์เวอร์ชัน |
| <nobr><code>{"--print-logs"}</code></nobr> | | พิมพ์บันทึกไปยัง stderr |
| <nobr><code>{"--log-level"}</code></nobr> | | ระดับการบันทึก (DEBUG, INFO, WARN, ERROR) |
---

View File

@@ -29,16 +29,16 @@ opencode [project]
#### Bayraklar
| Bayrak | Kısa | Açıklama |
| ------------ | ---- | --------------------------------------------------------------------------- |
| `--continue` | `-c` | Son oturuma devam et |
| `--session` | `-s` | Devam edecek oturum kimliği |
| `--fork` | | Devam ederken oturumu fork'lar (`--continue` veya `--session` ile kullanın) |
| `--prompt` | | Kullanılacak prompt |
| `--model` | `-m` | provider/model biçiminde kullanılacak model |
| `--agent` | | Kullanılacak agent |
| `--port` | | Dinlenecek port |
| `--hostname` | | Dinlenecek host adı |
| Bayrak | Kısa | Açıklama |
| ---------------------------------------- | ---- | --------------------------------------------------------------------------- |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Son oturuma devam et |
| <nobr><code>{"--session"}</code></nobr> | `-s` | Devam edecek oturum kimliği |
| <nobr><code>{"--fork"}</code></nobr> | | Devam ederken oturumu fork'lar (`--continue` veya `--session` ile kullanın) |
| <nobr><code>{"--prompt"}</code></nobr> | | Kullanılacak prompt |
| <nobr><code>{"--model"}</code></nobr> | `-m` | provider/model biçiminde kullanılacak model |
| <nobr><code>{"--agent"}</code></nobr> | | Kullanılacak agent |
| <nobr><code>{"--port"}</code></nobr> | | Dinlenecek port |
| <nobr><code>{"--hostname"}</code></nobr> | | Dinlenecek host adı |
---
@@ -78,10 +78,14 @@ opencode attach http://10.20.30.40:4096
#### Bayraklar
| Bayrak | Kısa | Tanım |
| ----------- | ---- | ------------------------------------ |
| `--dir` | | TUI'yi başlatmak için çalışma dizini |
| `--session` | `-s` | Devam edecek oturum açma bilgileri |
| Bayrak | Kısa | Tanım |
| ---------------------------------------- | ---- | --------------------------------------------------------------------------------------------- |
| <nobr><code>{"--dir"}</code></nobr> | | TUI'yi başlatmak için çalışma dizini |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Son oturuma devam et |
| <nobr><code>{"--session"}</code></nobr> | `-s` | Devam edecek oturum açma bilgileri |
| <nobr><code>{"--fork"}</code></nobr> | | Devam ederken oturumu çatalla (`--continue` veya `--session` ile kullanın) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Temel kimlik doğrulama parolası (varsayılan: `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Temel kimlik doğrulama kullanıcı adı (varsayılan: `OPENCODE_SERVER_USERNAME` veya `opencode`) |
---
@@ -187,10 +191,10 @@ opencode github run
##### Bayraklar
| Bayrak | Açıklama |
| --------- | ------------------------------------------- |
| `--event` | Aracıyı çalıştırmak için GitHub sahte olayı |
| `--token` | GitHub personal access token |
| Bayrak | Açıklama |
| ------------------------------------- | ------------------------------------------- |
| <nobr><code>{"--event"}</code></nobr> | Aracıyı çalıştırmak için GitHub sahte olayı |
| <nobr><code>{"--token"}</code></nobr> | GitHub personal access token |
---
@@ -296,10 +300,10 @@ opencode models anthropic
#### Bayraklar
| Bayrak | Tanım |
| ----------- | --------------------------------------------------------------------------- |
| `--refresh` | Modeller.dev'den model önbelleğini yenileyin |
| `--verbose` | Daha ayrıntılı model çıktısı kullanın (maliyetler gibi meta veriler içerir) |
| Bayrak | Tanım |
| --------------------------------------- | --------------------------------------------------------------------------- |
| <nobr><code>{"--refresh"}</code></nobr> | Modeller.dev'den model önbelleğini yenileyin |
| <nobr><code>{"--verbose"}</code></nobr> | Daha ayrıntılı model çıktısı kullanın (maliyetler gibi meta veriler içerir) |
Önbelleğe alınan model listesini güncellemek için `--refresh` bayrağını kullanın. Bu, bir sağlayıcıya yeni modeller eklendiğinde ve bunları opencode'da görmek istediğinizde kullanışlıdır.
@@ -335,20 +339,25 @@ opencode run --attach http://localhost:4096 "Explain async/await in JavaScript"
#### Bayraklar
| Bayrak | Kısa | Açıklama |
| ------------ | ---- | --------------------------------------------------------------------------------- |
| `--command` | | Çalıştırılacak komut, args için mesajı kullanın |
| `--continue` | `-c` | Son oturuma devam et |
| `--session` | `-s` | Devam edecek oturum kimliği |
| `--fork` | | Devam ederken oturumu fork'lar (`--continue` veya `--session` ile kullanın) |
| `--share` | | Oturumu paylaşın |
| `--model` | `-m` | provider/model biçiminde kullanılacak model |
| `--agent` | | Kullanılacak temsilci |
| `--file` | `-f` | Mesaja eklenecek dosya(lar) |
| `--format` | | Biçim: varsayılan (biçimlendirilmiş) veya json (ham JSON olayları) |
| `--title` | | Oturumun başlığı (değer sağlanmazsa kısaltılmış bilgi istemi kullanılır) |
| `--attach` | | Çalışan bir opencode sunucusuna ekleyin (ör. http://localhost:4096) |
| `--port` | | Yerel sunucunun bağlantı noktası (varsayılan olarak rastgele bağlantı noktasıdır) |
| Bayrak | Kısa | Açıklama |
| ---------------------------------------- | ---- | --------------------------------------------------------------------------------------------- |
| <nobr><code>{"--command"}</code></nobr> | | Çalıştırılacak komut, args için mesajı kullanın |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | Son oturuma devam et |
| <nobr><code>{"--session"}</code></nobr> | `-s` | Devam edecek oturum kimliği |
| <nobr><code>{"--fork"}</code></nobr> | | Devam ederken oturumu fork'lar (`--continue` veya `--session` ile kullanın) |
| <nobr><code>{"--share"}</code></nobr> | | Oturumu paylaşın |
| <nobr><code>{"--model"}</code></nobr> | `-m` | provider/model biçiminde kullanılacak model |
| <nobr><code>{"--agent"}</code></nobr> | | Kullanılacak temsilci |
| <nobr><code>{"--file"}</code></nobr> | `-f` | Mesaja eklenecek dosya(lar) |
| <nobr><code>{"--format"}</code></nobr> | | Biçim: varsayılan (biçimlendirilmiş) veya json (ham JSON olayları) |
| <nobr><code>{"--title"}</code></nobr> | | Oturumun başlığı (değer sağlanmazsa kısaltılmış bilgi istemi kullanılır) |
| <nobr><code>{"--attach"}</code></nobr> | | Çalışan bir opencode sunucusuna ekleyin (ör. http://localhost:4096) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | Temel kimlik doğrulama parolası (varsayılan: `OPENCODE_SERVER_PASSWORD`) |
| <nobr><code>{"--username"}</code></nobr> | `-u` | Temel kimlik doğrulama kullanıcı adı (varsayılan: `OPENCODE_SERVER_USERNAME` veya `opencode`) |
| <nobr><code>{"--dir"}</code></nobr> | | Çalıştırılacak dizin veya bağlanırken uzak sunucudaki yol |
| <nobr><code>{"--variant"}</code></nobr> | | Model varyantı (sağlayıcıya özgü muhakeme düzeyi) |
| <nobr><code>{"--thinking"}</code></nobr> | | Düşünme bloklarını göster |
| <nobr><code>{"--port"}</code></nobr> | | Yerel sunucunun bağlantı noktası (varsayılan olarak rastgele bağlantı noktasıdır) |
---
@@ -364,12 +373,12 @@ Bu, TUI arayüzü olmadan opencode işlevselliğine API erişimi sağlayan bir H
#### Bayraklar
| Bayrak | Tanım |
| ------------ | ------------------------------------------ |
| `--port` | Dinlenecek bağlantı noktası |
| `--hostname` | Dinlenecek ana bilgisayar adı |
| `--mdns` | mDNS bulmayı etkinleştir |
| `--cors` | CORS'a izin verecek ek tarayıcı kaynakları |
| Bayrak | Tanım |
| ---------------------------------------- | ------------------------------------------ |
| <nobr><code>{"--port"}</code></nobr> | Dinlenecek bağlantı noktası |
| <nobr><code>{"--hostname"}</code></nobr> | Dinlenecek ana bilgisayar adı |
| <nobr><code>{"--mdns"}</code></nobr> | mDNS bulmayı etkinleştir |
| <nobr><code>{"--cors"}</code></nobr> | CORS'a izin verecek ek tarayıcı kaynakları |
---
@@ -393,10 +402,10 @@ opencode session list
##### Bayraklar
| Bayrak | Kısa | Tanım |
| ------------- | ---- | -------------------------------------- |
| `--max-count` | `-n` | En son N oturumla sınırla |
| `--format` | | Çıkış formatı: tablo veya json (tablo) |
| Bayrak | Kısa | Tanım |
| ----------------------------------------- | ---- | -------------------------------------- |
| <nobr><code>{"--max-count"}</code></nobr> | `-n` | En son N oturumla sınırla |
| <nobr><code>{"--format"}</code></nobr> | | Çıkış formatı: tablo veya json (tablo) |
---
@@ -410,12 +419,12 @@ opencode stats
#### Bayraklar
| Bayrak | Açıklama |
| ----------- | ----------------------------------------------------------------------------------------------------------- |
| `--days` | Son N güne ait istatistikleri göster (tüm zamanlar) |
| `--tools` | Gösterilecek araç sayısı (tümü) |
| `--models` | Model kullanım dökümünü göster (varsayılan olarak gizlidir). En üstteki N'yi göstermek için bir sayı iletin |
| `--project` | Projeye göre filtrele (tüm projeler, boş değer: mevcut proje) |
| Bayrak | Açıklama |
| --------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| <nobr><code>{"--days"}</code></nobr> | Son N güne ait istatistikleri göster (tüm zamanlar) |
| <nobr><code>{"--tools"}</code></nobr> | Gösterilecek araç sayısı (tümü) |
| <nobr><code>{"--models"}</code></nobr> | Model kullanım dökümünü göster (varsayılan olarak gizlidir). En üstteki N'yi göstermek için bir sayı iletin |
| <nobr><code>{"--project"}</code></nobr> | Projeye göre filtrele (tüm projeler, boş değer: mevcut proje) |
---
@@ -460,12 +469,12 @@ Bu, bir HTTP sunucusunu başlatır ve bir web arayüzü aracılığıyla opencod
#### Bayraklar
| Bayrak | Tanım |
| ------------ | ------------------------------------------ |
| `--port` | Dinlenecek bağlantı noktası |
| `--hostname` | Dinlenecek ana bilgisayar adı |
| `--mdns` | mDNS bulmayı etkinleştir |
| `--cors` | CORS'a izin verecek ek tarayıcı kaynakları |
| Bayrak | Tanım |
| ---------------------------------------- | ------------------------------------------ |
| <nobr><code>{"--port"}</code></nobr> | Dinlenecek bağlantı noktası |
| <nobr><code>{"--hostname"}</code></nobr> | Dinlenecek ana bilgisayar adı |
| <nobr><code>{"--mdns"}</code></nobr> | mDNS bulmayı etkinleştir |
| <nobr><code>{"--cors"}</code></nobr> | CORS'a izin verecek ek tarayıcı kaynakları |
---
@@ -481,11 +490,11 @@ Bu komut, nd-JSON kullanarak stdin/stdout aracılığıyla iletişim kuran bir A
#### Bayraklar
| Bayrak | Açıklama |
| ------------ | ------------------- |
| `--cwd` | Çalışma dizini |
| `--port` | Dinlenecek port |
| `--hostname` | Dinlenecek host adı |
| Bayrak | Açıklama |
| ---------------------------------------- | ------------------- |
| <nobr><code>{"--cwd"}</code></nobr> | Çalışma dizini |
| <nobr><code>{"--port"}</code></nobr> | Dinlenecek port |
| <nobr><code>{"--hostname"}</code></nobr> | Dinlenecek host adı |
---
@@ -499,12 +508,12 @@ opencode uninstall
#### Bayraklar
| Bayrak | Kısa | Tanım |
| --------------- | ---- | ----------------------------------------------- |
| `--keep-config` | `-c` | Yapılandırma dosyalarını sakla |
| `--keep-data` | `-d` | Oturum verilerini ve anlık görüntüleri saklayın |
| `--dry-run` | | Nelerin kaldırılmadan kaldırılacağı göster |
| `--force` | `-f` | Onay istemlerini atla |
| Bayrak | Kısa | Tanım |
| ------------------------------------------- | ---- | ----------------------------------------------- |
| <nobr><code>{"--keep-config"}</code></nobr> | `-c` | Yapılandırma dosyalarını sakla |
| <nobr><code>{"--keep-data"}</code></nobr> | `-d` | Oturum verilerini ve anlık görüntüleri saklayın |
| <nobr><code>{"--dry-run"}</code></nobr> | | Nelerin kaldırılmadan kaldırılacağı göster |
| <nobr><code>{"--force"}</code></nobr> | `-f` | Onay istemlerini atla |
---
@@ -530,9 +539,9 @@ opencode upgrade v0.1.48
#### Bayraklar
| Bayrak | Kısa | Açıklama |
| ---------- | ---- | ------------------------------------------------------ |
| `--method` | `-m` | Kullanılan kurulum yöntemi: curl, npm, pnpm, bun, brew |
| Bayrak | Kısa | Açıklama |
| -------------------------------------- | ---- | ------------------------------------------------------ |
| <nobr><code>{"--method"}</code></nobr> | `-m` | Kullanılan kurulum yöntemi: curl, npm, pnpm, bun, brew |
---
@@ -540,12 +549,12 @@ opencode upgrade v0.1.48
opencode CLI aşağıdaki global bayrakları destekler.
| Bayrak | Kısa | Tanım |
| -------------- | ---- | ---------------------------------------- |
| `--help` | `-h` | Yardımı görüntüle |
| `--version` | `-v` | Sürüm numarasını yazdır |
| `--print-logs` | | Günlükleri stderr'e yazdır |
| `--log-level` | | Günlük düzeyi (DEBUG, INFO, WARN, ERROR) |
| Bayrak | Kısa | Tanım |
| ------------------------------------------ | ---- | ---------------------------------------- |
| <nobr><code>{"--help"}</code></nobr> | `-h` | Yardımı görüntüle |
| <nobr><code>{"--version"}</code></nobr> | `-v` | Sürüm numarasını yazdır |
| <nobr><code>{"--print-logs"}</code></nobr> | | Günlükleri stderr'e yazdır |
| <nobr><code>{"--log-level"}</code></nobr> | | Günlük düzeyi (DEBUG, INFO, WARN, ERROR) |
---

View File

@@ -29,16 +29,16 @@ opencode [project]
#### 标志
| 标志 | 简写 | 描述 |
| ------------ | ---- | --------------------------------------------------------- |
| `--continue` | `-c` | 继续上一个会话 |
| `--session` | `-s` | 要继续的会话 ID |
| `--fork` | | 继续时分叉会话(与 `--continue` 或 `--session` 配合使用) |
| `--prompt` | | 要使用的提示词 |
| `--model` | `-m` | 要使用的模型,格式为 provider/model |
| `--agent` | | 要使用的代理 |
| `--port` | | 监听端口 |
| `--hostname` | | 监听主机名 |
| 标志 | 简写 | 描述 |
| ---------------------------------------- | ---- | --------------------------------------------------------- |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | 继续上一个会话 |
| <nobr><code>{"--session"}</code></nobr> | `-s` | 要继续的会话 ID |
| <nobr><code>{"--fork"}</code></nobr> | | 继续时分叉会话(与 `--continue` 或 `--session` 配合使用) |
| <nobr><code>{"--prompt"}</code></nobr> | | 要使用的提示词 |
| <nobr><code>{"--model"}</code></nobr> | `-m` | 要使用的模型,格式为 provider/model |
| <nobr><code>{"--agent"}</code></nobr> | | 要使用的代理 |
| <nobr><code>{"--port"}</code></nobr> | | 监听端口 |
| <nobr><code>{"--hostname"}</code></nobr> | | 监听主机名 |
---
@@ -78,10 +78,14 @@ opencode attach http://10.20.30.40:4096
#### 标志
| 标志 | 简写 | 描述 |
| ----------- | ---- | ------------------- |
| `--dir` | | 启动 TUI 的工作目录 |
| `--session` | `-s` | 继续的会话 ID |
| 标志 | 简写 | 描述 |
| ---------------------------------------- | ---- | ------------------------------------------------------------------- |
| <nobr><code>{"--dir"}</code></nobr> | | 启动 TUI 的工作目录 |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | 继续上一个会话 |
| <nobr><code>{"--session"}</code></nobr> | `-s` | 要继续的会话 ID |
| <nobr><code>{"--fork"}</code></nobr> | | 继续时派生会话(与 `--continue` 或 `--session` 一起使用) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | 基本认证密码(默认使用 `OPENCODE_SERVER_PASSWORD` |
| <nobr><code>{"--username"}</code></nobr> | `-u` | 基本认证用户名(默认使用 `OPENCODE_SERVER_USERNAME` 或 `opencode` |
---
@@ -187,10 +191,10 @@ opencode github run
##### 标志
| 标志 | 描述 |
| --------- | ------------------------------ |
| `--event` | 用于运行代理的 GitHub 模拟事件 |
| `--token` | GitHub 个人访问令牌 |
| 标志 | 描述 |
| ------------------------------------- | ------------------------------ |
| <nobr><code>{"--event"}</code></nobr> | 用于运行代理的 GitHub 模拟事件 |
| <nobr><code>{"--token"}</code></nobr> | GitHub 个人访问令牌 |
---
@@ -296,10 +300,10 @@ opencode models anthropic
#### 标志
| 标志 | 描述 |
| ----------- | ---------------------------------------- |
| `--refresh` | 从 models.dev 刷新模型缓存 |
| `--verbose` | 使用更详细的模型输出(包含费用等元数据) |
| 标志 | 描述 |
| --------------------------------------- | ---------------------------------------- |
| <nobr><code>{"--refresh"}</code></nobr> | 从 models.dev 刷新模型缓存 |
| <nobr><code>{"--verbose"}</code></nobr> | 使用更详细的模型输出(包含费用等元数据) |
使用 `--refresh` 标志可以更新缓存的模型列表。当提供商新增了模型并且您希望在 OpenCode 中看到它们时,此功能非常有用。
@@ -335,20 +339,25 @@ opencode run --attach http://localhost:4096 "Explain async/await in JavaScript"
#### 标志
| 标志 | 简写 | 描述 |
| ------------ | ---- | -------------------------------------------------------------- |
| `--command` | | 要运行的命令,使用 message 作为参数 |
| `--continue` | `-c` | 继续上一个会话 |
| `--session` | `-s` | 要继续的会话 ID |
| `--fork` | | 继续时分叉会话(与 `--continue` 或 `--session` 配合使用) |
| `--share` | | 分享会话 |
| `--model` | `-m` | 要使用的模型,格式为 provider/model |
| `--agent` | | 要使用的代理 |
| `--file` | `-f` | 附加到消息的文件 |
| `--format` | | 格式default格式化输出或 json原始 JSON 事件) |
| `--title` | | 会话标题(未提供值时使用截断的提示词) |
| `--attach` | | 连接到正在运行的 opencode 服务器(例如 http://localhost:4096 |
| `--port` | | 本地服务器端口(默认为随机端口) |
| 标志 | 简写 | 描述 |
| ---------------------------------------- | ---- | ------------------------------------------------------------------- |
| <nobr><code>{"--command"}</code></nobr> | | 要运行的命令,使用 message 作为参数 |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | 继续上一个会话 |
| <nobr><code>{"--session"}</code></nobr> | `-s` | 要继续的会话 ID |
| <nobr><code>{"--fork"}</code></nobr> | | 继续时分叉会话(与 `--continue` 或 `--session` 配合使用) |
| <nobr><code>{"--share"}</code></nobr> | | 分享会话 |
| <nobr><code>{"--model"}</code></nobr> | `-m` | 要使用的模型,格式为 provider/model |
| <nobr><code>{"--agent"}</code></nobr> | | 要使用的代理 |
| <nobr><code>{"--file"}</code></nobr> | `-f` | 附加到消息的文件 |
| <nobr><code>{"--format"}</code></nobr> | | 格式default格式化输出或 json原始 JSON 事件) |
| <nobr><code>{"--title"}</code></nobr> | | 会话标题(未提供值时使用截断的提示词) |
| <nobr><code>{"--attach"}</code></nobr> | | 连接到正在运行的 opencode 服务器(例如 http://localhost:4096 |
| <nobr><code>{"--password"}</code></nobr> | `-p` | 基本认证密码(默认使用 `OPENCODE_SERVER_PASSWORD` |
| <nobr><code>{"--username"}</code></nobr> | `-u` | 基本认证用户名(默认使用 `OPENCODE_SERVER_USERNAME` 或 `opencode` |
| <nobr><code>{"--dir"}</code></nobr> | | 运行目录,或附加时远程服务器上的路径 |
| <nobr><code>{"--variant"}</code></nobr> | | 模型变体(特定于提供商的推理级别) |
| <nobr><code>{"--thinking"}</code></nobr> | | 显示思考块 |
| <nobr><code>{"--port"}</code></nobr> | | 本地服务器端口(默认为随机端口) |
---
@@ -364,12 +373,12 @@ opencode serve
#### 标志
| 标志 | 描述 |
| ------------ | -------------------------- |
| `--port` | 监听端口 |
| `--hostname` | 监听主机名 |
| `--mdns` | 启用 mDNS 发现 |
| `--cors` | 允许 CORS 的额外浏览器来源 |
| 标志 | 描述 |
| ---------------------------------------- | -------------------------- |
| <nobr><code>{"--port"}</code></nobr> | 监听端口 |
| <nobr><code>{"--hostname"}</code></nobr> | 监听主机名 |
| <nobr><code>{"--mdns"}</code></nobr> | 启用 mDNS 发现 |
| <nobr><code>{"--cors"}</code></nobr> | 允许 CORS 的额外浏览器来源 |
---
@@ -393,10 +402,10 @@ opencode session list
##### 标志
| 标志 | 简写 | 描述 |
| ------------- | ---- | ------------------------------------- |
| `--max-count` | `-n` | 限制为最近 N 个会话 |
| `--format` | | 输出格式table 或 json默认 table |
| 标志 | 简写 | 描述 |
| ----------------------------------------- | ---- | ------------------------------------- |
| <nobr><code>{"--max-count"}</code></nobr> | `-n` | 限制为最近 N 个会话 |
| <nobr><code>{"--format"}</code></nobr> | | 输出格式table 或 json默认 table |
---
@@ -410,12 +419,12 @@ opencode stats
#### 标志
| 标志 | 描述 |
| ----------- | ------------------------------------------------------ |
| `--days` | 显示最近 N 天的统计信息(默认为所有时间) |
| `--tools` | 显示的工具数量(默认为全部) |
| `--models` | 显示模型用量明细(默认隐藏)。传入数字可显示前 N 个 |
| `--project` | 按项目筛选(默认为所有项目,传入空字符串表示当前项目) |
| 标志 | 描述 |
| --------------------------------------- | ------------------------------------------------------ |
| <nobr><code>{"--days"}</code></nobr> | 显示最近 N 天的统计信息(默认为所有时间) |
| <nobr><code>{"--tools"}</code></nobr> | 显示的工具数量(默认为全部) |
| <nobr><code>{"--models"}</code></nobr> | 显示模型用量明细(默认隐藏)。传入数字可显示前 N 个 |
| <nobr><code>{"--project"}</code></nobr> | 按项目筛选(默认为所有项目,传入空字符串表示当前项目) |
---
@@ -460,12 +469,12 @@ opencode web
#### 标志
| 标志 | 描述 |
| ------------ | -------------------------- |
| `--port` | 监听端口 |
| `--hostname` | 监听主机名 |
| `--mdns` | 启用 mDNS 发现 |
| `--cors` | 允许 CORS 的额外浏览器来源 |
| 标志 | 描述 |
| ---------------------------------------- | -------------------------- |
| <nobr><code>{"--port"}</code></nobr> | 监听端口 |
| <nobr><code>{"--hostname"}</code></nobr> | 监听主机名 |
| <nobr><code>{"--mdns"}</code></nobr> | 启用 mDNS 发现 |
| <nobr><code>{"--cors"}</code></nobr> | 允许 CORS 的额外浏览器来源 |
---
@@ -481,11 +490,11 @@ opencode acp
#### 标志
| 标志 | 描述 |
| ------------ | ---------- |
| `--cwd` | 工作目录 |
| `--port` | 监听端口 |
| `--hostname` | 监听主机名 |
| 标志 | 描述 |
| ---------------------------------------- | ---------- |
| <nobr><code>{"--cwd"}</code></nobr> | 工作目录 |
| <nobr><code>{"--port"}</code></nobr> | 监听端口 |
| <nobr><code>{"--hostname"}</code></nobr> | 监听主机名 |
---
@@ -499,12 +508,12 @@ opencode uninstall
#### 标志
| 标志 | 简写 | 描述 |
| --------------- | ---- | ------------------------------ |
| `--keep-config` | `-c` | 保留配置文件 |
| `--keep-data` | `-d` | 保留会话数据和快照 |
| `--dry-run` | | 显示将被删除的内容但不实际删除 |
| `--force` | `-f` | 跳过确认提示 |
| 标志 | 简写 | 描述 |
| ------------------------------------------- | ---- | ------------------------------ |
| <nobr><code>{"--keep-config"}</code></nobr> | `-c` | 保留配置文件 |
| <nobr><code>{"--keep-data"}</code></nobr> | `-d` | 保留会话数据和快照 |
| <nobr><code>{"--dry-run"}</code></nobr> | | 显示将被删除的内容但不实际删除 |
| <nobr><code>{"--force"}</code></nobr> | `-f` | 跳过确认提示 |
---
@@ -530,9 +539,9 @@ opencode upgrade v0.1.48
#### 标志
| 标志 | 简写 | 描述 |
| ---------- | ---- | ------------------------------------------ |
| `--method` | `-m` | 使用的安装方式curl、npm、pnpm、bun、brew |
| 标志 | 简写 | 描述 |
| -------------------------------------- | ---- | ------------------------------------------ |
| <nobr><code>{"--method"}</code></nobr> | `-m` | 使用的安装方式curl、npm、pnpm、bun、brew |
---
@@ -540,12 +549,12 @@ opencode upgrade v0.1.48
OpenCode CLI 接受以下全局标志。
| 标志 | 简写 | 描述 |
| -------------- | ---- | ------------------------------------ |
| `--help` | `-h` | 显示帮助信息 |
| `--version` | `-v` | 打印版本号 |
| `--print-logs` | | 将日志输出到 stderr |
| `--log-level` | | 日志级别DEBUG、INFO、WARN、ERROR |
| 标志 | 简写 | 描述 |
| ------------------------------------------ | ---- | ------------------------------------ |
| <nobr><code>{"--help"}</code></nobr> | `-h` | 显示帮助信息 |
| <nobr><code>{"--version"}</code></nobr> | `-v` | 打印版本号 |
| <nobr><code>{"--print-logs"}</code></nobr> | | 将日志输出到 stderr |
| <nobr><code>{"--log-level"}</code></nobr> | | 日志级别DEBUG、INFO、WARN、ERROR |
---

View File

@@ -29,16 +29,16 @@ opencode [project]
#### 旗標
| 旗標 | 簡寫 | 說明 |
| ------------ | ---- | ------------------------------------------------------------- |
| `--continue` | `-c` | 繼續上一個工作階段 |
| `--session` | `-s` | 要繼續的工作階段 ID |
| `--fork` | | 繼續時分岔工作階段(與 `--continue` 或 `--session` 搭配使用) |
| `--prompt` | | 要使用的提示詞 |
| `--model` | `-m` | 要使用的模型,格式為 provider/model |
| `--agent` | | 要使用的代理 |
| `--port` | | 監聽連接埠 |
| `--hostname` | | 監聽主機名稱 |
| 旗標 | 簡寫 | 說明 |
| ---------------------------------------- | ---- | ------------------------------------------------------------- |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | 繼續上一個工作階段 |
| <nobr><code>{"--session"}</code></nobr> | `-s` | 要繼續的工作階段 ID |
| <nobr><code>{"--fork"}</code></nobr> | | 繼續時分岔工作階段(與 `--continue` 或 `--session` 搭配使用) |
| <nobr><code>{"--prompt"}</code></nobr> | | 要使用的提示詞 |
| <nobr><code>{"--model"}</code></nobr> | `-m` | 要使用的模型,格式為 provider/model |
| <nobr><code>{"--agent"}</code></nobr> | | 要使用的代理 |
| <nobr><code>{"--port"}</code></nobr> | | 監聽連接埠 |
| <nobr><code>{"--hostname"}</code></nobr> | | 監聽主機名稱 |
---
@@ -78,10 +78,14 @@ opencode attach http://10.20.30.40:4096
#### 旗標
| 旗標 | 簡寫 | 說明 |
| ----------- | ---- | ------------------- |
| `--dir` | | 啟動 TUI 的工作目錄 |
| `--session` | `-s` | 繼續工作階段 ID |
| 旗標 | 簡寫 | 說明 |
| ---------------------------------------- | ---- | ----------------------------------------------------------------------- |
| <nobr><code>{"--dir"}</code></nobr> | | 啟動 TUI 的工作目錄 |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | 繼續上一個工作階段 |
| <nobr><code>{"--session"}</code></nobr> | `-s` | 要繼續的工作階段 ID |
| <nobr><code>{"--fork"}</code></nobr> | | 繼續時分支工作階段(與 `--continue` 或 `--session` 一起使用) |
| <nobr><code>{"--password"}</code></nobr> | `-p` | 基本驗證密碼(預設使用 `OPENCODE_SERVER_PASSWORD` |
| <nobr><code>{"--username"}</code></nobr> | `-u` | 基本驗證使用者名稱(預設使用 `OPENCODE_SERVER_USERNAME` 或 `opencode` |
---
@@ -187,10 +191,10 @@ opencode github run
##### 旗標
| 旗標 | 說明 |
| --------- | ------------------------------ |
| `--event` | 用於執行代理的 GitHub 模擬事件 |
| `--token` | GitHub 個人存取權杖 |
| 旗標 | 說明 |
| ------------------------------------- | ------------------------------ |
| <nobr><code>{"--event"}</code></nobr> | 用於執行代理的 GitHub 模擬事件 |
| <nobr><code>{"--token"}</code></nobr> | GitHub 個人存取權杖 |
---
@@ -296,10 +300,10 @@ opencode models anthropic
#### 旗標
| 旗標 | 說明 |
| ----------- | ------------------------------------------ |
| `--refresh` | 從 models.dev 重新整理模型快取 |
| `--verbose` | 使用更詳細的模型輸出(包含費用等中繼資料) |
| 旗標 | 說明 |
| --------------------------------------- | ------------------------------------------ |
| <nobr><code>{"--refresh"}</code></nobr> | 從 models.dev 重新整理模型快取 |
| <nobr><code>{"--verbose"}</code></nobr> | 使用更詳細的模型輸出(包含費用等中繼資料) |
使用 `--refresh` 旗標可以更新快取的模型列表。當供應商新增了模型並且您希望在 OpenCode 中看到它們時,此功能非常有用。
@@ -335,20 +339,25 @@ opencode run --attach http://localhost:4096 "Explain async/await in JavaScript"
#### 旗標
| 旗標 | 簡寫 | 說明 |
| ------------ | ---- | -------------------------------------------------------------- |
| `--command` | | 要執行的指令,使用 message 作為參數 |
| `--continue` | `-c` | 繼續上一個工作階段 |
| `--session` | `-s` | 要繼續的工作階段 ID |
| `--fork` | | 繼續時分岔工作階段(與 `--continue` 或 `--session` 搭配使用) |
| `--share` | | 分享工作階段 |
| `--model` | `-m` | 要使用的模型,格式為 provider/model |
| `--agent` | | 要使用的代理 |
| `--file` | `-f` | 附加到訊息的檔案 |
| `--format` | | 格式default格式化輸出或 json原始 JSON 事件) |
| `--title` | | 工作階段標題(未提供值時使用截斷的提示詞) |
| `--attach` | | 連接到正在執行的 opencode 伺服器(例如 http://localhost:4096 |
| `--port` | | 本地伺服器連接埠(預設為隨機連接埠) |
| 旗標 | 簡寫 | 說明 |
| ---------------------------------------- | ---- | ----------------------------------------------------------------------- |
| <nobr><code>{"--command"}</code></nobr> | | 要執行的指令,使用 message 作為參數 |
| <nobr><code>{"--continue"}</code></nobr> | `-c` | 繼續上一個工作階段 |
| <nobr><code>{"--session"}</code></nobr> | `-s` | 要繼續的工作階段 ID |
| <nobr><code>{"--fork"}</code></nobr> | | 繼續時分岔工作階段(與 `--continue` 或 `--session` 搭配使用) |
| <nobr><code>{"--share"}</code></nobr> | | 分享工作階段 |
| <nobr><code>{"--model"}</code></nobr> | `-m` | 要使用的模型,格式為 provider/model |
| <nobr><code>{"--agent"}</code></nobr> | | 要使用的代理 |
| <nobr><code>{"--file"}</code></nobr> | `-f` | 附加到訊息的檔案 |
| <nobr><code>{"--format"}</code></nobr> | | 格式default格式化輸出或 json原始 JSON 事件) |
| <nobr><code>{"--title"}</code></nobr> | | 工作階段標題(未提供值時使用截斷的提示詞) |
| <nobr><code>{"--attach"}</code></nobr> | | 連接到正在執行的 opencode 伺服器(例如 http://localhost:4096 |
| <nobr><code>{"--password"}</code></nobr> | `-p` | 基本驗證密碼(預設使用 `OPENCODE_SERVER_PASSWORD` |
| <nobr><code>{"--username"}</code></nobr> | `-u` | 基本驗證使用者名稱(預設使用 `OPENCODE_SERVER_USERNAME` 或 `opencode` |
| <nobr><code>{"--dir"}</code></nobr> | | 執行目錄,或附加時遠端伺服器上的路徑 |
| <nobr><code>{"--variant"}</code></nobr> | | 模型變體(特定於提供者的推理級別) |
| <nobr><code>{"--thinking"}</code></nobr> | | 顯示思考區塊 |
| <nobr><code>{"--port"}</code></nobr> | | 本地伺服器連接埠(預設為隨機連接埠) |
---
@@ -364,12 +373,12 @@ opencode serve
#### 旗標
| 旗標 | 說明 |
| ------------ | -------------------------- |
| `--port` | 監聽連接埠 |
| `--hostname` | 監聽主機名稱 |
| `--mdns` | 啟用 mDNS 探索 |
| `--cors` | 允許 CORS 的額外瀏覽器來源 |
| 旗標 | 說明 |
| ---------------------------------------- | -------------------------- |
| <nobr><code>{"--port"}</code></nobr> | 監聽連接埠 |
| <nobr><code>{"--hostname"}</code></nobr> | 監聽主機名稱 |
| <nobr><code>{"--mdns"}</code></nobr> | 啟用 mDNS 探索 |
| <nobr><code>{"--cors"}</code></nobr> | 允許 CORS 的額外瀏覽器來源 |
---
@@ -393,10 +402,10 @@ opencode session list
##### 旗標
| 旗標 | 簡寫 | 說明 |
| ------------- | ---- | ------------------------------------- |
| `--max-count` | `-n` | 限制為最近 N 個工作階段 |
| `--format` | | 輸出格式table 或 json預設 table |
| 旗標 | 簡寫 | 說明 |
| ----------------------------------------- | ---- | ------------------------------------- |
| <nobr><code>{"--max-count"}</code></nobr> | `-n` | 限制為最近 N 個工作階段 |
| <nobr><code>{"--format"}</code></nobr> | | 輸出格式table 或 json預設 table |
---
@@ -410,12 +419,12 @@ opencode stats
#### 旗標
| 旗標 | 說明 |
| ----------- | ---------------------------------------------------- |
| `--days` | 顯示最近 N 天的統計資訊(預設為所有時間) |
| `--tools` | 顯示的工具數量(預設為全部) |
| `--models` | 顯示模型用量明細(預設隱藏)。傳入數字可顯示前 N 個 |
| `--project` | 按專案篩選(預設為所有專案,傳入空字串表示當前專案) |
| 旗標 | 說明 |
| --------------------------------------- | ---------------------------------------------------- |
| <nobr><code>{"--days"}</code></nobr> | 顯示最近 N 天的統計資訊(預設為所有時間) |
| <nobr><code>{"--tools"}</code></nobr> | 顯示的工具數量(預設為全部) |
| <nobr><code>{"--models"}</code></nobr> | 顯示模型用量明細(預設隱藏)。傳入數字可顯示前 N 個 |
| <nobr><code>{"--project"}</code></nobr> | 按專案篩選(預設為所有專案,傳入空字串表示當前專案) |
---
@@ -460,12 +469,12 @@ opencode web
#### 旗標
| 旗標 | 說明 |
| ------------ | -------------------------- |
| `--port` | 監聽連接埠 |
| `--hostname` | 監聽主機名稱 |
| `--mdns` | 啟用 mDNS 探索 |
| `--cors` | 允許 CORS 的額外瀏覽器來源 |
| 旗標 | 說明 |
| ---------------------------------------- | -------------------------- |
| <nobr><code>{"--port"}</code></nobr> | 監聽連接埠 |
| <nobr><code>{"--hostname"}</code></nobr> | 監聽主機名稱 |
| <nobr><code>{"--mdns"}</code></nobr> | 啟用 mDNS 探索 |
| <nobr><code>{"--cors"}</code></nobr> | 允許 CORS 的額外瀏覽器來源 |
---
@@ -481,11 +490,11 @@ opencode acp
#### 旗標
| 旗標 | 說明 |
| ------------ | ------------ |
| `--cwd` | 工作目錄 |
| `--port` | 監聽連接埠 |
| `--hostname` | 監聽主機名稱 |
| 旗標 | 說明 |
| ---------------------------------------- | ------------ |
| <nobr><code>{"--cwd"}</code></nobr> | 工作目錄 |
| <nobr><code>{"--port"}</code></nobr> | 監聽連接埠 |
| <nobr><code>{"--hostname"}</code></nobr> | 監聽主機名稱 |
---
@@ -499,12 +508,12 @@ opencode uninstall
#### 旗標
| 旗標 | 簡寫 | 說明 |
| --------------- | ---- | ------------------------------ |
| `--keep-config` | `-c` | 保留設定檔 |
| `--keep-data` | `-d` | 保留工作階段資料和快照 |
| `--dry-run` | | 顯示將被刪除的內容但不實際刪除 |
| `--force` | `-f` | 跳過確認提示 |
| 旗標 | 簡寫 | 說明 |
| ------------------------------------------- | ---- | ------------------------------ |
| <nobr><code>{"--keep-config"}</code></nobr> | `-c` | 保留設定檔 |
| <nobr><code>{"--keep-data"}</code></nobr> | `-d` | 保留工作階段資料和快照 |
| <nobr><code>{"--dry-run"}</code></nobr> | | 顯示將被刪除的內容但不實際刪除 |
| <nobr><code>{"--force"}</code></nobr> | `-f` | 跳過確認提示 |
---
@@ -530,9 +539,9 @@ opencode upgrade v0.1.48
#### 旗標
| 旗標 | 簡寫 | 說明 |
| ---------- | ---- | ------------------------------------------ |
| `--method` | `-m` | 使用的安裝方式curl、npm、pnpm、bun、brew |
| 旗標 | 簡寫 | 說明 |
| -------------------------------------- | ---- | ------------------------------------------ |
| <nobr><code>{"--method"}</code></nobr> | `-m` | 使用的安裝方式curl、npm、pnpm、bun、brew |
---
@@ -540,12 +549,12 @@ opencode upgrade v0.1.48
OpenCode CLI 接受以下全域旗標。
| 旗標 | 簡寫 | 說明 |
| -------------- | ---- | ------------------------------------ |
| `--help` | `-h` | 顯示說明資訊 |
| `--version` | `-v` | 印出版本號 |
| `--print-logs` | | 將日誌輸出到 stderr |
| `--log-level` | | 日誌等級DEBUG、INFO、WARN、ERROR |
| 旗標 | 簡寫 | 說明 |
| ------------------------------------------ | ---- | ------------------------------------ |
| <nobr><code>{"--help"}</code></nobr> | `-h` | 顯示說明資訊 |
| <nobr><code>{"--version"}</code></nobr> | `-v` | 印出版本號 |
| <nobr><code>{"--print-logs"}</code></nobr> | | 將日誌輸出到 stderr |
| <nobr><code>{"--log-level"}</code></nobr> | | 日誌等級DEBUG、INFO、WARN、ERROR |
---

View File

@@ -2,7 +2,7 @@
"name": "opencode",
"displayName": "opencode",
"description": "opencode for VS Code",
"version": "1.14.31",
"version": "1.14.33",
"publisher": "sst-dev",
"repository": {
"type": "git",