Agent-Native CLI Template Creation Modes: Interactive, Non-Interactive, and Template-Specific

The Agent-Native CLI provides three distinct template creation modes—interactive prompting, non-interactive defaults with --yes, and template-specific generation via --template <name>—to scaffold new projects from the packages/cli/src/commands/create.ts entry point.

The BuilderIO/agent-native repository offers a command-line interface for generating AI-native application scaffolds. Understanding the available Agent-Native CLI template creation modes allows developers to choose between guided setup, automated defaults, or targeted template instantiation depending on their workflow requirements.

Interactive Mode

Interactive mode launches a guided prompt sequence when you run the create command without additional flags. This is the default behavior implemented in packages/cli/src/commands/create.ts.

npx @agent-native/cli create

The CLI uses commander to parse arguments and then presents a list of available templates. Users navigate through options including videos, slides, mail, forms, analytics, plan, or macros, select their preferred scaffold, and confirm the target directory. The scaffold logic then copies files from the corresponding templates/<name>/ directory, rewrites placeholders such as {{projectName}}, and executes pnpm install to bootstrap dependencies.

Non-Interactive Mode

Non-interactive mode skips all prompts by passing the --yes flag (also aliased as --no-interactive), making it ideal for CI/CD pipelines and automation scripts.

npx @agent-native/cli create --yes

When this flag is present, the command handler in packages/cli/src/commands/create.ts bypasses the prompt engine and selects the "blank" composition template with predefined default values. This ensures consistent, deterministic project generation without requiring user input or TTY availability.

Template-Specific Mode

Template-specific mode allows immediate targeting of a particular scaffold without navigating the interactive menu, using the --template flag combined with any valid template name from the repository.

npx @agent-native/cli create --template slides

The CLI resolves the template identifier against the templates/ directory structure and delegates to the specific scaffold logic exported from templates/<template-name>/index.ts. You can combine this with non-interactive flags to create a specific template without prompts:

npx @agent-native/cli create --template analytics --yes ./my-analytics-app

This command generates an analytics-based project inside ./my-analytics-app by copying the template files, replacing placeholders, and running the installation step automatically.

Source Implementation Details

The three creation modes are implemented across specific files in the BuilderIO/agent-native monorepo:

  • packages/cli/src/commands/create.ts: Contains the command definition, flag parsing logic for --yes and --template, and the orchestration flow that selects between interactive and non-interactive paths.
  • templates/*/index.ts: Entry points for each template (e.g., templates/slides/index.ts) that define file copying operations and placeholder transformation rules.
  • packages/cli/package.json: Defines the binary entry point that exposes @agent-native/cli to npx and lists runtime dependencies including commander for argument parsing.

Summary

  • Interactive mode (npx @agent-native/cli create) provides a guided setup experience through prompts defined in the create command handler.
  • Non-interactive mode (--yes) generates a blank composition with defaults, eliminating prompts for automated environments.
  • Template-specific mode (--template <name>) targets specific scaffolds from the templates/ directory and can be combined with --yes for fully automated, targeted project creation.
  • All modes finalize the project by copying template assets, rewriting placeholders like {{projectName}}, and executing pnpm install as implemented in packages/cli/src/commands/create.ts.

Frequently Asked Questions

What is the default template when using --yes or non-interactive mode?

When the --yes flag is passed, the CLI defaults to the "blank" composition template. This behavior is defined in the argument parsing logic within packages/cli/src/commands/create.ts, ensuring consistent output in automated pipelines without requiring user selection.

Can I combine the --template and --yes flags?

Yes, these flags are designed to work together. Executing npx @agent-native/cli create --template <name> --yes generates a project based on the specified template while skipping all interactive prompts. The CLI resolves the template path from templates/<name>/ and applies the same default configuration used in standalone non-interactive mode.

Where are the template scaffolds defined in the source code?

Each template's scaffold logic resides in its respective templates/<template-name>/ directory, with entry points exported from files like templates/<template-name>/index.ts. The create command in packages/cli/src/commands/create.ts consumes these exports to execute file copying and placeholder replacement operations.

What package manager does the CLI use after scaffolding?

The CLI automatically runs pnpm install after copying template files and rewriting placeholders. This finalization step occurs across all three creation modes and is triggered by the scaffold orchestration logic within packages/cli/src/commands/create.ts.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →