Fuma CLI
Fuma CLI is an early-stage command-line interface tool designed to facilitate the creation of custom component libraries, drawing inspiration from the `shadcn/ui` pattern. It aims to provide developers with a framework to build their own `shadcn/ui`-like CLI experience for their projects. Currently at version 0.0.5, the project is undergoing rapid development, as indicated by frequent patch releases. Its primary differentiator is its focus on extensibility, allowing users to define and manage their own UI component collections through a dedicated CLI. The project's current status suggests a focus on core features like component addition and environment detection, with a potential for significant changes as it approaches a stable release, serving as a foundational layer for customizable UI tooling.
Common errors
-
fuma-cli: command not found
cause The `fuma-cli` package is not installed globally or locally in a way that makes its executable accessible in your PATH.fixUse `npx fuma-cli <command>` to execute it without global installation, or install it globally with `npm install -g fuma-cli` (though `npx` is generally preferred for CLIs). -
Error: Cannot find module '@fuma-cli/interactive'
cause While `fuma-cli` is the main package, it appears to have sub-packages like `@fuma-cli/interactive` that it depends on, which might not be correctly installed or resolved in some environments.fixEnsure that all transitive dependencies are correctly installed. Try `npm install` or `yarn install` in your project root. If using `npx`, ensure your `node_modules` is up-to-date. This might also indicate an issue with the package's bundled dependencies.
Warnings
- breaking As a pre-1.0 package (currently 0.0.5), `fuma-cli` is subject to frequent and undocumented breaking changes. API surfaces, configuration formats, and command-line arguments may change without major version bumps.
- gotcha The project description mentions 'Build your own Shadcn CLI', implying that `fuma-cli` itself might be a framework for building other CLIs, rather than a direct replacement for `shadcn/ui`. Users should understand its role as a meta-CLI tool.
- gotcha Lack of comprehensive README and documentation makes understanding advanced features, customization options, and best practices challenging. Many aspects will require inspecting source code or trial-and-error.
Install
-
npm install fuma-cli -
yarn add fuma-cli -
pnpm add fuma-cli
Imports
- fuma
import fuma from 'fuma-cli'
npx fuma-cli
- fuma add
import { add } from 'fuma-cli'npx fuma-cli add <component-name>
Quickstart
npx fuma-cli init my-component-library
cd my-component-library
echo 'console.log("Hello from a new component!");' > src/components/hello-world.js
npx fuma-cli add hello-world --output-path components/ui
# Example of running an interactive prompt (requires @fuma-cli/interactive)
# Note: This is a conceptual demonstration as `fuma-cli add` is likely interactive by default now.
npx fuma-cli add