create-nobi-react-app
v1.1.5
Published
Create a React app from Nobi template
Downloads
10
Readme
create-nobi-react-app
A simple CLI to bootstrap a React application from the tuyenpham2502/react-base template.
Install
You can use it directly with npx (recommended), or install globally.
npx create-nobi-react-app <project-name>or:
npm install -g create-nobi-react-app
create-nobi-react-app <project-name>Usage
npx create-nobi-react-app my-appWhat happens:
Environment checks
- Verifies Node.js >= 18
- Verifies Git is installed
Clone template
- Prompts you for your GitHub token
- Uses that token to clone the private template repository over HTTPS
- In non-interactive environments, reads the token from
NOBI_GITHUB_TOKENorGITHUB_TOKEN
Project setup
- Removes the original
.gitfolder - Updates
package.jsonnamefield to<project-name> - Detects the template's package manager lockfile (
pnpm-lock.yaml,yarn.lock,package-lock.json) - Asks you which package manager to use (
npm,yarn,pnpm)- In non-interactive environments, it automatically picks the detected one or falls back to
npm
- In non-interactive environments, it automatically picks the detected one or falls back to
- Removes the original
Install dependencies
- Runs the appropriate install command:
pnpm installoryarnornpm install
- Uses Corepack for
pnpm/yarnif available (prepares latest stable versions)
- Runs the appropriate install command:
Initialize a new Git repository
- Runs:
git initgit add .git commit -m "chore: init from template"
- If Git identity is not configured, this step may fail silently; you can initialize Git manually.
- Runs:
After creation
Inside the newly created project:
cd <project-name>
npm run dev # or yarn dev / pnpm dev, depending on what you choseRequirements
- Node.js: >= 18
- Git installed and available in
PATH - Access to the GitHub repository
tuyenpham2502/react-base- If you cannot clone the repository, the CLI will show an error and ask you to contact support.
Using a private template repository
When you run the CLI locally, it will ask for your GitHub token:
npx create-nobi-react-app my-appIf you need to run in CI or another non-interactive environment, export a GitHub token before running the CLI:
export NOBI_GITHUB_TOKEN=ghp_xxx
npx create-nobi-react-app my-appYou can also use GITHUB_TOKEN if that is already part of your environment.
Recommended GitHub token permissions:
- Fine-grained token
- Repository access: only the private template repository
- Permission:
Contents: Read-only
Troubleshooting & Support
If cloning the template repository fails or you need access:
- Please contact: [email protected] to get access or further support.
