mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-10 02:08:31 +00:00
feat(cli): add effect cli scaffold
This commit is contained in:
parent
1ceb5dbd56
commit
181e58f50a
4 changed files with 67 additions and 3 deletions
24
packages/cli/package.json
Normal file
24
packages/cli/package.json
Normal 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
15
packages/cli/src/index.ts
Executable 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,
|
||||
)
|
||||
7
packages/cli/tsconfig.json
Normal file
7
packages/cli/tsconfig.json
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "@tsconfig/bun/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"noUncheckedIndexedAccess": false
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue