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

Requires Node.js 24.0.0 or newer.

npm install -g @seedcli/cli

Or use without installing:

npx @seedcli/cli <command>

In scaffolded Full and Minimal projects, @seedcli/cli is included as a devDependency, so the package scripts can call seed without a global install. The Plugin template does not include @seedcli/cli.

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
  3. Package manager — npm, pnpm, yarn, or bun

Flags:

FlagDescription
--skipInstall, -sSkip dependency installation
--skipGitSkip git initialization
--skipPrompts, -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
├── .gitignore
├── biome.json
├── 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: describe the deploy command",
  run: async ({ print }) => {
    print.info("Running deploy command");
  },
});

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: describe the auth extension",
  setup: async (seed) => {
    // Extend the seed context with your custom functionality
  },
});

seed generate plugin <name>

seed generate plugin my-plugin
seed g plugin my-plugin

Creates a root plugin skeleton plus a nested plugin/ example package:

my-plugin/
├── README.md
├── package.json
├── src/
│   ├── commands/
│   ├── extensions/
│   └── index.ts
├── templates/
└── plugin/
    ├── biome.json
    ├── gitignore
    ├── package.json
    ├── src/
    │   ├── commands/
    │   │   └── hello.ts
    │   ├── extensions/
    │   │   └── example.ts
    │   ├── index.ts
    │   └── types.d.ts
    ├── tests/
    │   └── plugin.test.ts
    ├── tsconfig.build.json
    └── tsconfig.json

seed dev

Start development mode with hot reload:

seed dev

Runs your entry point with node --watch for instant feedback. For TypeScript entries (.ts, .tsx, .mts, .cts), seed dev also loads the tsx ESM loader (node --watch --import tsx ...) so you can use the standard TypeScript ESM conventions:

  • import "./foo.js" resolves to foo.ts when only the TS source exists
  • import "./foo" (no extension) resolves to foo.ts, foo.tsx, etc.

tsx is included as a dev dependency in scaffolded Full and Minimal projects. For plain .js/.mjs entries the loader is skipped.

Entry is resolved from:

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

Forwarding args to your entry script

Anything after a literal -- is forwarded as process.argv to the spawned entry script, and is preserved across hot reloads:

seed dev -- setup --from /tmp --dryRun

The entry script's process.argv will receive ["setup", "--from", "/tmp", "--dryRun"].

Flags:

FlagDescription
--entryOverride entry point path
-- <args...>Forward everything after -- to your entry script's process.argv

seed build

Bundle or compile your CLI for distribution. seed build has two modes:

  • Bundle mode (default) — produces a plain JavaScript ES module at dist/index.js, suitable for npm publish. Typically tens of KB. The bundle runs directly via node dist/index.js (or as a bin entry) on Node.js 24+.
  • Compile mode (--compile) — produces a standalone executable via Hakobu with an embedded Node runtime. Tens of MB. Use this when shipping binaries via GitHub Releases.
# Bundle to dist/index.js (real JS, not a binary)
seed build

# Compile to standalone binary
seed build --compile

# Compile for specific targets
seed build --compile --target node24-macos-arm64,node24-linux-x64

# Compile for all supported platforms
seed build --compile --target all

# With options
seed build --outdir dist --minify --sourcemap

In bundle mode, dependencies, peerDependencies, and optionalDependencies from your package.json are kept as runtime imports so the published tarball stays small and uses npm's normal install graph. Workspace packages and devDependencies are inlined. You can add more externals via build.external in seed.config.ts or --external on the CLI. The bundle is chmod +x'd and gets a #!/usr/bin/env node shebang (unless your entry source already has one), so it works directly as a bin entry.

Flags:

FlagDescription
--compileCompile to standalone binary via Hakobu (otherwise produce a JS bundle)
--outfile <path>, -o <path>Explicit output file path (single-target only)
--outdir <dir>Output directory (default: dist)
--target <targets>Compile target(s), comma-separated, or all (used with --compile)
--minifyMinify output
--sourcemapGenerate sourcemaps
--external <modules>Keep module(s) external (comma-separated). Works in both modes.
--splittingParsed by the CLI but currently has no effect
--analyzeShow bundle size analysis

Available compile targets:

PlatformTargets
macOSnode24-macos-arm64, node24-macos-x64
Linuxnode24-linux-x64, node24-linux-arm64, node24-linuxstatic-x64
Windowsnode24-win-x64, node24-win-arm64

Use --target all to compile for every supported platform at once.

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",
    bundle: {
      outdir: "dist",
      minify: true,
    },
    compile: {
      targets: ["node24-macos-arm64", "node24-linux-x64", "node24-win-x64"],
    },
  },
})

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