mirror of
https://github.com/linsa-io/linsa.git
synced 2026-01-12 12:20:23 +01:00
.
This commit is contained in:
BIN
cli/bun.lockb
BIN
cli/bun.lockb
Binary file not shown.
13
cli/main.ts
13
cli/main.ts
@@ -1,15 +1,12 @@
|
|||||||
import { Command } from "@effect/cli"
|
import { Command } from "@effect/cli"
|
||||||
import { NodeContext, NodeRuntime } from "@effect/platform-node"
|
import { BunContext } from "@effect/platform-bun"
|
||||||
import { Console, Effect } from "effect"
|
import { Console, Effect } from "effect"
|
||||||
|
|
||||||
// Define the top-level command
|
const command = Command.make("test", {}, () => Console.log("test"))
|
||||||
const command = Command.make("hello-world", {}, () => Console.log("Hello World"))
|
|
||||||
|
|
||||||
// Set up the CLI application
|
|
||||||
const cli = Command.run(command, {
|
const cli = Command.run(command, {
|
||||||
name: "Hello World CLI",
|
name: "learn-anything.xyz CLI",
|
||||||
version: "v1.0.0"
|
version: "v0.0.1"
|
||||||
})
|
})
|
||||||
|
|
||||||
// Prepare and run the CLI application
|
Effect.runPromise(cli(process.argv).pipe(Effect.provide(BunContext.layer)))
|
||||||
cli(process.argv).pipe(Effect.provide(NodeContext.layer), NodeRuntime.runMain)
|
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "cli",
|
"name": "cli",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "bun --watch main.ts"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@effect/cli": "^0.44.5",
|
"@effect/cli": "^0.44.5",
|
||||||
|
"@effect/platform-bun": "^0.45.5",
|
||||||
"@effect/platform-node": "^0.60.5"
|
"@effect/platform-node": "^0.60.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user