feat(cli): add effect cli scaffold

This commit is contained in:
Dax Raad 2026-05-29 23:12:12 -04:00
parent 1ceb5dbd56
commit 181e58f50a
4 changed files with 67 additions and 3 deletions

24
packages/cli/package.json Normal file
View file

@ -0,0 +1,24 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@opencode-ai/cli",
"version": "1.15.12",
"private": true,
"type": "module",
"license": "MIT",
"bin": {
"opencode": "./src/index.ts"
},
"scripts": {
"dev": "bun run src/index.ts",
"typecheck": "tsgo --noEmit"
},
"dependencies": {
"@effect/platform-node": "catalog:",
"effect": "catalog:"
},
"devDependencies": {
"@tsconfig/bun": "catalog:",
"@types/bun": "catalog:",
"@typescript/native-preview": "catalog:"
}
}

15
packages/cli/src/index.ts Executable file
View file

@ -0,0 +1,15 @@
#!/usr/bin/env bun
import * as NodeRuntime from "@effect/platform-node/NodeRuntime"
import * as NodeServices from "@effect/platform-node/NodeServices"
import * as Effect from "effect/Effect"
import * as Command from "effect/unstable/cli/Command"
const cli = Command.make("opencode", {}, () => Effect.void).pipe(
Command.withDescription("OpenCode command line interface"),
)
Command.run(cli, { version: "local" }).pipe(
Effect.provide(NodeServices.layer),
NodeRuntime.runMain,
)

View file

@ -0,0 +1,7 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@tsconfig/bun/tsconfig.json",
"compilerOptions": {
"noUncheckedIndexedAccess": false
}
}