Moves effect logging, observability, runtime utilities, flags, installation version info, and process utilities from opencode to core package. This enables better code sharing across packages and establishes core as the single source of truth for foundational utilities. All internal imports updated to use @opencode-ai/core paths for consistency.
34 lines
877 B
TypeScript
34 lines
877 B
TypeScript
import yargs from "yargs"
|
|
import { TuiThreadCommand } from "./cli/cmd/tui/thread"
|
|
import { InstallationVersion } from "@opencode-ai/core/installation/version"
|
|
import { hideBin } from "yargs/helpers"
|
|
import { Log } from "./node"
|
|
|
|
Log.init({
|
|
print: false,
|
|
})
|
|
|
|
const cli = yargs(hideBin(process.argv))
|
|
.parserConfiguration({ "populate--": true })
|
|
.scriptName("opencode")
|
|
.wrap(100)
|
|
.help("help", "show help")
|
|
.alias("help", "h")
|
|
.version("version", "show version number", InstallationVersion)
|
|
.alias("version", "v")
|
|
.option("print-logs", {
|
|
describe: "print logs to stderr",
|
|
type: "boolean",
|
|
})
|
|
.option("log-level", {
|
|
describe: "log level",
|
|
type: "string",
|
|
choices: ["DEBUG", "INFO", "WARN", "ERROR"],
|
|
})
|
|
.option("pure", {
|
|
describe: "run without external plugins",
|
|
type: "boolean",
|
|
})
|
|
.command(TuiThreadCommand)
|
|
.parse()
|