> For the complete documentation index, see [llms.txt](https://inttter.gitbook.io/mdbcli/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://inttter.gitbook.io/mdbcli/commands/add.md).

# Add

**Arguments:** `[category] [badgeName] [filePath]`

This command allows you to add a badge to a file.

For example, if you want to add the Discord badge to your `README.md` file, run this command in the same directory as that file:

```sh
mdb add social discord README.md
```

In the file, your badge will appear on the next available line. You can also change the place of it manually, if you'd like.

<figure><img src="/files/JCTZaGlMpZHoRrQUySYD" alt=""><figcaption><p>An example of a badge added to the README.md file of the mdbadges-cli project.</p></figcaption></figure>

{% hint style="info" %}
If you would like to customize the style the badge uses, add `&style=(style here)` to the end of the link. A list of styles can be seen [here](https://docs.mdbcli.xyz/commands/finding-a-badge#style-s).
{% endhint %}

***

### **Adding badges to subdirectories**

If the file you're trying to add the badge to is in a **subdirectory** (or a different location), you will have to specify the path to the subdirectory or location from where you are running the command.

For this example, we'll use a **subdirectory**.

If you had this project structure:

```bash
example-project
├── src
│   └── index.js
├── scripts
│   ├── README.md << # this is the file in the subdirectory 'scripts'
│   ├── update.js
│   ├── api.js
├── package.json
├── # other files...
```

then in the `[filePath]` argument, you would need to specify the subdirectory.&#x20;

For the purpose of this explanation, let's say you were currently at `example-project` within your terminal. If you wanted to add a badge to the README file in this tree, then in the `[filePath]` argument you'll need to type `scripts/README.md` to add the badge to that file.

## Additional Options

### `--html`

<mark style="color:yellow;">**Function**</mark>: Adds the HTML version of a badge to a file.

You can also add the HTML version of the badge you specify to a file. For example, if you wanted to add the **Discord** badge to your `index.html` file, you can run:

```sh
mdb add social discord index.html --html
```

This will add the following on a new line in the file:

```html
<img src="https://img.shields.io/badge/Discord-%235865F2.svg?&logo=discord&logoColor=white" alt="Discord">
```
