npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

create-reactbricks-app

v1.5.1

Published

Scaffold a React Bricks project

Downloads

577

Readme

React Bricks CLI

The command-line interface tool for creating React Bricks apps with a starter templates and API validation rewritten in Clack.

Overview

The React Bricks CLI (create-reactbricks-app) is a comprehensive tool that streamlines the process of creating new React Bricks projects. It provides an interactive setup experience that guides users through authentication, app selection/creation, project configuration, and starter template selection.

What is React Bricks?

React Bricks is a CMS with visual editing based on React components. It allows developers to create websites and applications with a visual editing interface while maintaining full control over the codebase.

Features

  • 🔐 Authentication System: Secure login with session management
  • 📱 Multi-App Support: Create or select from existing React Bricks apps
  • 🎨 Multiple Framework Support: Next.js (App Router & Pages Router), Astro, Remix, and Gatsby
  • 🌐 Template Varieties: Choose from "Website and Blog with Tailwind" or "Empty project" starters
  • 📦 Package Manager Detection: Automatically detects and uses npm, yarn, or pnpm
  • 🛠️ Environment Setup: Automatic environment variable configuration
  • 📄 Content Seeding: Optional default content and image setup
  • 🔧 Git Integration: Automatic git repository initialization
  • 📊 Error Tracking: Built-in Sentry integration for monitoring

Technology Stack

  • Language: TypeScript
  • Runtime: Node.js (>=20.18.0)
  • Build Tool: unbuild
  • Package Manager: pnpm (with workspace support)
  • CLI Framework: @clack/prompts for interactive prompts
  • HTTP Client: axios for API communications
  • Process Management: execa for running shell commands
  • Authentication: configstore for persistent login sessions
  • Monitoring: @sentry/node for error tracking

Installation

The CLI is designed to be used with npx (no installation required):

npx create-reactbricks-app

Or install globally:

npm install -g create-reactbricks-app
# or
yarn global add create-reactbricks-app
# or
pnpm add -g create-reactbricks-app

Usage

Simply run the command and follow the interactive prompts:

npx create-reactbricks-app

Interactive Flow

  1. Authentication: Login with your React Bricks account credentials
  2. App Selection: Choose an existing app or create a new one
  3. Environment Selection: Select the environment (main, staging, etc.)
  4. Project Configuration: Set project name and folder
  5. Starter Template: Choose from available frameworks and templates
  6. Content Setup: Optionally load default content and images
  7. Installation: Automatic dependency installation and git initialization

Supported Frameworks and Templates

Next.js with App Router

  • Website and Blog with Tailwind (recommended)
  • Empty project

Next.js with Pages Router

  • Website and Blog with Tailwind (recommended)
  • Empty project

Astro (Node.js v22 required)

  • Website and Blog with Tailwind (recommended)
  • Empty project

Remix

  • Website and Blog with Tailwind (recommended)
  • Empty project

Gatsby

  • Website and Blog with Tailwind (recommended)
  • Empty project

Project Structure

src/
├── index.ts              # Main CLI entry point
├── starters.json         # Template configurations
└── helpers/
    ├── api.ts           # React Bricks API interactions
    ├── auth.ts          # Authentication prompts and logic
    ├── fs.ts            # File system utilities
    ├── starters.ts      # Starter template types and utilities
    ├── tasks.ts         # Project creation tasks (git, dependencies, etc.)
    └── utils.ts         # General utility functions

Development

Prerequisites

  • Node.js >= 20.18.0 (Astro starter requires >= 22.0.0)
  • pnpm >= 10.7.0

Setup

  1. Clone the repository:
git clone https://github.com/ReactBricks/create-reactbricks-app.git
cd create-reactbricks-app
  1. Install dependencies:
pnpm install
  1. Build the project:
pnpm build

Scripts

  • pnpm build - Build the project using unbuild
  • pnpm copy:starters - Copy starters.json to dist directory
  • pnpm prepack - Run build before packaging

Build Process

The project uses unbuild for building:

  • Compiles TypeScript to JavaScript (ESM)
  • Generates type declarations
  • Copies starters.json to the dist directory
  • Creates a single index.mjs entry point

Configuration

Environment Variables

The CLI creates environment files based on the selected starter template:

  • Next.js: .env.local
  • Astro: .env
  • Remix: .env
  • Gatsby: .env.production

Starter Configuration

Each starter template in starters.json contains:

{
  "framework": "Framework name",
  "starterProject": "Project type",
  "language": "TypeScript",
  "repoUrl": "GitHub repository URL",
  "startYarnCommand": "yarn dev",
  "startPnpmCommand": "pnpm dev",
  "startNpmCommand": "npm run dev",
  "envVariables": {
    "apiKey": "API_KEY",
    "appId": "APP_ID",
    "appEnv": "ENVIRONMENT"
  },
  "envFile": ".env.local",
  "importRbUI": false,
  "defaultImages": [...],
  "defaultContent": [...],
  "minimalImages": [...],
  "minimalContent": [...]
}

API Integration

The CLI integrates with the React Bricks API for:

  • User authentication and session management
  • App creation and retrieval
  • Environment management
  • Content and media upload
  • Admin operations for default content setup

API Endpoints Used

  • POST /v2/account/session - Authentication
  • GET /v2/account/apps - Retrieve user apps
  • POST /v2/account/apps - Create new app
  • POST /v2/admin/session - Admin authentication
  • POST /v2/admin/pages - Create pages
  • POST /v2/admin/media/images/create_from_url - Upload images

Error Handling

The CLI includes comprehensive error handling:

  • Network connectivity issues
  • Authentication failures
  • File system permissions
  • Git configuration problems
  • Package installation errors

Errors are automatically reported to Sentry for monitoring and improvement.

Code Style

  • TypeScript with strict mode enabled
  • ESM modules
  • Async/await for asynchronous operations
  • Comprehensive error handling
  • Clear, descriptive variable and function names

Support