hono icon indicating copy to clipboard operation
hono copied to clipboard

Hono CLI framework

Open pomdtr opened this issue 1 year ago • 1 comments

What is the feature you are proposing?

I think hono primitives would work wonderfully for a minimal CLI framework:

import { Cli } from "hono/cli"

const cli = new Cli({
  name: "git"
})

// this should also leverage the validator api for flags parsing
cli.command("commit", (c) => {
   const { message } = c.cmd.flag()
   
   // ...
})

cli.command("checkout [branch]", (c) => {
   const branch = c.cmd.arg("branch")
   
   // ...
})

if (import.meta.main) {
   await cli.run()
}

I think there is a space for this, as current cli frameworks for typescript are quite lacklusters (imo)

pomdtr avatar Oct 19 '24 16:10 pomdtr

I think you should create your framework similar to Hono's API since it is out of the scope of the web standard server-side framework.

Of course, I think it's an interesting idea!

EdamAme-x avatar Oct 20 '24 13:10 EdamAme-x

Hi @pomdtr

As @EdamAme-x said, this is out of the scope of Hono.

yusukebe avatar Oct 28 '24 00:10 yusukebe

Closing.

yusukebe avatar Oct 28 '24 00:10 yusukebe