Skip to content

CLI ​

brutx-vue is the official BrutxUI command-line tool, designed to help you quickly scaffold new projects, initialize configurations, manage component lifecycles, and run enterprise-grade diagnostics and self-healing.

Overview ​

You can run the CLI without local installation via package managers:

bash
npx brutx-vue@latest <command>

Alternatively, install it locally as a development dependency:

bash
pnpm add -D brutx-vue
# or
npm install -D brutx-vue

Project Setup ​

brutx-vue create ​

Scaffold a brand-new Vue 3 project pre-configured with BrutxUI from scratch:

bash
npx brutx-vue@latest create <project-name>

The create command downloads the template, sets up the directory layout, installs required dependencies, and executes init automatically.

Examples ​

Create a default Vite + Vue 3 + TypeScript project:

bash
npx brutx-vue@latest create my-app

Use the Nuxt template and specify bun as the package manager:

bash
npx brutx-vue@latest create my-nuxt-app --template nuxt --package-manager bun

Options ​

FlagDescriptionDefault
-t, --template <template>Project template (default, nuxt)default
--package-manager <pm>Package manager (pnpm, npm, yarn, bun)pnpm
-c, --cwd <path>Target working directoryCurrent directory
-y, --yesSkip confirmation prompts and use defaultsfalse

brutx-vue init ​

Initialize BrutxUI configuration in an existing Vue 3 project:

bash
npx brutx-vue@latest init

The init command executes the following setup steps automatically:

  1. Detects project framework (Vite + Vue, Nuxt, etc.) and Tailwind CSS version (v4 / v3)
  2. Discovers global CSS entry files and tsconfig.json path aliases
  3. Installs core dependencies (reka-ui, class-variance-authority, clsx, tailwind-merge, @lucide/vue)
  4. Generates the cn() utility function in src/lib/utils.ts
  5. Injects Neo-Brutalist design tokens and utility markers into your stylesheet
  6. Creates the components.json configuration file and components directory
  7. Detects Monorepo workspaces (pnpm / lerna / turbo) with support for root-level shared dependencies

Options ​

FlagDescriptionDefault
-y, --yesSkip confirmation prompts and use detected defaultsfalse
-d, --defaultsUse official default configurationfalse
-c, --cwd <path>Set working directoryCurrent directory
-f, --forceForce overwrite existing components.json and stylesfalse
-s, --silentSilent outputfalse
--vscodeGenerate VS Code intelligent snippetsfalse
--workspace-root <path>Explicitly specify monorepo workspace root directoryAuto-detected

Component Lifecycle Management ​

brutx-vue add ​

Add components to your project. The command recursively resolves and downloads all dependencies (subcomponents, composables, and locales) in topological order:

bash
npx brutx-vue@latest add [components...]

If no component names are provided, the CLI launches an interactive checklist.

Examples ​

Add single or multiple components:

bash
# Add a single component
npx brutx-vue@latest add button

# Add multiple components
npx brutx-vue@latest add button card dialog input

Add all available components:

bash
npx brutx-vue@latest add --all

Options ​

FlagDescriptionDefault
-a, --allAdd all available components from the registryfalse
-y, --yesSkip confirmation promptsfalse
-o, --overwriteOverwrite existing component filesfalse
-m, --mergeWhen component already exists, merge with 3-way mergefalse
-p, --path <path>Custom directory path to install component files intoAlias resolved path
-c, --cwd <path>Set working directoryCurrent directory
-s, --silentSilent outputfalse
--dry-runSimulate installation plan without writing files to diskfalse
-r, --registry <url>Override registry path or URLOfficial source
--no-cacheSkip local registry cache, forcing remote fetchfalse
--offlineOffline mode: read only local cache, disable network requestsfalse
--vscodeUpdate VS Code snippets libraryfalse
--filter <package>Monorepo: Target workspace package in a monorepo—
--sharedMonorepo: Target the shared UI package in a monorepofalse

Version Pinning with @version Syntax ​

Pin components to specific releases using the @ syntax:

bash
npx brutx-vue@latest add button@1.2.0
  • Custom Registries: @version works with GitHub raw URL registries (e.g., https://raw.githubusercontent.com/{owner}/{repo}/{ref}/...). The CLI dynamically replaces {ref} with the requested version.
  • Default Source Behavior: The official default source uses GitHub Release assets, which always fetch the latest stable release.
  • Version Mismatch Warning: If an already-installed component's version differs from the requested version, the CLI emits a non-blocking warning.

brutx-vue list ​

List all installed components in your project along with file counts and runtime dependencies:

bash
npx brutx-vue@latest list

Check for Updates ​

Pass --check-updates to verify component integrity against the remote registry and flag outdated components:

bash
npx brutx-vue@latest list --check-updates

Options ​

FlagDescriptionDefault
-c, --cwd <path>Set working directoryCurrent directory
--check-updatesCheck remote registry integrity to display available updatesfalse
--jsonOutput structured JSON formatfalse
-r, --registry <url>Specify registry path or URL for update checksConfigured source
--no-cacheSkip cache when checking updatesfalse
--offlineUse only cached data for checking updatesfalse
-s, --silentSilent outputfalse

brutx-vue info ​

Inspect metadata for a specific component (dependency tree, files, category, examples, and local installation status):

bash
npx brutx-vue@latest info <component>

Options ​

FlagDescriptionDefault
-c, --cwd <path>Set working directoryCurrent directory
--jsonOutput component details in JSON formatfalse
-r, --registry <url>Specify registry path or URLConfigured source
--offlineOffline mode (reads from cache)false
-s, --silentSilent outputfalse

brutx-vue diff ​

Compare local component implementations against the latest registry version:

bash
npx brutx-vue@latest diff [components...]

Examples ​

Compare one or multiple components:

bash
npx brutx-vue@latest diff button
npx brutx-vue@latest diff button card dialog

Compare all installed components:

bash
npx brutx-vue@latest diff --all

Options ​

FlagDescriptionDefault
--allCompare all installed componentsfalse
-c, --cwd <path>Set working directoryCurrent directory
-r, --registry <url>Target registry path or URLConfigured source
--jsonOutput JSON report with complete file patchesfalse
--no-cacheSkip cache and pull latest remote filesfalse
--offlineCompare using cached data onlyfalse
-s, --silentSilent outputfalse

brutx-vue update ​

Update installed components to the latest registry version using 3-way merge to preserve your local custom edits:

bash
npx brutx-vue@latest update [components...]

Examples ​

Update specific components:

bash
npx brutx-vue@latest update button card

Update all outdated components:

bash
npx brutx-vue@latest update --all

Simulate updates without writing to disk:

bash
npx brutx-vue@latest update --dry-run

Conflict Strategy Options ​

When local modifications collide with incoming updates, control merge behavior with conflict strategy flags:

FlagDescriptionDefault
-a, --allUpdate all outdated installed componentsfalse
-y, --yesSkip confirmation promptsfalse
-c, --cwd <path>Set working directoryCurrent directory
--dry-runSimulate update without writing to diskfalse
--across-versionsAllow updating version-pinned components across their locked versionfalse
--oursConflict Strategy: Accept all local changes in conflictsfalse
--theirsConflict Strategy: Accept all remote changes in conflictsfalse
-f, --forceOverwrite Mode: Force full overwrite, ignoring local changesfalse
--ciCI Gate: Run in CI mode, exit with code 1 on unresolved conflictsfalse
-r, --registry <url>Specify registry URLConfigured source
--no-cacheSkip cache and download latest assetsfalse
--offlineUse only cached datafalse
-s, --silentSilent outputfalse

brutx-vue remove ​

Safely remove components and automatically detect orphan dependencies:

bash
npx brutx-vue@latest remove <components...>

The remove command deletes component directories, checks reverse dependencies, detects orphan composables or locales that are no longer referenced, and prompts for cleanup.

Options ​

FlagDescriptionDefault
-y, --yesSkip confirmation promptsfalse
-c, --cwd <path>Set working directoryCurrent directory
--dry-runShow which files would be removed without deletingfalse
-s, --silentSilent outputfalse

Maintenance & Diagnostics ​

brutx-vue doctor ​

Comprehensive project health check and automated self-healing engine. Audits configuration integrity, Tailwind tokens, directory structures, dependencies, and code tampering:

bash
npx brutx-vue@latest doctor [options]

Diagnostic Categories ​

  • env: Runtime environment and package manager detection
  • config: components.json schema, version, and alias validity
  • tailwind: Tailwind CSS version and --brutal-* token injection status
  • structure: Component directory layout and cn() utility integrity
  • integrity: Component content hashes, file integrity, and audit log health
  • custom: User-defined or third-party diagnostic rule plugins

Diagnostic and CI Gate Options ​

FlagDescriptionDefault
--fixAutomatically fix fixable diagnostic issuesfalse
--fix-only <fixId>Apply only the specified fix (see Fix ID table below)—
--dry-runCombined with --fix: Preview repair plan (Plan Preview + Unified Diff) without disk writesfalse
--ciCI mode: Defaults to github reporter when running in CIfalse
--reporter <type>Reporter format (pretty, github, json, sarif, junit)pretty
--fail-on <level>Exit with code 1 on specified issue level (error, warn, drift)error
--output-file <path>Write diagnostic report to specified file path (e.g. SARIF / JUnit)—
--category <category>Filter checks by category (env, config, tailwind, structure, integrity)All
--rule <ruleId>Run specific diagnostic rule by IDAll
--jsonOutput JSON report (equivalent to --reporter json)false
--offlineSkip remote registry network reachability probesfalse
--sbomGenerate CycloneDX 1.5 SBOM for installed components and exit (see Security Guide)false
--sbom-output <path>Output path for generated SBOM file./brutx-sbom.json
-c, --cwd <path>Set working directoryCurrent directory
-y, --yesSkip confirmation prompts for fixesfalse
-s, --silentSilent outputfalse

Fix ID Reference Table ​

Pass these IDs to --fix-only <fixId>:

Fix IDScenarioSelf-Healing Action
add-schemaMissing $schema in components.jsonWrites official Schema validation URL
add-config-versionMissing or outdated $version in configurationUpdates to current configuration version
set-styleMissing style fieldSets style to brutalism
inject-css-tokensGlobal CSS missing BrutxUI token marker blockInjects design token block into stylesheet
create-components-dirComponents directory does not existCreates components target directory
create-utils-filesrc/lib/utils.ts missingGenerates utility file with cn()
add-cn-functionMissing cn() export in utils fileAppends cn() export to utils file
restore-integrityInstalled component corrupted or modifiedRestores baseline code from registry
remove-orphansOrphaned shared files with zero referencesSafely removes unused orphan files

Dry-Run Repair Plan Preview (--fix --dry-run) ​

Preview planned changes and unified file diffs before applying repairs:

bash
npx brutx-vue@latest doctor --fix --dry-run

brutx-vue cache ​

Manage local component and registry metadata caches:

bash
npx brutx-vue@latest cache clear [--max-age <days>]

Examples ​

Clear all local caches:

bash
npx brutx-vue@latest cache clear

Keep active cache entries from the last 7 days and clear older entries:

bash
npx brutx-vue@latest cache clear --max-age 7

brutx-vue registry ​

Manage registry sources in components.json (registries array) with automated fallback redundancy:

List resolved sources and reachability ​

bash
npx brutx-vue@latest registry list

Add a registry source ​

bash
npx brutx-vue@latest registry add https://mirror.example.com/registry

Remove a registry source (reverts to official default if all custom sources removed) ​

bash
npx brutx-vue@latest registry remove https://mirror.example.com/registry

Configuration File: components.json ​

Running init generates components.json in your project root:

json
{
  "$schema": "https://lidaixingchen.github.io/brutxui-vue3/schema.json",
  "$version": 1,
  "style": "brutalism",
  "tailwind": {
    "config": "",
    "css": "src/index.css",
    "tokensFile": "src/styles/tokens.css"
  },
  "aliases": {
    "components": "@/components",
    "utils": "@/lib/utils",
    "composables": "@/composables",
    "locales": "@/locales",
    "directives": "@/directives"
  },
  "workspace": {
    "mode": "standalone",
    "targetPackage": "ui",
    "sharedUtilsPackage": "shared",
    "installDependenciesTo": "targetPackage"
  },
  "registries": [
    "https://github.com/lidaixingchen/brutxui-vue3/releases/latest/download"
  ],
  "requireSignature": false,
  "rules": {
    "tailwind.tokens": "error",
    "integrity.drift": "warn"
  },
  "plugins": []
}

Configuration Field Reference ​

FieldTypeDescription
$schemastringJSON Schema URL for IDE validation and autocompletion
$versionnumberConfiguration version number (migrated automatically by CLI)
stylestringTheme style, currently locked to brutalism
tailwind.configstringTailwind configuration file path (empty string for Tailwind v4)
tailwind.cssstringGlobal CSS entry file path
tailwind.tokensFilestring(Optional) Independent design tokens file path
aliases.componentsstringComponent import alias (default: @/components)
aliases.utilsstringUtility functions import alias (default: @/lib/utils)
aliases.composablesstringComposables import alias (default: @/composables)
aliases.localesstring(Optional) Locales dictionary import alias
aliases.directivesstring(Optional) Vue custom directives import alias
workspaceobject(Optional) Monorepo workspace configuration
workspace.modestringWorkspace mode: standalone / shared-package / app-local / hybrid
workspace.installDependenciesTostringDependency installation target: targetPackage / caller / both
registriesstring[](Optional) Multi-registry list with ordered fallback
requireSignatureboolean(Optional) Enforce strict Ed25519 signature verification
trustedPublicKeysarray(Optional) Project-level trusted Ed25519 SPKI public keys
rulesobject(Optional) Diagnostic rule severity overrides ("off" / "warn" / "error")
pluginsstring[](Optional) Custom diagnostic rule plugins (relative path or npm package)

Global Options & Environment Variables ​

Global Flags ​

Global options must be placed before subcommands:

bash
npx brutx-vue@latest [global-options] <command> [command-options]
  • --dry-run: Global dry-run mode simulating write operations without disk mutation
  • --require-signature: Strict signature verification mode, failing immediately on invalid signatures
  • --verbose-level <1|2|3>: Verbose level (1=steps, 2=details/network, 3=trace/stacks)
  • -v / -vv / -vvv: Equivalent to --verbose-level 1 / 2 / 3
  • --verbose: Show full error stacks (equivalent to -v)

Environment Variable Matrix ​

Configure global CLI behaviors via environment variables in CI, Docker, or scripts:

VariableAllowed ValuesCLI FlagDescription
BRUTX_OFFLINE1--offlineEnable offline mode, reading only local cache
BRUTX_NO_CACHE1--no-cacheSkip local cache, always fetching from registry
BRUTX_DRY_RUN1--dry-runActivate global dry-run simulation
BRUTX_VERBOSE1 / 2 / 3-v / -vv / -vvvSet logging verbosity level
BRUTX_REQUIRE_SIGNATURE1--require-signatureEnforce strict signature verification gate
BRUTX_REGISTRY_PUBLIC_KEYSJSON string—Inject additional trusted Ed25519 public keys
BRUTX_CACHE_DIRDirectory string—Custom directory for local registry cache (default: .brutx/cache)
BRUTX_CACHE_MAXPositive integer—Maximum number of cached items before LRU eviction (default: 200)
BRUTX_CACHE_MAX_BYTESInteger bytes—Maximum total byte size for the cache directory

CI/CD Pipeline Integration ​

Integrate brutx-vue doctor into GitHub Actions or GitLab CI as a quality and compliance gate.

GitHub Actions Workflow Example ​

Create .github/workflows/brutx-check.yml:

yaml
name: BrutxUI Integrity & Quality Check

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  diagnose:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 22

      - name: Install pnpm
        uses: pnpm/action-setup@v4

      - name: Run Brutx Doctor Gate
        run: |
          # Fails PR if configuration errors, missing dependencies, or component code drift occur
          npx brutx-vue@latest doctor --ci --fail-on drift --reporter github

      - name: Generate Security SBOM
        if: always()
        run: |
          npx brutx-vue@latest doctor --sbom --sbom-output ./brutx-sbom.json

      - name: Upload SBOM Artifact
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: brutx-sbom
          path: ./brutx-sbom.json

Supply Chain Security & Compliance Overview ​

BrutxUI source distribution includes built-in anti-tampering and compliance verification:

  • Canonical Integrity Recomputation: Automatically recalculates SHA-256 hashes against manifest contents, guarding against CDN tampering and MITM attacks;
  • Ed25519 Digital Signatures: Verifies releases against the official root public key out-of-the-box; supports smooth multi-key rotation for private enterprise registries;
  • CycloneDX 1.5 SBOM: Generate comprehensive software bills of materials via doctor --sbom, fully compatible with Dependency-Track, Snyk, and Trivy;
  • Local Audit Logs: Operations are recorded automatically in .brutx/audit.log.

TIP

Explore Comprehensive Supply Chain Security
For cryptographic signature details, enterprise private key management, CycloneDX 1.5 specifications, and security audits, read our dedicated Supply Chain Security & Compliance Guide.


Error Codes & Troubleshooting Reference ​

When an operation fails, the CLI provides standardized error codes with actionable guidance:

Error CodeRoot CauseRecommended Action
CONFIG_NOT_FOUNDMissing components.json fileRun brutx-vue init in your project root
CONFIG_INVALIDMalformed or invalid components.jsonRun brutx-vue doctor --fix to repair configuration
COMPONENT_NOT_FOUNDComponent name not found in registryCheck spelling or run brutx-vue list to see available items
REGISTRY_FETCH_FAILEDCannot reach remote registryVerify network connectivity or specify mirror with --registry
REGISTRY_OFFLINE_UNAVAILABLEComponent is missing from cache in offline modeRun online once to warm up cache or disable --offline
REGISTRY_SIGNATURE_INVALIDManifest signature failed trusted key validationPossible tampering or mismatched key; verify BRUTX_REGISTRY_PUBLIC_KEYS
REGISTRY_INTEGRITY_FAILEDManifest canonical hash check mismatchRefetch with --no-cache or rebuild custom registry
REGISTRY_VERSION_UNSUPPORTED@version used with non-raw registry URLRemove @version or point --registry to a GitHub raw URL
PATH_UNSAFETarget path contains directory traversalCheck path aliases in components.json to ensure paths stay inside project
WRITE_FAILEDFile system write operation failedCheck target directory write permissions and ensure files are unlocked
DOCTOR_FAILEDDoctor check failed --fail-on criteriaReview terminal diagnostic output and run doctor --fix

Brute force builds.