# drupal-radix-cli

> CLI for managing Radix components in a Drupal theme

Latest version **1.0.8** (published 2025-06-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install drupal-radix-cli
pnpm add drupal-radix-cli
yarn add drupal-radix-cli
bun add drupal-radix-cli
```

Provides the command `drupal-radix-cli`.

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2025-06-10 |
| First published | 2023-11-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 15.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Sohail Lajevardi |
| Maintainers | doxigo |
| Keywords | Drupal, Radix, CLI, theme, components |

## Links

- npm: https://www.npmjs.com/package/drupal-radix-cli
- Repository: https://github.com/doxigo/drupal-radix-cli
- Homepage: https://github.com/doxigo/drupal-radix-cli#readme
- Issues: https://github.com/doxigo/drupal-radix-cli/issues
- npm.io page: https://npm.io/package/drupal-radix-cli

## Dependencies (4)

- [js-yaml](https://npm.io/package/js-yaml.md) ^4.1.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^11.1.1
- [picocolors](https://npm.io/package/picocolors.md) ^1.1.1
- [@clack/prompts](https://npm.io/package/@clack/prompts.md) ^0.11.0

## Alternatives

- [@progress/kendo-ooxml](https://npm.io/package/@progress/kendo-ooxml.md) — 152.1K weekly downloads
- [@progress/kendo-react-ripple](https://npm.io/package/@progress/kendo-react-ripple.md) — 8.0K weekly downloads
- [@progress/kendo-react-orgchart](https://npm.io/package/@progress/kendo-react-orgchart.md) — 4.3K weekly downloads
- [@praxisui/dynamic-fields](https://npm.io/package/@praxisui/dynamic-fields.md) — 2.4K weekly downloads
- [@progress/kendo-vue-listbox](https://npm.io/package/@progress/kendo-vue-listbox.md) — 932 weekly downloads

## Recent versions

- 1.0.8 (latest) — 2025-06-10
- 1.0.7 — 2024-05-04
- 1.0.6 — 2024-05-04
- 1.0.5 — 2024-02-15
- 1.0.4 — 2024-02-15
- 1.0.3 — 2023-11-25
- 1.0.2 — 2023-11-25
- 1.0.1 — 2023-11-25
- 1.0.0 — 2023-11-25

## README

# Radix Drupal CLI

[![NPM](https://img.shields.io/npm/v/drupal-radix-cli.svg)](https://www.npmjs.com/package/drupal-radix-cli)

Radix Drupal CLI is an interactive prompt designed to manage [Drupal Radix 6](https://www.drupal.org/project/radix) components. It allows for easy listing, adding and generating of components to your Drupal theme, leveraging the power of the Radix base theme components.

_Note_: that this CLI uses your own local Radix theme as a source for components. If you want to add components from the latest version of Radix, you must first update your local Radix theme.

## Features

- **List Components**: Display all available Radix components.
- **Add Components**: Add Radix components to your theme, automatically replacing any existing ones. Includes automatic template reference updates.
- **Generate Components**: Generate a new component folder with all the necessary files.
- **Template Reference Updates**: Automatically update `radix:COMPONENTNAME` references to `THEMENAME:COMPONENTNAME` in your template files when adding components.

## Installation

Ensure you have Node.js and npm installed on your system. Install the CLI tool within your subtheme or globally via npm:

```bash
npm install drupal-radix-cli
```

_Note_: You may also install the package globally: `npm install -g drupal-radix-cli`

## Usage

Once installed, you can use the CLI tool with the following commands:

### List Components

To list all Radix components available in the default directory:

```bash
drupal-radix-cli list
```

### Add Components

To add a Radix component to your current theme:

```bash
drupal-radix-cli add
```

Use the `--radix-path` flag to specify a custom Radix components directory if your Radix base theme is installed in a non-standard location:

```bash
drupal-radix-cli add --radix-path ../../radix/components
```

Use the `--no-template` flag to skip automatic template reference updates when adding components:

```bash
drupal-radix-cli add --no-template
```

By default, when adding a component, the CLI will automatically scan your `/templates` directory for `*.html.twig` files and replace any `radix:COMPONENTNAME` references with `THEMENAME:COMPONENTNAME`. Use the `--no-template` flag if you prefer to update these references manually.

### Generate Components

To generate a clean new component folder within your subtheme `components` directory:

```bash
drupal-radix-cli generate
```

This will generate a new component folder with the following files:

- `[component-name]/[component-name].twig`
- `[component-name]/[component-name].component.yml`
- `[component-name]/[component-name].scss`
- `[component-name]/_[component-name].js`
- `[component-name]/README.mdx`

Make sure to remove any unwanted files and update your files accordingly.

## Help

Display usage instructions:

```bash
drupal-radix-cli --help
```

Or simply `drupal-radix-cli`.

## Radix Theme

The Radix theme is a component-base theme for Drupal. For more information, visit the [Radix theme project page on Drupal.org](https://www.drupal.org/project/radix).

## Contributing

Contributions are welcome! Submit pull requests or create issues for any enhancements, bugs, or features.

## License

This project is licensed under the MIT License. See the LICENSE file for more details.

---
_Source: https://npm.io/package/drupal-radix-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
