Skip to content

fix: add headless mode validation and documentation#14

Open
strausr wants to merge 1 commit intomainfrom
add-headless-mode-doc
Open

fix: add headless mode validation and documentation#14
strausr wants to merge 1 commit intomainfrom
add-headless-mode-doc

Conversation

@strausr
Copy link
Copy Markdown
Collaborator

@strausr strausr commented May 1, 2026

add headless mode validation and documentation

@strausr strausr requested a review from eportis-cloudinary May 1, 2026 18:34
Copy link
Copy Markdown
Collaborator

@eportis-cloudinary eportis-cloudinary left a comment

Choose a reason for hiding this comment

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

Couple of tweaks; only important one is that I don't think we should check for --projectName, because the default (my-cloudinary-app) is used if you don't supply it.

Comment thread cli.js
}));
} catch (e) {
console.error(chalk.red(`Error: ${e.message}`));
console.error(chalk.gray('Tip: If a flag value starts with a dash, use --flag=value syntax (e.g., --cloudName=-myvalue)'));
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.

Are cloud names or upload preset names allowed to start with a dash? At the very least, this feels kind of rare to show every time anyone encounters any error

Comment thread cli.js

const errors = [];

if (!values.projectName) {
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.

Not actually required, because of the default of my-cloudinary-app (we should still keep the "does the directory already exist" check though!)

Comment thread README.md
For CI/CD pipelines, scripts, or automated workflows, pass `--headless` along with all options as flags to skip the interactive prompts:

```bash
npx create-cloudinary-react -- --headless \
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 think we don't need the --

Comment thread README.md
| `--startDev` | boolean | `false` | Start the dev server after install |
| `--packageManager` | string | *(auto-detected)* | `npm`, `pnpm`, `yarn`, or `bun` |

> **Note:** If a flag value starts with a dash, use `--flag=value` syntax (e.g. `--cloudName=-myvalue`). Shell variables should be quoted: `--cloudName "$CLOUD_NAME"`.
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.

Ditto for my above note. Feels...rare.

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