The seed CLI
The seed command-line tool for managing Seed CLI projects.
The seed CLI (@seedcli/cli) is the companion tool for managing Seed CLI projects. It scaffolds new projects, generates commands and extensions, and provides development and build utilities.
Installation
bun add -g @seedcli/cliOr use without installing:
bunx @seedcli/cli <command>Commands
seed new <name>
Scaffold a new CLI project:
seed new my-cliInteractive prompts guide you through:
- Template — Full (recommended), Minimal, or Plugin
- Description — Package description
Flags:
| Flag | Description |
|---|---|
--skip-install, -s | Skip dependency installation |
--skip-git | Skip git initialization |
--skip-prompts, -y | Skip prompts, use defaults |
The generated project structure (Full template):
my-cli/
├── src/
│ ├── commands/
│ │ └── hello.ts
│ ├── extensions/
│ │ └── timer.ts
│ └── index.ts
├── tests/
│ └── hello.test.ts
├── biome.json
├── bunfig.toml
├── package.json
├── seed.config.ts
└── tsconfig.jsonseed generate <type> <name>
Generate commands, extensions, or plugins. Alias: seed g.
seed generate command <name>
seed generate command deploy
seed g command deployCreates src/commands/deploy.ts:
import { command } from "@seedcli/core"
export default command({
name: "deploy",
description: "TODO: Add description",
run: async (seed) => {
// TODO: Implement
},
})seed generate extension <name>
seed generate extension auth
seed g extension authCreates src/extensions/auth.ts:
import { defineExtension } from "@seedcli/core"
export default defineExtension({
name: "auth",
description: "TODO: Add description",
setup: async (seed) => {
// TODO: Implement setup
},
teardown: () => {
// Clean up resources if needed
},
})seed generate plugin <name>
seed generate plugin my-plugin
seed g plugin my-pluginCreates an entire plugin directory with definePlugin() export, example commands and extensions, type declarations, tests, and build config for npm publishing:
my-plugin/
├── src/
│ ├── commands/
│ ├── extensions/
│ ├── templates/
│ ├── types.d.ts
│ └── index.ts
├── tests/
├── biome.json
├── bunfig.toml
├── package.json
├── tsconfig.json
└── tsconfig.build.jsonseed dev
Start development mode with hot reload:
seed devSpawns bun --watch on your entry point. Entry is resolved from:
seed.config.ts→dev.entrypackage.json→binfield- Common defaults:
src/index.ts,src/cli.ts,index.ts
Flags:
| Flag | Description |
|---|---|
--entry | Override entry point path |
seed build
Bundle or compile your CLI for distribution:
# Bundle to dist/
seed build
# Compile to standalone binary
seed build --compile
# Compile for specific targets
seed build --compile --target bun-darwin-arm64,bun-linux-x64
# With options
seed build --outdir dist --minify --sourcemapFlags:
| Flag | Description |
|---|---|
--compile | Compile to standalone binary (requires Bun ≥1.3.9) |
--outfile, -o | Output file path |
--outdir | Output directory (default: dist) |
--target | Compile targets (comma-separated) |
--minify | Minify output |
--sourcemap | Generate sourcemaps |
--bytecode | Bytecode compilation for faster startup |
--splitting | Enable code splitting |
--analyze | Show bundle size analysis |
Available compile targets:
| Platform | Targets |
|---|---|
| macOS | bun-darwin-arm64, bun-darwin-x64, bun-darwin-x64-baseline |
| Linux | bun-linux-x64, bun-linux-arm64, bun-linux-x64-baseline, bun-linux-x64-modern, bun-linux-x64-musl, bun-linux-x64-musl-baseline, bun-linux-arm64-musl |
| Windows | bun-windows-x64, bun-windows-arm64, bun-windows-x64-baseline, bun-windows-x64-modern |
The build command automatically converts dynamic .src() discovery into static imports so the bundler/compiler can trace all dependencies.
Configuration
All seed commands read from seed.config.ts when present:
import { defineConfig } from "@seedcli/core"
export default defineConfig({
dev: {
entry: "src/index.ts",
},
build: {
entry: "src/index.ts",
outDir: "dist",
minify: true,
},
})Global Flags
| Flag | Description |
|---|---|
--help, -h | Show help |
--version, -V | Show version |
The seed CLI is itself built with the Seed CLI framework — a real-world example of the framework in action.