@icon-forge/cli
v0.1.0
Published
CLI for installing published Icon Forge icon packs.
Downloads
23
Readme
@icon-forge/cli
Install published Icon Forge icon packs into your project.
Usage
npx @icon-forge/cli install <org>/<project>/<pack> --framework react
npx @icon-forge/cli install <org>/<project>/<pack> --framework vueOptions
| Option | Description |
|--------|-------------|
| --framework <react\|vue> | Target framework (required on first install) |
| --output-dir <path> | Base output directory (default: src/components/icons) |
| --dir-name <name> | Override the pack leaf directory name. |
| --api-url <url> | Backend URL (default: build-time value, https://iconforge.ai by default) |
| -h, --help | Show help |
| -v, --version | Show version |
How It Works
- Resolves the latest published release for the specified icon pack
- Downloads the install manifest and component source files
- Writes components to
{outputDir}/{pack-slug}/by default, or{outputDir}/{custom-name}/when--dir-nameis used - Generates a barrel/index file for convenient imports
- Records install state in
iconforge.jsonandiconforge-lock.json
API URL Resolution
The CLI resolves its backend URL in this order:
--api-url <url>ICONFORGE_API_URL- The build-time default baked into the package (
https://iconforge.aiby default)
To build the CLI with a different baked-in default, set:
ICONFORGE_DEFAULT_API_URL=https://staging.iconforge.ai pnpm --dir cli buildLocal State
The CLI writes two files at your project root:
iconforge.json— User config: framework, output directory, installed packs. Commit this.iconforge-lock.json— Resolved state: version hashes, file list. Commit this for reproducible installs.
Development
cd cli
npm install
npm run build # Build with tsup
npm test # Run tests
npm run typecheck # Type check