jinomial/fw-cli

The command line interface for the FW framework.

Maintainers

Package info

github.com/jinomial/fw-cli

pkg:composer/jinomial/fw-cli

Statistics

Installs: 4

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.1 2026-03-07 20:41 UTC

This package is auto-updated.

Last update: 2026-03-07 20:43:38 UTC


README

This is the command-line utility for the FW Ecosystem, acting as the core compiler that transforms declarative YAML into highly-optimized, strictly-typed PHP code.

Available Commands

When running php fw from your application root, the following commands are available:

build:api

  • Purpose: Compiles api/*.yaml files.
  • Output:
    • Generates strict readonly class DTOs for payloads.
    • Generates *Handler classes with invoked methods.
    • Compiles build/routes.php as a static array for the Kernel.

build:db

  • Purpose: Compiles database/schema.yaml.
  • Output:
    • Generates strictly-typed native PHP *Model classes (e.g., UserModel).
    • Generates *RepositoryInterface contracts.
    • Generates Base*Repository classes containing explicit parameter-bound SQL queries mapping to the DTOs, completely eliminating N+1 lazy loading.

build:migrations

  • Purpose: Compiles database/schema.yaml diffs into SQL scripts.
  • Output:
    • Drops raw CREATE TABLE .sql scripts into database/migrations/.

build:container

  • Purpose: Compiles the Dependency Injection Container.
  • Output:
    • Reflects across your entire application and specifically bound config/dependencies.php file.
    • Writes build/container.php, a gigantic switch/case statement of instantiated singletons to eliminate runtime reflection overhead.