Seed CLISeed CLI

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/cli

Or use without installing:

bunx @seedcli/cli <command>

Commands

seed new <name>

Scaffold a new CLI project:

seed new my-cli

Interactive prompts guide you through:

  1. Template — Full (recommended), Minimal, or Plugin
  2. Description — Package description

Flags:

FlagDescription
--skip-install, -sSkip dependency installation
--skip-gitSkip git initialization
--skip-prompts, -ySkip 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.json

seed generate <type> <name>

Generate commands, extensions, or plugins. Alias: seed g.

seed generate command <name>

seed generate command deploy
seed g command deploy

Creates src/commands/deploy.ts:

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 auth

Creates src/extensions/auth.ts:

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-plugin

Creates 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.json

seed dev

Start development mode with hot reload:

seed dev

Spawns bun --watch on your entry point. Entry is resolved from:

  1. seed.config.tsdev.entry
  2. package.jsonbin field
  3. Common defaults: src/index.ts, src/cli.ts, index.ts

Flags:

FlagDescription
--entryOverride 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 --sourcemap

Flags:

FlagDescription
--compileCompile to standalone binary (requires Bun ≥1.3.9)
--outfile, -oOutput file path
--outdirOutput directory (default: dist)
--targetCompile targets (comma-separated)
--minifyMinify output
--sourcemapGenerate sourcemaps
--bytecodeBytecode compilation for faster startup
--splittingEnable code splitting
--analyzeShow bundle size analysis

Available compile targets:

PlatformTargets
macOSbun-darwin-arm64, bun-darwin-x64, bun-darwin-x64-baseline
Linuxbun-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
Windowsbun-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:

seed.config.ts
import { defineConfig } from "@seedcli/core"

export default defineConfig({
  dev: {
    entry: "src/index.ts",
  },
  build: {
    entry: "src/index.ts",
    outDir: "dist",
    minify: true,
  },
})

Global Flags

FlagDescription
--help, -hShow help
--version, -VShow version

The seed CLI is itself built with the Seed CLI framework — a real-world example of the framework in action.

On this page