# MNEE CLI

The MNEE CLI tool is a command-line interface for managing MNEE tokens and wallets. It provides a secure way to create, manage, and interact with MNEE wallets across different environments.

The open source repo can be [found here](https://github.com/mnee-xyz/mnee-cli).

### Installation

```bash
npm install -g @mnee/cli
```

### Available Commands

#### Create a New Wallet

```bash
mnee create
```

Creates a new wallet with the following features:

* Generates a new private key
* Securely stores the encrypted key
* Allows naming the wallet
* Supports both production and sandbox environments
* Sets up password protection

#### View Wallet Address

```bash
mnee address
```

Displays the address of your currently active wallet.

#### Check Balance

```bash
mnee balance
```

Shows the current MNEE balance of your active wallet.

#### View Transaction History

```bash
mnee history
```

Displays the transaction history for your active wallet.Options:

* -u, --unconfirmed: Show only unconfirmed transactions
* -f, --fresh: Clear cache and fetch fresh history from the beginning

#### Transfer MNEE

```bash
mnee transfer
```

Initiates a transfer of MNEE tokens to another address. The command will:

1. Prompt for the recipient's address
2. Ask for the amount to transfer
3. Request your wallet password for security
4. Execute the transfer and provide a transaction ID

#### Export Private Key

```bash
mnee export
```

Exports your wallet's private key in WIF format. This command:

* Requires your wallet password
* Includes a security confirmation step
* Displays the key in a secure format

#### Delete a Wallet

```bash
mnee delete <walletName>
```

Deletes a specified wallet. Features:

* Requires password confirmation
* Automatically switches to another wallet if available
* Cannot be undone

#### List Wallets

```bash
mnee list
```

Shows all your wallets and allows you to:

* View all wallet names and addresses
* See which wallet is currently active
* Switch between wallets

#### Rename a Wallet

```bash
mnee rename <oldName> <newName>
```

Renames an existing wallet. The new name must:

* Be between 1-50 characters
* Contain only letters, numbers, hyphens, and underscores
* Not contain spaces
* Be unique among your wallets

#### Import Existing Wallet

```bash
mnee import
```

Imports an existing wallet using a WIF private key. The process:

1. Prompts for the WIF key
2. Allows setting a new name
3. Requires password creation
4. Encrypts and stores the key securely

### Authentication & Developer Portal

#### Login

```bash
mnee login
```

Authenticate with the MNEE Developer Portal

#### Logout

```bash
mnee logout
```

Sign out of the MNEE Developer Portal

#### Who Am I?

```bash
mnee whoami
```

Show current authenticated user information

#### Faucet

```bash
mnee faucet
```

Request sandbox tokens (requires authentication)

{% hint style="warning" %}
The faucet command is only available in the sandbox environment
{% endhint %}

{% hint style="info" %}
You can also use -a \<address> or --address \<address> to specify a specific deposit address
{% endhint %}

***

### Environment Support

The CLI supports two environments:

* Production: For real MNEE tokens
* Sandbox: For testing purposes

### Security Features

* All private keys are encrypted before storage
* Password protection for sensitive operations
* Secure key storage using system keychain
* Confirmation prompts for dangerous operations

### Best Practices

1. Always keep your password secure
2. Regularly backup your wallet information
3. Use the sandbox environment for testing
4. Never share your private key or password
5. Use strong, unique passwords for each wallet

### Error Handling

The CLI includes comprehensive error handling for:

* Invalid commands
* Network issues
* Authentication failures
* Invalid inputs
* Duplicate wallet names
* Incorrect passwords


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mnee.io/dev-tools/mnee-cli.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
