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/cliOr 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-cliInteractive prompts guide you through:
- Template — Full (recommended), Minimal, or Plugin
- Description — Package description
- Package manager — npm, pnpm, yarn, or bun
Flags:
| Flag | Description |
|---|---|
--skipInstall, -s | Skip dependency installation |
--skipGit | Skip git initialization |
--skipPrompts, -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
├── .gitignore
├── biome.json
├── 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: describe the deploy command",
run: async ({ print }) => {
print.info("Running deploy command");
},
});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: 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-pluginCreates 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.jsonseed dev
Start development mode with hot reload:
seed devRuns 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 tofoo.tswhen only the TS source existsimport "./foo"(no extension) resolves tofoo.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:
seed.config.ts→dev.entrypackage.json→binfield- 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 --dryRunThe entry script's process.argv will receive ["setup", "--from", "/tmp", "--dryRun"].
Flags:
| Flag | Description |
|---|---|
--entry | Override 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 fornpm publish. Typically tens of KB. The bundle runs directly vianode dist/index.js(or as abinentry) 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 --sourcemapIn 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:
| Flag | Description |
|---|---|
--compile | Compile 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) |
--minify | Minify output |
--sourcemap | Generate sourcemaps |
--external <modules> | Keep module(s) external (comma-separated). Works in both modes. |
--splitting | Parsed by the CLI but currently has no effect |
--analyze | Show bundle size analysis |
Available compile targets:
| Platform | Targets |
|---|---|
| macOS | node24-macos-arm64, node24-macos-x64 |
| Linux | node24-linux-x64, node24-linux-arm64, node24-linuxstatic-x64 |
| Windows | node24-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:
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
| 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.