Update CLI description, help/version options, and add version command
This commit is contained in:
parent
89eb5e382b
commit
10ebfcf754
25
src/cli.ts
25
src/cli.ts
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env bun
|
||||
|
||||
import { Command } from "commander"
|
||||
import { Command, Option } from "commander"
|
||||
import { yellow, reset } from "./fmt.ts"
|
||||
import * as git from "./git.ts"
|
||||
import * as state from "./state.ts"
|
||||
import { action as newAction } from "./commands/new.ts"
|
||||
|
|
@ -25,7 +26,18 @@ const pkg = await Bun.file(new URL("../package.json", import.meta.url)).json()
|
|||
|
||||
const program = new Command()
|
||||
|
||||
program.name("sandlot").description("Branch-based development with git worktrees and Apple Container").version(pkg.version)
|
||||
program
|
||||
.name("sandlot")
|
||||
.description("Sandboxed development with Claude.")
|
||||
.configureHelp({ styleTitle: (str) => `${yellow}${str}${reset}` })
|
||||
.helpOption(false)
|
||||
.addOption(new Option("-h, --help").hideHelp())
|
||||
.on("option:help", () => program.help())
|
||||
.addOption(new Option("-V, --version").hideHelp())
|
||||
.on("option:version", () => {
|
||||
console.log(pkg.version)
|
||||
process.exit(0)
|
||||
})
|
||||
|
||||
// ── Sessions ────────────────────────────────────────────────────────
|
||||
|
||||
|
|
@ -50,7 +62,7 @@ program
|
|||
.argument("[prompt]", "initial prompt for Claude")
|
||||
.option("-p, --print <prompt>", "run Claude in non-interactive mode with -p")
|
||||
.option("-n, --no-save", "skip auto-save after Claude exits")
|
||||
.description("Re-enter an existing session")
|
||||
.description("Open an existing Claude session")
|
||||
.action(openAction)
|
||||
|
||||
program
|
||||
|
|
@ -144,6 +156,13 @@ program
|
|||
|
||||
registerVmCommands(program)
|
||||
|
||||
program
|
||||
.command("version")
|
||||
.description("Print the version number")
|
||||
.action(() => {
|
||||
console.log(pkg.version)
|
||||
})
|
||||
|
||||
program
|
||||
.command("completions")
|
||||
.option("--install", "Output a shell script that installs the completions file")
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user