Skip to content

WIP: add root ai command for AI-assisted project generation#943

Open
stevenle wants to merge 1 commit intomainfrom
codex/add-cli-command-for-root-ai
Open

WIP: add root ai command for AI-assisted project generation#943
stevenle wants to merge 1 commit intomainfrom
codex/add-cli-command-for-root-ai

Conversation

@stevenle
Copy link
Member

Motivation

  • Provide a first-party CLI entrypoint to run an AI "thinking" model that can generate or edit project code and (when available) CMS docs for Root.js projects.

Description

  • Add a new CLI command root ai [prompt...] wired into @blinkk/root's CLI and exported from the CLI module (packages/root/src/cli/cli.ts).
  • Implement the one-shot AI workflow in packages/root/src/cli/ai.ts, which accepts prompt input from args or stdin and supports --api-key, --model, --yes, --dry-run, and --json flags.
  • Inspect the project context (routes, templates, schemas, docs) and detect if @blinkk/root-cms is present to enable CMS-aware prompting so the model may edit docs when appropriate.
  • Call Gemini's generateContent endpoint with a Root.js-specific system prompt, parse and validate a structured JSON response that lists file changes, and safely write generated files only inside the project root.

Testing

  • Attempted to run pnpm --filter @blinkk/root build to validate the package build, but the command failed in this environment because Corepack could not download pnpm due to a network/proxy error (Proxy response (403) !== 200 when HTTP Tunneling).
  • No automated tests were executed successfully in this environment due to the network restriction preventing package manager operations.

Codex Task

@stevenle stevenle changed the title feat: add root ai command for AI-assisted project generation WIP: add root ai command for AI-assisted project generation Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant