CLI tool to initialize Ionic Angular projects with Firebase configuration
npm install @accessiblewebmedia/ionic-angular-initangular.json with build and serve configurations
bash
Global installation
npm install -g @accessiblewebmedia/ionic-angular-init
Or use npx (recommended)
npx @accessiblewebmedia/ionic-angular-init
`
Usage
$3
`bash
Interactive mode
npx @accessiblewebmedia/ionic-angular-init
Non-interactive with defaults
npx @accessiblewebmedia/ionic-angular-init --yes
Preview changes without applying
npx @accessiblewebmedia/ionic-angular-init --dry-run
`
$3
`bash
npx @accessiblewebmedia/ionic-angular-init \
--yes \
--author "Your Name" \
--title "My Awesome App" \
--website "https://myapp.com" \
--firebase \
--ci=github \
--hosting-sites="prod:myapp-prod,staging:myapp-staging" \
--branch-prod=main \
--branch-staging=develop
`
Options
| Option | Description | Default |
|--------|-------------|---------|
| -y, --yes | Skip prompts and use defaults | false |
| --dry-run | Show planned changes without writing files | false |
| --author | Author name for package.json | Prompted |
| --title | Project title (used for package.json name) | Prompted |
| --website | Website URL for package.json homepage | Prompted |
| --firebase | Ensure @angular/fire and firebase are installed | false |
| --ci | CI/CD setup | github |
| --hosting-sites | Firebase hosting sites mapping | Prompted |
| --branch-prod | Production branch name | main |
| --branch-staging | Staging branch name | staging |
What It Does
$3
Creates/updates environment files in src/environments/:
- environment.ts - Development
- environment.prod.ts - Production
- environment.staging.ts - Staging
- environment.prod.staging.ts - Staging with production build
- environment.example.ts - Example configuration
- environment.prod.example.ts - Example production configuration
$3
- Adds useful npm scripts for different environments
- Sets author, homepage, and project name
- Ensures Node.js 18+ requirement
- Installs Firebase dependencies if requested
- Version bump and deploy scripts:
- vd - Patch bump, build, deploy to production
- fvd - Feature bump, build, deploy to production
- mvd - Major bump, build, deploy to production
- td - Build and deploy to staging (no version bump)
$3
Updates angular.json with:
- Build configurations for staging and production
- Serve configurations for different environments
- File replacements for environment switching
$3
If --firebase is passed:
- Generates firebase.json and .firebaserc
- Creates GitHub Actions workflow for CI/CD
- Sets up hosting targets for production and staging
$3
Generates:
- Project README with usage instructions
- docs/ folder with detailed guides
- Environment configuration guide
- Deployment instructions
Project Requirements
The CLI validates that you're in a valid Ionic Angular workspace:
- Must have package.json with @ionic/angular and @angular/core dependencies
- Must have angular.json with proper project structure
Examples
$3
`bash
cd my-ionic-app
npx @accessiblewebmedia/ionic-angular-init --yes --firebase
`
$3
`bash
npx @accessiblewebmedia/ionic-angular-init \
--title "Kahal" \
--author "Alicia Anne Taylor" \
--website "https://theoneassembly.org" \
--firebase \
--hosting-sites="prod:kahal-prod,staging:kahal-staging"
`
$3
`bash
npx @accessiblewebmedia/ionic-angular-init --dry-run --firebase
`
Development
$3
`bash
npm install
npm run build
`
$3
`bash
npm run dev
`
$3
`bash
npm test
``