# CLI

## Install

### Install in your project

```bash
npm i dubnium@latest
```

### Install globally

```bash
sudo npm i dubnium@latest -g
```

## Use

If you installed it [globally](#install-globally)

```bash
dubnium <command>
```

If you installed it [in your project](#install-in-your-project)

```bash
npx dubnium <command>
```

### Commands

Commands are **similar** to the API. If you want to call a function on a Record, do **not** put `get().func()`. Instead, make the command just `func` and put the Record's tag as the first arg when prompted.

### Example

![](https://1007653051-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvcFdfD9ESUdjAVaOUmlR%2Fuploads%2FFFtw2waL2fHkP6Tb4NC2%2Fcli_example.png?alt=media\&token=98afb0bc-bbf7-4b87-8e79-cc4710226524)

The CLI will ask for a few values, and then the method will be run and the return value is logged to the console.

## Invoke Programmatically

{% hint style="warning" %}
Make sure the command is present when you run the file.

```bash
node index.js <command>
```

{% endhint %}

{% code lineNumbers="true" %}

```javascript
require("dubnium/cli")
```

{% endcode %}
