Skip to content

The Unforge Command

The unforge command is a key feature of Flareforge that provides an “escape hatch” from the framework’s conventions. It allows you to eject a framework-managed file such as a UI block or a translation namespace into your project’s source code.

Once unforged, you own that file completely and can modify it without limitation.

When your application requires a UI customization that goes beyond what the standard Flareforge blocks offer, you can unforge a block to take direct control of its code.

To see a list of all UI blocks that can be unforged, run the --list (or -l) flag.

Terminal window
npx flareforge unforge block --list

This will display an output similar to the following:

╭──────Available Blocks (24)────────╮
│ │
│ ▸ assets/list │
│ ▸ assets/upload │
│ ▸ buttons/button-request-change │
│ ▸ buttons/button-retry │
│ ▸ buttons/delete-task │
│ ▸ card-header-refresh │
│ ▸ credit-counter │
│ ▸ invoices/list │
│ ▸ login-form │
│ ▸ marketing/cta │
│ ▸ marketing/faq │
│ ▸ marketing/footer │
│ ... and more │
│ │
╰───────────────────────────────────╯

To unforge a specific block, use its path from the list.

Terminal window
npx flareforge unforge block marketing/hero

This command performs the following action:

  • It copies the source code of the marketing/hero block from the flareforge UI library into a new file at app/blocks/marketing/hero.tsx in your project.
  • The Flareforge code generator will automatically detect this new file and update all imports to point to your local version instead of the default framework version.

You can now edit app/blocks/marketing/hero.tsx directly.

If you have already unforged a block and want to reset it to the framework’s default version, you can use the --force flag.

Terminal window
npx flareforge unforge block marketing/hero --force

To customize text and translations, you can unforge i18n (internationalization) namespaces.

This ejects the default English JSON translation file into a editable TypeScript file within your locales/ directory.

To see a list of all available i18n namespaces, run the —list (or -l) flag.

Terminal window
npx flareforge unforge locale --list

This will display the list of namespaces you can customize:

╭─Available i18n Namespaces (7)───╮
│ │
│ ▸ site │
│ ▸ pricing │
│ ▸ marketing │
│ ▸ login │
│ ▸ dashboard │
│ ▸ plans │
│ ▸ task_fields │
│ │
╰─────────────────────────────────╯

To unforge a namespace for a specific language, provide the locale code (e.g., fr, es) and the namespace name.

Terminal window
npx flareforge unforge locale fr dashboard

This command creates a new file at locales/fr/dashboard.ts. The file will contain the default English text, typed to match the original, ready for you to translate into French.

If you omit the namespace, the command will unforge all available namespaces for the specified locale.

Terminal window
npx flareforge unforge locale en