A CLI tool to help with all things @astrouxds.
This CLI provides commands to quickly scaffold new applications with Astro UXDS components and templates for React and Angular frameworks.
Since this package is not yet published on npm, you can install it locally using one of these methods:
# From the astro-cli project directory
npm run build
npm link
# Now you can use the CLI from anywhere
astro-cli react-template my-app
# From the astro-cli project directory
npm run build
./bin/run react-template my-app --noinstall
# From any directory, install from the local astro-cli path
npm install -g /path/to/astro-cli
# Or install locally in a project
npm install /path/to/astro-cli
Once published to npm, you'll be able to install it with:
npm install -g astro-cli
# or
npx astro-cli <command>
Create a new React application with Vite and Astro UXDS components:
astro-cli react-template <directory> [flags]
Examples:
# Create a React app in 'my-app' directory
astro-cli react-template my-app
# Skip automatic dependency installation
astro-cli react-template my-app --noinstall
# Use yarn for dependency installation
astro-cli react-template my-app --yarn
# Use npm for dependency installation
astro-cli react-template my-app --npm
Create a new Angular application with Astro UXDS components:
astro-cli angular-template <directory> [flags]
Examples:
# Create an Angular app in 'my-angular-app' directory
astro-cli angular-template my-angular-app
# Skip automatic dependency installation
astro-cli angular-template my-angular-app --noinstall
-n, --noinstall
- Skip the automatic installation of dependencies--yarn
- Use yarn for dependency installation (exclusive with --npm and --noinstall)--npm
- Use npm for dependency installation (exclusive with --yarn and --noinstall)
Get help for all commands:
astro-cli help
Get help for a specific command:
astro-cli help react-template
astro-cli help angular-template
You can test commands locally without installing globally:
# Build the project first
npm run build
# Run commands using the local binary
./bin/run react-template test-app --noinstall
./bin/run angular-template test-app --noinstall
- Use the
--noinstall
flag when testing to skip dependency installation and speed up testing - After making changes to the source code, run
npm run build
to recompile before testing - Use
npm link
to create a global symlink for local development testing - To unlink the global package:
npm unlink -g astro-cli
- To update the linked package after changes:
npm run build
(no need to re-link)