CLI

CLI for Ferrule, a React Native UI library for iOS, Android and web. init, add, list and check.

The CLI comes with @leoanimesh/ferrule and runs as npx ferrule. Install the package first: without it, npx ferrule looks for an unrelated package named ferrule on npm. The component registry ships inside the package and is read locally, so add works offline and matches your installed version.

Every command takes --cwd <path>, to run it on a project other than the current folder.

npx ferrule --version prints the installed version.

init

npx ferrule init --fix

Writes ferrule.json and a theme file into an existing project, and checks the Reanimated setup. It never overwrites a file.

OptionWhat it does
--dir components/uiWhere components are copied
--palette cobaltThe built-in palette the theme file starts with. For your own, edit the theme file: see Palettes
--fixAdds the Babel plugin, where it can parse your config safely

init and add check the setup and print the exact fix for a missing or mismatched peer.

add

npx ferrule add button input   # those two, and what they depend on
npx ferrule add --all          # every component

Copies components and their dependencies. It keeps your edits unless you pass --overwrite.

A new @leoanimesh/ferrule version changes lib, not your copies, so run add --overwrite for a component to take its fixes, and redo any edits you made.

list

npx ferrule list

Lists the components in the registry.

check

npx ferrule check

Exits 1 in any of these cases, so it fits in CI:

  • primitives such as View and Text come directly from react-native, because then they miss theming and consistency fixes
  • a copied component holds a raw color
  • Reanimated is misconfigured

APIs Ferrule does not cover, such as Linking, stay allowed. check scans with patterns rather than a full parser, so unusual import forms can slip past it.