Skip to content

LuCLI: wheels new myapp — full project scaffolding #1943

Closed

Description

@bpamiri

Port wheels new / wheels g app from CommandBox CLI to LuCLI module.

What it does

wheels new myapp scaffolds a complete Wheels project:

  • Directory structure (app/, config/, public/, tests/)
  • lucee.json (from template)
  • config/settings.cfm, config/routes.cfm, config/environment.cfm
  • .env with placeholder values
  • .gitignore

Source

Port from cli/src/commands/wheels/init.cfc and cli/src/commands/wheels/generate/app.cfc.

The new() function exists in Module.cfc but needs to be wired to the actual project scaffolding logic.

Part of #1942

Activity

  1. bpamiri commented on Mar 16, 2026

    @bpamiri
    CollaboratorAuthor

    Analysis

    Synopsis

    Port wheels new myapp full project scaffolding from CommandBox CLI to LuCLI, creating a complete Wheels project directory with lucee.json, config files, and starter controller/view.

    Merit Assessment

    Recommendation: Proceed with modifications

    • The new() function already exists in Module.cfc (line 233) and delegates to scaffoldNewApp() (line 1005), which creates the full directory structure, lucee.json, config/app.cfm, config/routes.cfm, a Main controller, and an index view. This is largely already implemented.
    • The current implementation is self-contained (inline file writes) rather than using the Templates service, which is fine for now but diverges from the legacy CLI's approach of downloading a ForgeBox template package.
    • Missing compared to the legacy generate/app.cfc: .env file, .gitignore, config/settings.cfm, config/environment.cfm, H2 datasource setup, Bootstrap option, and box.json/server.json. Some of these are CommandBox-specific and should be dropped; others (.env, .gitignore, settings.cfm, environment.cfm) are universally useful.

    Implementation Plan

    The scaffolding skeleton is already functional. The remaining work is filling gaps:

    1. Add missing config files to scaffoldNewApp() (line 1005 of Module.cfc):

      • config/settings.cfm — set reloadPassword, dataSourceName (currently only in config/app.cfm)
      • config/environment.cfm — environment detection boilerplate
      • .env — placeholder RELOAD_PASSWORD=, DATASOURCE_NAME=, LUCEE_ADMIN_PASSWORD=
      • .gitignore — exclude .env, db/, vendor/, .lucli/, etc.
    2. Add app/views/layout.cfm — the default HTML layout wrapper (currently missing; Wheels expects it)

    3. Add optional flags to new():

      • --setupH2 or --database=h2 — write H2 datasource config into lucee.json configuration.datasources
      • --template= — allow selecting from bundled templates (stretch goal, not needed for MVP)
    4. Consider extracting to a service — services/AppScaffold.cfc — to keep Module.cfc from growing further (it's already 1,388 lines). This also makes testing easier.

    5. Vendor Wheels framework — the scaffolded app references vendor/wheels/ in mappings but doesn't copy the framework there. Need to either bundle it or print a "next step: install wheels" instruction.

    Estimated complexity: Low-medium. 2-3 hours. Most of the hard work (directory creation, lucee.json generation) is done.

    Dependencies & Risks

    • Depends on: LuCLI Phase 2: Service layer, generators, and MCP annotations #1941 (merged) — services layer is in place
    • Blocks: LuCLI: end-to-end testing against real project #1949 (end-to-end testing needs a scaffolded app to test against)
    • Risk: The legacy generate/app.cfc downloads templates from ForgeBox via CommandBox's packageService.installPackage(). LuCLI cannot do this. The inline approach is correct for LuCLI but means template updates require code changes rather than just publishing a new ForgeBox package. This is an acceptable tradeoff for now.
    • Risk: lucee.json config structure may drift from what LuCLI expects as LuCLI evolves. Pin to a known-working schema.

    Automated analysis by @claude — review and adjust as needed.

  2. added this to the v3.2 milestone on Mar 17, 2026
  3. bpamiri commented on Mar 25, 2026

    @bpamiri
    CollaboratorAuthor

    Implemented in develop.

    • 3128a81 feat: wire wheels new/create/generate app commands into LuCLI Module.cfc (wh-glj.3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions