Skip to content

feat(cli): add the guided init, the menu and unattended mode - #7

Open
Decipher wants to merge 31 commits into
feature/04-enginesfrom
feature/05-interactive
Open

Decipher wants to merge 31 commits into
feature/04-enginesfrom
feature/05-interactive

Conversation

@Decipher

Copy link
Copy Markdown
Member

What changed

  • In a terminal, drx init is a guided run. It asks for the starter, the layout and the engine, shows what it will do, and marks each step as done.
  • drx with no command opens a menu. The module commands offer a list to pick a module from.
  • A presentation module, with the Druxt wordmark and colour for output in a terminal. A command to repeat is printed quoted, ready to paste.
  • --no-interactive, DRX_NO_INTERACTIVE=1, CI and a missing terminal each turn the prompts off. A test runs init, info and the module commands under each of the four.
  • The quickstart entry describes the starter in one sentence, for the list of starters.
  • The pack check runs an unattended drx init with the installed binary.
  • The README and the changeset describe the terminal mode, the wordmark, colour and unattended runs.

Why

A first run should not need the flags learned. A script or a pipeline needs the opposite: no prompt, ever, and the same result from flags alone. Both now hold, and the tests pin the second.

How it was checked

  • npm run lint and npm run typecheck pass
  • npm test passes, and coverage did not drop
  • A changeset is included, if a published package changed
  • Nothing that resolves only on a private network reached a tracked file

Run from a clean npm ci: each run: line of the workflow's lint and test jobs, yamllint, actionlint and npm run build. npm test ran 608 tests, above the floor. The pack step ran as the workflow has it, and now ends with drx init pack-site --yes --no-interactive --json from the installed binary.

Not covered yet

  • No prompt has been driven in a real terminal. The tests answer them through an injected interface.
  • In the menu, adding, removing and configuring a module and managing patches are listed as not available yet.
  • The end-to-end test was not run for this change.

- In a terminal, drx init is a guided run: it asks for the starter, the
  layout and the engine, and marks each step as it finishes.
- drx with no command opens a menu, and the module commands offer a
  list to pick from.
- Output in a terminal shows the Druxt wordmark, in colour. A command
  to repeat is printed quoted, ready to paste.
- `--no-interactive`, DRX_NO_INTERACTIVE=1, CI and a missing terminal
  each turn the prompts off. The tests run init, info and the module
  commands under each of the four.
- The pack check runs an unattended init with the installed binary.
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 315ed261-3d70-4f23-9f56-aa1263fb6c7f
Commits

Reviewing files that changed from the base of the PR and between c0eb7ee and 7bd916e.

Files selected for processing: 39

  • .changeset/first-release-cli.md
  • .cspell-project-words.txt
  • .github/workflows/ci.yml
  • .gitlab-ci.yml
  • README.md
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/info.ts
  • packages/cli/src/commands/init.ts
  • packages/cli/src/commands/menu.ts
  • packages/cli/src/commands/module.ts
  • packages/cli/src/context.ts
  • packages/cli/src/engines/choose.ts
  • packages/cli/src/engines/project-name.ts
  • packages/cli/src/install.ts
  • packages/cli/src/output.ts
  • packages/cli/src/presentation.ts
  • packages/cli/src/prompts.ts
  • packages/cli/src/registry/entry.ts
  • packages/cli/src/repeat.ts
  • packages/cli/src/user-config.ts
  • packages/cli/test/cli.test.ts
  • packages/cli/test/commands/init-engines.test.ts
  • packages/cli/test/commands/init-guided.test.ts
  • packages/cli/test/commands/init.test.ts
  • packages/cli/test/commands/menu.test.ts
  • packages/cli/test/e2e/quickstart.test.ts
  • packages/cli/test/helpers/prompter.ts
  • packages/cli/test/helpers/run.ts
  • packages/cli/test/install.test.ts
  • packages/cli/test/non-interactive.test.ts
  • packages/cli/test/options-before.test.ts
  • packages/cli/test/output.test.ts
  • packages/cli/test/presentation.test.ts
  • packages/cli/test/prompts.test.ts
  • packages/cli/test/registry/entry.test.ts
  • packages/cli/test/repeat.test.ts
  • packages/cli/test/user-config.test.ts
  • starters/index.json
  • starters/quickstart.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@Decipher
Decipher added this pull request to stack #9 November 18, 2026 03:31
@Decipher
Decipher force-pushed the feature/05-interactive branch from 9c93273 to 838cd00 Compare November 18, 2026 06:51
The shell quoting the `cd` line uses is the function this branch
already has for a command to repeat, so the file stays as it is here.
- `drx init` with no directory and nobody to ask said there was no
  terminal to ask on, also when it ran in one with the questions turned
  off. It now names the cause: `--no-interactive`, `DRX_NO_INTERACTIVE`
  or `CI` when one of them turned the questions off, `--json` when that
  did, and the missing terminal only when there is none.
- The context of a command holds what turned the questions off, in
  `questionsOff`.
`drx module --json list` printed the text table, and `drx module
--module-registry <url> list` read the public registry. An option
between `module` and its command was dropped without a word.

- Such an option is now moved to after the command's name before the
  arguments are parsed, so it does what the same option does there. One
  the command does not have is refused by the command.
- With `--json` before the command, a failure is one JSON document on
  stdout as well.
- A guided `init --force` into a directory that holds files says in
  its summary that the files of every engine are kept.
`drx module --type contrib list` failed with "Unknown command
contrib", and `drx --json info` printed text. An option before a
command was read by the options of the group alone, and one before a
top-level command was dropped.

- An option before the name of a command is now moved to after it,
  with its value, whether that is the next argument or follows `=`.
  The command is the one the arguments name once each option is read
  as that command defines it.
- This holds before a top-level command as well, so `drx --json info`
  prints JSON and `drx --json module list` does too.
- An option the command does not have is refused there as well.
- `--help` after such an option shows the usage of the command named.
… its setup ran

An install's own banner and next steps appeared in the middle of the run
and disagreed with the steps init printed. The output is kept now, and its
end is in the error when the install fails.

A starter's entry can say how to tell that its install ran the setup. When
that check does not pass, the setup stays among the next steps.

An engine has a name to show in the prompt and a separate phrase for what
it needs. The small header is printed once for each run, after the menu
too. The bundled registry is announced in one line. A site that would sit
inside a git repository gets a warning.
…had its own

Every site made from one starter had the same DDEV or Lando project name,
so a second site was the first one's project to the engine, with its
database and its address. init now writes a name made from the site's
directory in the files the starter lists, and in the backend URL.
With the none engine nothing sets the backend up, and the quickstart does
not start until its OAuth client ID is in the site's environment file. A
starter's entry can list such lines, and init prints them as notes.
… name

The name was trimmed with regular expressions that backtrack on a long
run of hyphens. The end-to-end test now expects the site's own project
name in the Lando file and in the backend URL.
"Show a module" and "Show this project" did not say what would be shown.
The choices are now "View a module's details" and "View this project's
details", which is the word npm, pnpm and the GitHub CLI use for reading
one item. The help text of the module commands follows.
The entries gained fields at this level, so a build from it has to prefer
its bundled copy over a published registry that does not have them yet.
The quickstart starter's note that `npm run dev` starts the backend again
was printed after every install, whatever engine was chosen. It is now a
note of the php engine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants