npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

lucide-cli

v0.0.11

Published

A CLI tool to fetch Lucide icons from GitHub raw files and save it directly to your working directory.

Downloads

270

Readme

lucide-cli

npm version npm downloads Install Size GitHub GitHub issues GitHub pull requests

A CLI tool to fetch Lucide icons from GitHub raw files and save it directly to your working directory.

This CLI tool is inspired by and based on Lucide icons.
It uses the raw files from the lucide/icons folder to fetch the icons.

Information

This CLI tool currently supports React framework only.
New features and frameworks will be added in due time.
Support for both TypeScript and JavaScript is available.

Initialization

  1. Initial the tool to your project by running the following command:

    npx lucide-cli init

    This will also install the tool automatically, if not installed previously.

  2. You will be asked to select the framework you are using.

    ℹ Welcome to Lucide CLI - <0.0.0> #current version
    ? Select the framework you are using: (Use arrow keys)
    ❯ React

    Currently, only React is supported.

  3. Next, you will be asked whether you are using TypeScript or not.

    ? Are you using TypeScript? (Use arrow keys)
    ❯ Yes
      No
  4. After this, you will be asked to provide the directory where you want to save the icons.

    ? Where do you want to save the icons? (src/components/lucide)

    The default directory is src/components/lucide.

  5. Next, you will be asked to provide the default size and stroke width for the icons.

    ? Default size for the icons: (24)
    ? Default stroke width for the icons: (2)

    The default size is 24 and the default stroke width is 2.

  6. After providing the directory, the tool will initialize the configuration and save it to the lucide.config.json file.

    ✔ Configuration file created successfully
    ✔ Icon directory created successfully
    ✔ TypeScript definitions file created successfully
    ✔ Lucide CLI has been successfully initialized
  7. That's it.

    Now you can start adding the icons to your project.

    npx lucide-cli add <icon-names...>

Usage

Add Icon

To add an icon to your project, run the following command:

npx lucide-cli add <icon-names...>

# Example
npx lucide-cli add activity
npx lucide-cli add plus

# You can also add multiple icons at once:
npx lucide-cli add activity plus

Remove Icon

To remove an icon from your project, run the following command:

npx lucide-cli remove <icon-names...>

# Example
npx lucide-cli remove activity
npx lucide-cli remove plus

# You can also remove multiple icons at once:
npx lucide-cli remove activity plus

List Icons

To list all the icons which are already added to your project, run the following command:

npx lucide-cli list

# ⠋ Looking for icons...
# ℹ - activity
# ℹ - plus
# ✔ Found 2 icons in your project

Update Icon

To update the icon, to match the latest configuration file, run the following command:

npx lucide-cli update


Adding icon will always use the latest configuration file.
So you can also update specific icons by adding them again.

npx lucide-cli add <icon-names...>

TypeScript Definitions

If you selected TypeScript, the tool will automatically create a TypeScript definitions file for you in the directory you provided with the name .lucide.d.ts.
All the icons added with TypeScript will use type definitions from this file.

Configuration

You can change your project configuration by editing the lucide.config.json file.

Or you can re-initialize the configuration by running the following command:

npx lucide-cli init

Configuration Options

{
	"framework": "React",
	"typescript": false,
	"iconsDirectory": "src/components/lucide",
	"defaultSize": 24,
	"defaultStrokeWidth": 2
}

Always update icons after changing the configuration.

npx lucide-cli update

If you change the directory, the tool will not remove the icons from the previous directory. You have to remove them manually.

CLI

You can also use the CLI command to get the configuration details.

npx lucide-cli config

Aliases

You can also use aliases for all the commands.

npx lucide-cli a <icon-names...> # Add Icon
npx lucide-cli i <icon-names...> # Add Icon
npx lucide-cli install <icon-names...> # Add Icon

npx lucide-cli r <icon-names...> # Remove Icon
npx lucide-cli rm <icon-names...> # Remove Icon
npx lucide-cli remove <icon-names...> # Remove Icon
npx lucide-cli d <icon-names...> # Remove Icon
npx lucide-cli del <icon-names...> # Remove Icon
npx lucide-cli delete <icon-names...> # Remove Icon

npx lucide-cli l # List Icons
npx lucide-cli ls # List Icons

npx lucide-cli u # Update Icons
npx lucide-cli up # Update Icons
npx lucide-cli upgrade # Update Icons
npx lucide-cli refresh # Update Icons

npx lucide-cli c # Configuration

Test Configuration & Server Connection

You can test the configuration and server connection by running the following command:

npx lucide-cli test

License

This project is licensed under the MIT License - see the LICENSE file for details.

Original Lucide Icon Library is licensed under the ISC License - see the LICENSE file for details.