Create ShadowJS apps with one command! This CLI tool helps you bootstrap new ShadowJS projects with Vite and TypeScript or JavaScript.
β‘ Fast β’ π― Type-Safe β’ π¦ Zero Config β’ π¨ Modern
- π Instant Setup: Create projects in seconds with Vite
- π― TypeScript Ready: Full TypeScript support with strict configuration
- π± Multiple Templates: Choose from 2 starter templates
- β‘ Zero Config: Works out of the box with sensible defaults
- π£οΈ Router Support: Built-in client-side routing with ShadowJS Router
- π¨ TailwindCSS Ready: Optional TailwindCSS v4 integration with pre-configured styles
- π Git Integration: Automatic git repository initialization
- π§ͺ Well Tested: Comprehensive test suite with Vitest
- π Security First: Regular security audits and dependency updates
A simple counter app with interactive buttons - perfect for learning ShadowJS basics.
An interactive task management application with full CRUD operations.
- Node.js: 20.0.0 or higher
- npm: 8.0.0 or higher (usually comes with Node.js)
# Using npx (recommended)
npx create-shadow-app my-app
# Using npm
npm create shadow-app my-app
# Using yarn
yarn create shadow-app my-app
# Using pnpm
pnpm create shadow-app my-app# Install globally
npm install -g create-shadow-app
# Use the CLI
create-shadow-app my-appThe CLI will guide you through the setup process:
- Project Name: Enter the name of your project
- Language: Choose between TypeScript or JavaScript
- Template: Select one of the available templates
- Router: Choose whether to add ShadowJS Router for client-side routing
- TailwindCSS: Choose whether to use TailwindCSS v4 for styling
- Git Repository: Choose whether to initialize a git repository
After setup, your project will have this structure:
my-app/
βββ index.html
βββ package.json
βββ vite.config.js (or vite.config.ts if TypeScript selected)
βββ tsconfig.json (if TypeScript selected)
βββ src/
βββ main.jsx (or main.tsx if TypeScript selected)
βββ App.jsx (or App.tsx if TypeScript selected)
βββ style.css (or tailwind.css if TailwindCSS selected)
βββ vite-env.d.ts (if TypeScript selected)
Note: If you choose TailwindCSS, the style.css file will contain TailwindCSS imports and pre-configured styles instead of traditional CSS.
After creating your project:
cd my-app
npm install
npm run devYour app will be running at http://localhost:3000
When you choose to initialize a git repository, the CLI will:
- Run
git initin your project directory - Add all project files to git
- Create an initial commit with the message "Initial commit"
When you choose to add ShadowJS Router, the CLI will:
- Add
@shadow-js/routeras a dependency - Set up a simple router configuration in
main.jsx(ormain.tsxif TypeScript selected) - Create a route for the root path (
/) that renders your App component - Update the App component to work with the router
This provides a foundation for building multi-page applications with client-side routing.
When you choose to use TailwindCSS, the CLI will:
- Add
tailwindcssand@tailwindcss/viteas dependencies - Configure Vite to use the TailwindCSS plugin
- Set up a
tailwind.cssfile with Tailwind imports and pre-configured styles - Include utility classes and component styles for your chosen template
The TailwindCSS setup includes:
- Base styles: Reset and typography using Tailwind's base layer
- Component styles: Pre-styled components for cards, buttons, and layouts
- Utility classes: Common patterns used in the template
- Responsive design: Mobile-first responsive utilities
You can start using TailwindCSS classes immediately in your JSX/TSX components:
function MyComponent() {
return (
<div className="bg-white rounded-lg shadow-lg p-6">
<h2 className="text-2xl font-semibold text-gray-800 mb-4">Hello World</h2>
<button className="bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded">
Click me
</button>
</div>
);
}# Clone the repository
git clone https://github.com/shadowjs-dev/shadow.git
cd shadow/packages/create-shadow-app
# Install dependencies
npm install
# Build the project
npm run build
# Run tests
npm test
# Start development mode
npm run devnpm run build- Build the projectnpm run dev- Build in watch modenpm run test- Run test suitenpm run test:coverage- Run tests with coveragenpm run lint- Run ESLintnpm run lint:fix- Fix ESLint issuesnpm run format- Format code with Prettiernpm run typecheck- Run TypeScript type checking
We welcome contributions! Please see our Contributing Guide for details on:
- π Reporting bugs
- β¨ Requesting features
- π οΈ Setting up a development environment
- π Code style and standards
- π§ͺ Testing guidelines
- π Documentation standards
- π ShadowJS Documentation
- ποΈ Vite Documentation
- π Contributing Guide
- π Changelog
- π§ Email: support@shadowjs.dev
- π¬ Discussions: GitHub Discussions
- π Issues: GitHub Issues
- π Documentation: ShadowJS Docs
MIT License - see LICENSE for details.
Built with β€οΈ by Jehaad AL-Johani for the ShadowJS ecosystem.
If you find this project helpful, please give it a star on GitHub! It helps others discover the project and motivates continued development.