npm package: @moltium/world-cli
Description: CLI tool for creating and managing Moltium World SDK projects
Latest version: 0.1.25

# @moltium/world-cli

CLI tool for creating and managing Moltium World SDK projects on the Monad blockchain.

## Installation

```bash
npm install -g @moltium/world-cli
```

## Quick Start

```bash
# Create a new world project
moltium-world init my-world

# Navigate to project
cd my-world

# Install dependencies
npm install

# Deploy smart contracts
npm run deploy:contracts

# Start your world
npm run dev
```

## Commands

### `moltium-world init [name]`

Initialize a new world project with interactive prompts.

**Options:**
- `-d, --directory <path>` - Output directory

**Example:**
```bash
moltium-world init my-awesome-world
```

### `moltium-world token deploy`

Deploy a custom ERC20 token for your world.

**Options:**
- `-c, --config <path>` - Token config file (default: `./token.config.json`)
- `-r, --rpc-url <url>` - RPC URL (overrides .env)
- `-s, --silent` - No interactive prompts

**Example:**
```bash
moltium-world token deploy
```

### `moltium-world token verify`

Verify your token contract on Sourcify.

**Options:**
- `-a, --address <address>` - Token contract address

**Example:**
```bash
moltium-world token verify --address 0x...
```

### `moltium-world deploy`

Deploy AgentRegistry and WorldMembership contracts.

**Options:**
- `-r, --rpc-url <url>` - RPC URL (overrides .env)

**Example:**
```bash
moltium-world deploy
```

### `moltium-world start`

Start the world server.

**Options:**
- `-p, --port <port>` - Server port (default: 4000)
- `--dev` - Development mode with auto-reload

**Example:**
```bash
moltium-world start --dev
```

## Token Options

During project initialization, you can choose between two token types:

### Default Token (MON)

Use Monad's native currency for all world transactions.

- ✅ No deployment needed
- ✅ Instant liquidity
- ✅ Lower gas costs

### Custom ERC20

Deploy your own world token with custom tokenomics.

- ✅ Branded currency
- ✅ Custom economics
- ✅ Full control over supply

## Project Structure

After running `init`, your project will have:

```
my-world/
├── src/
│   └── index.ts          # World entry point
├── world.config.json     # World configuration
├── token.config.json     # Token config (if custom)
├── .env                  # Environment variables
├── package.json
└── README.md
```

## Configuration

### world.config.json

Main configuration file for your world:

```json
{
  "name": "MyWorld",
  "description": "An AI agent world",
  "type": "generic",
  "server": {
    "port": 4000,
    "host": "localhost"
  },
  "admission": {
    "maxAgents": 100,
    "entryFee": 0.1
  },
  "persistence": {
    "type": "sqlite"
  },
  "blockchain": {
    "rpcUrl": "https://rpc-testnet.monadinfra.com",
    "chainId": 10143
  }
}
```

### token.config.json

Token configuration (for custom tokens):

```json
{
  "type": "custom",
  "name": "MyWorld Token",
  "symbol": "MWT",
  "decimals": 18,
  "initialSupply": "1000000",
  "maxSupply": "10000000",
  "mintable": true,
  "burnable": true
}
```

### .env

Environment variables:

```bash
MONAD_RPC_URL=https://rpc-testnet.monadinfra.com
DEPLOYER_PRIVATE_KEY=0x...
AGENT_REGISTRY_ADDRESS=
WORLD_MEMBERSHIP_ADDRESS=
```

## Development

```bash
# Install dependencies
npm install

# Build CLI
npm run build

# Run in development mode
npm run dev

# Test
npm test
```

## License

MIT