The easiest way to add a license file to your project
Tags: node, cli, tooling, ux
Published: 2024-03-10 08:40:36


Adding a license file to your project is a good practice. It helps others understand how they can use your code and what are the limitations. In this article, we will see how to add a license file to your project in the easiest way possible using the `@katistix/license-cli` package.

[View the original blog post on my site](https://blog.paultal.online/blog/easiest-way-to-add-a-license-file-to-your-project)

## What is a license file? 🤔
A license file is a file that contains the terms and conditions for how others can use, modify, and distribute your code. It is a good practice to include a license file in your project, especially if you are planning to share it with others.

## What is `@katistix/license-cli`?
`@katistix/license-cli` is a command-line tool that I built using `Node.js` and `Typescript` that helps you add a license file to your project in the easiest way possible. It is a simple and easy-to-use tool that can be used to add a license file to your project in just a few seconds.

For more information, you can check out the official GitHub repository: [katistix/license-cli](https://github.com/katistix/license-cli).

## What licenses are supported right now?
As of the time of writing this article, `@katistix/license-cli` supports the following licenses:
- MIT
- Apache 2.0
- GNU GPLv3
- The Unlicense

With more licenses like `BSD 3-Clause`, `BSD 2-Clause`, `Mozilla Public License 2.0`, `GNU LGPLv3` and many more to be added in the future.

You can see an up-to-date list of supported licenses on the [official GitHub repository](https://github.com/katistix/license-cli/tree/main/licenses).

## How to use `@katistix/license-cli`?

### Prerequisites
Before you begin, you need to have `Node.js` and `npm` or `yarn` installed on your system. If you don't have them installed, you can download and install them from the official website: [Node.js](https://nodejs.org/).

### Step 1: Install the package
You can install the package using `npm` or `yarn`:
```bash
npm install -g @katistix/license-cli

# or

yarn global add @katistix/license-cli
```

This will automatically install the package globally on your system.

### Step 2: Add a license file to your project
Open your terminal and navigate to the root directory of your project. Then run the following command:
```bash
license <license_type>
```

Replace `<license_type>` with the type of license you want to add to your project. For example, if you want to add the MIT license, you can run:
```bash
license mit
```

This will create a `LICENSE` file in the root directory of your project with the MIT license text.

### Step 3: Done!

That's it! You have successfully added a license file to your project using `@katistix/license-cli`. You can now share your project with others, and they will know how they can use your code.

## 💖 Support my projects

I love open source and I love programming. If you want to show your appreciation for my work, consider supporting me on the following platforms. This way I can continue to create awesome projects and share them with everyone. Thank you! :heart:

[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png)](https://www.buymeacoffee.com/katistix)
[![Patreon](https://img.shields.io/badge/Patreon-F96854?style=for-the-badge&logo=patreon&logoColor=white)](https://patreon.com/katistix)
[![Ko-Fi](https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge&logo=ko-fi&logoColor=white)](https://ko-fi.com/G2G5R30KO)