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

structui-cli

v0.1.7

Published

Struct UI CLI for adding blocks and components to your project.

Readme

Struct UI CLI

The official command-line tool for Struct UI. Install components and blocks directly into your project, scaffold full application setups, and manage styles — all without leaving the terminal.

npx sui add button

Requirements

  • Node.js >=18.17
  • A Next.js project using Tailwind CSS v4

Quick Start

# 1. Initialize Struct UI in your project
npx sui init

# 2. Apply the base stylesheet to your globals.css
npx sui style

# 3. Add className="dark" to your <html> element, then browse and install
npx sui search
npx sui add button

Components and blocks rely on CSS custom properties defined by sui style. Skipping this step will result in unstyled output.


Commands

sui init

Scaffolds the Struct UI configuration in your project. Creates sui.config.json, install directories, a cn() utility, and installs clsx + tailwind-merge.

npx sui init

sui add <name>

Installs a component or block from the registry into your project.

npx sui add button
npx sui add hero-section
npx sui add pricing-section

Blocks are installed to components/struct/ by default. When a block is installed, the CLI will remind you to run sui style and confirm your <html> element carries a theme class.


sui setup <type>

Scaffolds a complete application starter with pages, layouts, and components pre-wired.

npx sui setup crm
npx sui setup erp
npx sui setup saas
npx sui setup auth

You can also use shorthand via add:

npx sui add crm-setup
npx sui add erp-setup
npx sui add saas-setup
npx sui add auth-setup

Supported auth providers during setup: next-auth, better-auth, basic-auth, none.


sui search [query]

Searches the registry. Supports filtering by type.

npx sui search             # list everything
npx sui search hero        # keyword search
npx sui search --blocks    # blocks only
npx sui search --components  # components only
npx sui search --type block pricing

sui style

Writes the complete Struct UI stylesheet to your global CSS file. Includes CSS custom properties, theme tokens, keyframe animations, and sheet/dialog/overlay utilities.

npx sui style

The CLI auto-detects common CSS file paths (app/globals.css, src/app/globals.css, etc.). If none is found, you will be prompted.


sui palette <theme>

Swaps the color palette in your global CSS file without touching other styles.

npx sui palette default
npx sui palette rose
npx sui palette midnight
npx sui palette khaki

Run without arguments for an interactive picker.


sui info <name>

Displays registry metadata for a specific package: version, description, dependencies, tags, and file paths.

npx sui info button
npx sui info hero-section

sui list

Lists all locally installed packages with version and update status.

npx sui list

sui update [name]

Updates one package or all outdated packages.

npx sui update            # update everything
npx sui update button     # update a specific package

sui doctor

Validates your local Struct UI setup: config file, install path, utils path, and state file.

npx sui doctor

sui registry

Prints live metadata from the registry endpoint: version, item count, and last updated timestamp.

npx sui registry

sui version · sui about

npx sui version   # print CLI version
npx sui about     # project links and metadata

Configuration

Running sui init creates sui.config.json at the project root:

{
  "registryUrl": "https://structui.com/api/registry/index.json",
  "installPath": "components/struct",
  "statePath": ".sui/installed.json",
  "cachePath": ".sui/cache/registry-index.json",
  "utilsPath": "src/lib/utils.ts"
}

All fields are optional — the CLI falls back to these defaults if the file is absent.

To point the CLI at a custom or self-hosted registry, set the environment variable:

SUI_REGISTRY_URL=https://my-registry.example.com/api/registry/index.json npx sui search

Generated Files

| Path | Purpose | |---|---| | sui.config.json | Local CLI configuration | | .sui/installed.json | Installed package state | | .sui/cache/registry-index.json | Cached registry index for offline reads |


Registry Contract

The CLI expects the registry index at registryUrl to return:

{
  "registryVersion": 1,
  "updatedAt": "2026-01-01T00:00:00.000Z",
  "items": [
    {
      "name": "button",
      "type": "component",
      "version": "1.0.0",
      "description": "Accessible button component.",
      "entrypoint": "components/button.json",
      "dependencies": [],
      "tags": ["general", "form"]
    }
  ]
}

Each item detail document (resolved from entrypoint) must follow:

{
  "name": "button",
  "type": "component",
  "version": "1.0.0",
  "description": "Accessible button component.",
  "dependencies": [],
  "tags": ["general", "form"],
  "files": [
    {
      "path": "button.tsx",
      "content": "export function Button() {}"
    }
  ]
}

Blocks follow the same shape with "type": "block" and entrypoints under blocks/.


Local Development

git clone https://github.com/structui/struct-cli.git
cd struct-cli
npm install
npm run build
node dist/cli.js help

Type-check without emitting:

npm run check

License

MIT — structui.com