Skip to content

docs: add CLI Interactivity ADR#7927

Open
y-lakhdar wants to merge 3 commits into
mainfrom
cli-interactivity-adr
Open

docs: add CLI Interactivity ADR#7927
y-lakhdar wants to merge 3 commits into
mainfrom
cli-interactivity-adr

Conversation

@y-lakhdar

@y-lakhdar y-lakhdar commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

ADR 003 — CLI Interactivity

Records the interactivity boundary for @coveo/create-ui:

  • Two-phase model: resolve all inputs upfront (flags or prompts), then hand a single options object to non-interactive execution.
  • One-way flow: prompts → options → execution. Business logic never calls back into the interactive layer.
  • Structural enforcement: @clack/prompts confined to log.ts (output facade) and prompt.ts (input). An oxlint no-restricted-imports rule guards the boundary.
  • No wizard pattern: a prompt is forbidden if it changes which execution steps run or is asked after the first side effect.

Motivated by the previous Coveo CLI, where interleaved prompts tangled business logic and made testing painful.

@changeset-bot

changeset-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 84bf0bd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@svcsnykcoveo

svcsnykcoveo commented Jul 6, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds ADR 003 documenting the intended interactivity boundary for @coveo/create-ui, aiming to keep prompting strictly separated from execution logic to preserve scriptability and testability.

Changes:

  • Introduces a new ADR describing a two-phase CLI model (resolve inputs first, then execute).
  • Defines one-way flow constraints between prompting and business logic, including a “no wizard” litmus test.
  • Documents how state-dependent decisions must be resolved before execution begins.

Comment thread packages/create-ui/docs/adr/003-cli-interactivity.md Outdated
Comment on lines +24 to +30
### 2. The interactive layer and business logic communicate one way only

Data and control flow in a single direction:

`flags / prompts → resolved options object → execution`

Business logic never calls back into the interactive layer. There is no point at which execution pauses to ask a question, and no prompt whose answer selects which execution step runs next. The rejected alternative is the wizard / flow-diagram model that hurt the previous CLI:
Comment thread packages/create-ui/docs/adr/003-cli-interactivity.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@pkg-pr-new

pkg-pr-new Bot commented Jul 6, 2026

Copy link
Copy Markdown
@coveo/atomic

npm i https://pkg.pr.new/@coveo/atomic@7927

@coveo/atomic-hosted-page

npm i https://pkg.pr.new/@coveo/atomic-hosted-page@7927

@coveo/atomic-legacy

npm i https://pkg.pr.new/@coveo/atomic-legacy@7927

@coveo/atomic-react

npm i https://pkg.pr.new/@coveo/atomic-react@7927

@coveo/auth

npm i https://pkg.pr.new/@coveo/auth@7927

@coveo/bueno

npm i https://pkg.pr.new/@coveo/bueno@7927

@coveo/create-atomic

npm i https://pkg.pr.new/@coveo/create-atomic@7927

@coveo/create-atomic-component

npm i https://pkg.pr.new/@coveo/create-atomic-component@7927

@coveo/create-atomic-component-project

npm i https://pkg.pr.new/@coveo/create-atomic-component-project@7927

@coveo/create-atomic-result-component

npm i https://pkg.pr.new/@coveo/create-atomic-result-component@7927

@coveo/create-atomic-rollup-plugin

npm i https://pkg.pr.new/@coveo/create-atomic-rollup-plugin@7927

@coveo/headless

npm i https://pkg.pr.new/@coveo/headless@7927

@coveo/headless-react

npm i https://pkg.pr.new/@coveo/headless-react@7927

@coveo/shopify

npm i https://pkg.pr.new/@coveo/shopify@7927

commit: 84bf0bd


## Context

`@coveo/create-ui` (`npm create @coveo/ui`) scaffolds a project from the official samples (see [ADR 001](./001-sample-consumption.md), [ADR 002](./002-sample-publishing.md)). Two inputs drive a run: the **template** and the **project name**. When both are supplied as flags/arguments the CLI runs unattended; when one is missing the CLI offers a small menu to pick it — the interactive selection [ADR 001](./001-sample-consumption.md) §7 left as "planned."

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Versions too?

Comment on lines +27 to +29
Data and control flow in a single direction:

`flags / prompts → resolved options object → execution`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I'll add another "flow" to explain how we think about it architecturally:
feature/requirement -> executionCode -> executionOption -> flags/prompt
i.e. "a new requirement comes, we add the code path in the execution, if the feature is optional, we add the optionality on the entrypoint of the execution layer, and map a flag or prompt to the option"

This can be an interesting "thought model" to keep in mind for the addition of new functionnalities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants