@fnd-platform/cli
v1.0.0-alpha.39
Published
CLI tool for fnd-platform monorepo scaffolding
Maintainers
Readme
@fnd-platform/cli
Command-line interface for fnd-platform projects.
Installation
# Global installation (recommended)
pnpm add -g @fnd-platform/cli
# Or use npx
npx @fnd-platform/cli <command>Commands
fnd new <name>
Create a new fnd-platform monorepo project.
fnd new my-appArguments:
| Argument | Description |
| -------- | ---------------------------------------------------------------------------- |
| name | Project name (lowercase alphanumeric with hyphens, must start with a letter) |
Options:
| Option | Default | Description |
| ------------------------ | ------- | ----------------------------------------- |
| --package-manager <pm> | pnpm | Package manager to use (pnpm or yarn) |
| --no-git | - | Skip git repository initialization |
| --no-install | - | Skip dependency installation |
Examples:
# Create a new project with defaults
fnd new my-saas-app
# Create without installing dependencies
fnd new my-app --no-install
# Create with yarn instead of pnpm
fnd new my-app --package-manager yarn
# Create without git initialization
fnd new my-app --no-gitfnd synth
Synthesize project configuration using Projen. Run this after modifying .projenrc.ts to regenerate configuration files.
fnd synthOptions:
| Option | Description |
| --------- | --------------------------------------------------------- |
| --watch | Watch for changes and re-synthesize (not yet implemented) |
fnd build
Build all packages using NX.
fnd buildOptions:
| Option | Description |
| ------------------ | ----------------------------- |
| --skip-cache | Skip NX cache (force rebuild) |
| --parallel <n> | Number of parallel tasks |
| --package <name> | Build specific package only |
Examples:
# Build all packages
fnd build
# Build without cache
fnd build --skip-cache
# Build with limited parallelism
fnd build --parallel 2
# Build specific package
fnd build --package apifnd add <type>
Add a package to an existing project. Modifies .projenrc.ts with the new package configuration.
Subcommands:
fnd add api
Add a Lambda API package.
fnd add api --name=api| Option | Default | Description |
| ----------------- | ----------------- | -------------------------------- |
| --name <name> | required | Package name |
| --outdir <path> | packages/<name> | Output directory |
| --no-dynamodb | - | Disable DynamoDB integration |
| --no-cognito | - | Disable Cognito auth integration |
fnd add frontend
Add a Remix frontend package (requires API package).
fnd add frontend --name=frontend --api=api| Option | Default | Description |
| ----------------- | ----------------- | ---------------------------------- |
| --name <name> | required | Package name |
| --api <api> | required | API package name to link |
| --outdir <path> | packages/<name> | Output directory |
| --no-auth | - | Disable authentication integration |
| --port <port> | 3000 | Development server port |
| --theme <theme> | zinc | shadcn/ui theme color |
fnd add cms
Add a CMS admin package (requires API package).
fnd add cms --name=cms --api=api| Option | Default | Description |
| ----------------------------- | ----------------- | ---------------------------------- |
| --name <name> | required | Package name |
| --api <api> | required | API package name to link |
| --outdir <path> | packages/<name> | Output directory |
| --port <port> | 3001 | Development server port |
| --no-media-upload | - | Disable media upload features |
| --rich-text-editor <editor> | tiptap | Rich text editor (tiptap|lexical) |
| --theme <theme> | zinc | shadcn/ui theme color |
fnd add component-library
Add a component library package with Storybook.
fnd add component-library --name=ui| Option | Default | Description |
| ----------------- | ----------------- | ------------------------- |
| --name <name> | required | Package name |
| --outdir <path> | packages/<name> | Output directory |
| --port <port> | 6006 | Storybook dev server port |
Quick Start
# Create a new project
fnd new my-saas-app
# Navigate to project
cd my-saas-app
# Modify .projenrc.ts if needed, then regenerate
fnd synth
# Build all packages
fnd build
# Add packages to an existing project
fnd add api --name=api
fnd add frontend --name=frontend --api=api
fnd add cms --name=cms --api=api
# Deploy (coming in Phase 8)
# fnd deploy --stage=devProject Name Requirements
Project names must:
- Start with a lowercase letter
- Contain only lowercase letters, numbers, and hyphens
- Match pattern:
/^[a-z][a-z0-9-]*$/
Valid examples: my-app, saas-platform, app123
Invalid examples: MyApp, 123-app, my_app
Requirements
- Node.js 20+
- pnpm 8+ (or yarn)
- Git (optional, for repository initialization)
API Reference
See the full API documentation for detailed type definitions and examples.
Related
- @fnd-platform/core - Core Projen project classes
- CLI Commands Reference - Detailed command documentation
License
MIT
