Files
bolt.diy/cli
google-labs-jules[bot] fa83eeb624 feat: Implement initial Bolt CLI tool with generators
This commit introduces the foundational Bolt Command Line Interface (CLI) tool, inspired by tools like Laravel's Artisan and Symfony's Console. The primary goal of this CLI is to enhance your developer experience by automating common boilerplate generation tasks.

Key features in this initial version:

1.  **CLI Core Structure:**
    -   A new `cli/` directory houses the CLI source code (`bolt-cli.ts`) and tests (`cli/tests/cli.test.ts`).
    -   Dependencies `commander` (for command parsing) and `fs-extra` (for file system operations) have been added.
    -   TypeScript configuration (`tsconfig.cli.json`, `tsconfig.cli.test.json`) is set up for `ts-node` execution in an ESM project context.
    -   A `pnpm run bolt` script is added to `package.json` to invoke the CLI.

2.  **`make:controller` Command:**
    -   Generates a new controller class file in `app/controllers/`.
    -   Usage: `pnpm run bolt make:controller <ControllerName>`
    -   Handles PascalCasing and appends "Controller" suffix if needed.
    -   Includes basic boilerplate for a controller class.

3.  **`make:model` Command:**
    -   Generates a new model class file in `app/models/`.
    -   Usage: `pnpm run bolt make:model <ModelName>`
    -   Handles PascalCasing for the model name.
    -   Includes basic boilerplate for a model class.

4.  **Basic Tests:**
    -   A test suite (`cli/tests/cli.test.ts`) provides initial coverage for the generator commands.
    -   Tests verify file creation, naming conventions, content generation, and error handling.
    -   A `pnpm run test:cli` script is available to run these tests.

5.  **Documentation:**
    -   A `cli/README.md` file documents the CLI's purpose, how to run commands, details of available commands, and testing instructions.

This CLI tool lays the groundwork for further DX improvements. Future commands (e.g., for migrations, seeding, cache management) can be added to this structure.
2025-06-07 16:22:40 +00:00
..