rmx-cli is a command-line interface tool designed specifically for Remix applications, providing utility functions to enhance development workflows. The current stable version, as of the provided information, is 0.4.16. Its primary feature highlighted is the `svg-sprite` command, which automates the generation of SVG sprite files along with corresponding, fully-typed React components. This command can create either a single default `Icon` component that accepts an `icon` prop, or individual named components for each SVG, based on command-line flags. It also exports the `href` to the sprite file, facilitating its use in Remix's `links` export for preloading. The project appears to be actively maintained, with new features like `svg-sprite` recently introduced, though a fixed release cadence is not explicitly stated. A key differentiator is its tight integration with the Remix ecosystem, including type generation for icon names and components optimized for Remix's server-side rendering and asset linking.
npm install rmx-cliVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates installing `rmx-cli`, generating SVG sprites and React components, and then using them in a Remix route with proper link preloading.
Carefully review the `OUTPUT_PATH` argument and its interaction with the `--sprite` and `--types` flags in the documentation to ensure files are generated where expected.
Decide on your preferred icon usage pattern before running the command. If switching, regenerate the sprites and update all icon imports and usages in your application.
When generating sprites, if you notice icons losing their original colors, re-run the `svg-sprite` command with `--fill=keep` and/or `--stroke=keep`.
Pin `rmx-cli` to exact versions in `package.json` (`"rmx-cli": "0.4.16"`) for production builds, and manually review changes when upgrading to a new version.
Ensure `rmx-cli` is installed as a development dependency: `npm install -D rmx-cli` or `yarn add -D rmx-cli`. Then, execute commands using `npx rmx-cli ...`.
Verify the `OUTPUT_PATH` argument used with `rmx-cli svg-sprite`. Ensure the path in your `import` statement exactly matches the generated file's location (e.g., `app/components/icons/icons.tsx`). Also, check for typos in the path or filename.
If using the default `Icon` component, ensure it's imported (e.g., `import Icon from '...'`) and you pass `icon="name"`. If using named components (e.g., `import { BookmarkIcon } from '...'`), use them directly as `<BookmarkIcon />` without an `icon` prop.No dependency data recorded yet.