This commit is contained in:
Nikita
2024-09-22 14:45:11 +03:00
parent dd04264bae
commit 0373cfc9c3
3 changed files with 9 additions and 8 deletions

View File

@@ -1,15 +1,12 @@
import { Command } from "@effect/cli"
import { NodeContext, NodeRuntime } from "@effect/platform-node"
import { BunContext } from "@effect/platform-bun"
import { Console, Effect } from "effect"
// Define the top-level command
const command = Command.make("hello-world", {}, () => Console.log("Hello World"))
const command = Command.make("test", {}, () => Console.log("test"))
// Set up the CLI application
const cli = Command.run(command, {
name: "Hello World CLI",
version: "v1.0.0"
name: "learn-anything.xyz CLI",
version: "v0.0.1"
})
// Prepare and run the CLI application
cli(process.argv).pipe(Effect.provide(NodeContext.layer), NodeRuntime.runMain)
Effect.runPromise(cli(process.argv).pipe(Effect.provide(BunContext.layer)))