npm package: @nexoraplatform/cli
Description: Nexora Platform CLI Agent - Remote bot management and deployment for Discord bots
Author: Nexora Team
Latest version: 1.11.0

# Nexora CLI

> 🚀 **Enterprise-grade CLI Agent for Remote Discord Bot Management**

Nexora CLI is a secure, production-ready command-line tool that acts as a local agent for the Nexora Platform. It enables seamless remote management, deployment, and monitoring of Discord bots through an intuitive terminal interface.

## ✨ Features

- 🔐 **Secure Authentication** - Agent key-based authentication with AES-256 encryption
- 🤖 **Remote Bot Management** - Start, stop, and monitor bots from anywhere
- 📊 **Real-time Monitoring** - Live status, logs, and metrics streaming
- 🔄 **Bi-directional Sync** - Automatic synchronization with web dashboard
- 🌐 **Multi-Environment** - Support for dev, staging, and production environments
- 📝 **Audit Trail** - Complete command history and activity logging

## 📦 Installation

```bash
# Global installation (recommended)
npm install -g @nexora/cli

# Or using yarn
yarn global add @nexora/cli

# Or using pnpm
pnpm add -g @nexora/cli
```

## 🚀 Quick Start

### 1. Initialize Configuration

```bash
nexora init
```

### 2. Login with Agent Key

Generate an Agent Key from your Nexora Dashboard, then:

```bash
nexora login --key nxk_your_agent_key_here
```

Or set environment variables:

```bash
export NEXORA_AGENT_KEY="nxk_your_agent_key_here"
export NEXORA_API_URL="https://api.nexora.io"
nexora login
```

### 3. Check Status

```bash
nexora status
```

### 4. Start a Bot

```bash
nexora start <botId>
```

## 📖 Commands

| Command | Description |
|---------|-------------|
| `nexora init` | Initialize CLI configuration |
| `nexora login` | Authenticate with Nexora Platform |
| `nexora status` | Show agent and bot status |
| `nexora start <botId>` | Start a bot |
| `nexora stop <botId>` | Stop a bot |
| `nexora logs <botId>` | View bot logs (live streaming with `-f`) |
| `nexora logout` | Remove local credentials |
| `nexora --version` | Display CLI version |
| `nexora --help` | Show help information |

## 🔧 Configuration

Configuration is stored at `~/.nexora/config.json`:

```json
{
  "agentKey": "nxk_***",
  "apiUrl": "https://api.nexora.io",
  "agentId": "agent_123",
  "organizationId": "org_456"
}
```

## 🌍 Environment Variables

- `NEXORA_AGENT_KEY` - Your agent authentication key
- `NEXORA_API_URL` - API endpoint (default: `http://localhost:3001`)

## 🛡️ Security

- Agent keys are stored with 0600 permissions (owner read/write only)
- All API communication uses HTTPS in production
- Credentials are encrypted using machine-specific keys
- Automatic token refresh with short-lived session tokens

## 📊 Example Usage

### View Live Logs

```bash
nexora logs bot_abc123 -f
```

### Check Status with JSON Output

```bash
nexora status --json
```

### Force Stop a Bot

```bash
nexora stop bot_abc123 --force
```

## 🤝 Contributing

Contributions are welcome! Please visit our [GitHub repository](https://github.com/nexora/cli) for guidelines.

## 📄 License

MIT © Nexora Team

## 🔗 Links

- 📘 [Documentation](https://docs.nexora.io)
- 🌐 [Website](https://nexora.io)
- 💬 [Discord Community](https://discord.gg/nexora)
- 🐛 [Report Issues](https://github.com/nexora/cli/issues)

---

**Made with ❤️ by the Nexora Team**