## Simplify `create-twenty-app` for zero-interaction use Makes `npx create-twenty-app@latest my-app` a fully non-interactive, single-command experience suitable for automated environments (Codex, Claude plugins). ### Changes - **Remove all interactive prompts** — app name, display name, description, and scaffold confirmation are now derived from CLI args with sensible defaults. `inquirer` dependency removed entirely. - **Replace OAuth with API key auth** — use the seeded dev API key (`DEV_API_KEY`) to authenticate against the Docker instance as `tim@apple.dev`, eliminating the browser-based OAuth flow. - **Docker-first with early validation** — check Docker is installed before scaffolding; if missing, print the install URL and exit. Detect alternative runtimes (Podman, nerdctl). - **Parallel image pull** — `docker pull` runs in the background during scaffold + dependency install, saving 10-30s on typical runs. - **Always pull latest image** — ensures the dev server is up-to-date on every run. - **Stop detecting port 3000** — only check port 2020 (Docker instance). - **Update CLI flags** — remove `--skip-local-instance` and `--yes`; add `--skip-docker`. - **Update CI workflows and docs** — align e2e workflows, package README, and template README/cd.yml with the new flow.
34 lines
941 B
TypeScript
34 lines
941 B
TypeScript
import { execSync } from 'node:child_process';
|
|
|
|
const DOCKER_DOWNLOAD_URLS: Record<string, string> = {
|
|
darwin: 'https://docs.docker.com/desktop/setup/install/mac-install/',
|
|
win32: 'https://docs.docker.com/desktop/setup/install/windows-install/',
|
|
linux: 'https://docs.docker.com/engine/install/',
|
|
};
|
|
|
|
export const isDockerInstalled = (): boolean => {
|
|
try {
|
|
execSync('docker --version', { stdio: 'ignore' });
|
|
|
|
return true;
|
|
} catch {
|
|
return false;
|
|
}
|
|
};
|
|
|
|
export const getDockerInstallInstructions = (): string => {
|
|
const url =
|
|
DOCKER_DOWNLOAD_URLS[process.platform] ?? DOCKER_DOWNLOAD_URLS.linux;
|
|
|
|
return [
|
|
' Docker is required but not installed.',
|
|
'',
|
|
` Install Docker: ${url}`,
|
|
'',
|
|
' Then run this command again.',
|
|
'',
|
|
' Alternatively, connect to an existing Twenty instance:',
|
|
' npx create-twenty-app@latest my-twenty-app --api-url <your-instance-url>',
|
|
].join('\n');
|
|
};
|