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

@drupal/xb-cli

v0.1.2

Published

CLI tool for managing Drupal Experience Builder code components

Readme

Experience Builder CLI

A command-line interface for managing Drupal Experience Builder code components, which are built with standard React and JavaScript. While Experience Builder includes a built-in browser-based code editor for working with these components, this CLI tool makes it possible to create, build, and manage components outside of that UI environment.

Installation

npm install @drupal/xb-cli

Setup

  1. Install the Experience Builder OAuth module (xb_oauth), which is shipped as a submodule of Experience Builder.
  2. Follow the configuration steps of the module to set up a client with an ID and secret.

Configuration

Settings can be configured using:

  1. Command-line arguments;
  2. Environment variables;
  3. A project .env file;
  4. A global .xbrc file in your home directory.

These are applied in order of precedence from highest to lowest. You can copy the .env.example file to get started.

| CLI argument | Environment variable | Description | | ----------------- | ---------------------------------- | ------------------------------------------------------------- | | --site-url | EXPERIENCE_BUILDER_SITE_URL | Base URL of your Drupal site. | | --client-id | EXPERIENCE_BUILDER_CLIENT_ID | OAuth client ID. | | --client-secret | EXPERIENCE_BUILDER_CLIENT_SECRET | OAuth client secret. | | --dir | EXPERIENCE_BUILDER_COMPONENT_DIR | Directory where code components are stored in the filesystem. | | --verbose | EXPERIENCE_BUILDER_VERBOSE | Verbose CLI output for troubleshooting. Defaults to false. | | --scope | EXPERIENCE_BUILDER_SCOPE | (Optional) Space-separated list of OAuth scopes to request. |

Note: The --scope parameter defaults to "xb:js_component xb:asset_library", which are the default scopes provided by the Experience Builder OAuth module (xb_oauth).

Commands

download

Download components to your local filesystem.

Usage:

npx xb download [options]

Options:

  • -c, --component <name>: Download a specific component by machine name
  • --all: Download all components

Downloads one or more components from your site. You can select components to download, or use --all to download everything. Existing component directories will be overwritten after confirmation. Also downloads global CSS assets if available.


scaffold

Create a new code component scaffold for Experience Builder.

npx xb scaffold [options]

Options:

  • -n, --name <n>: Machine name for the new component

Creates a new component directory with example files (component.yml, index.jsx, index.css).


build

Build local components and Tailwind CSS assets.

npx xb build [options]

Options:

  • --all: Build all components
  • --no-tailwind: Skip Tailwind CSS build

Builds the selected (or all) local components, compiling their source files. Also builds Tailwind CSS assets for all components (can be skipped with --no-tailwind). For each component, a dist directory will be created containing the compiled output. Additionally, a top-level dist directory will be created, which will be used for the generated Tailwind CSS assets.


upload

Build and upload local components and global CSS assets.

npx xb upload [options]

Options:

  • --all: Upload all components in the directory
  • --no-tailwind: Skip Tailwind CSS build and global asset upload

Builds and uploads the selected (or all) local components to your site. Also builds and uploads global Tailwind CSS assets unless --no-tailwind is specified. Existing components on the site will be updated if they already exist.