> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reedbarnes.me/cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Development

> Set up your local environment to test ACME products

<Info>
  **Prerequisites**:

  * Node.js version 19 or higher (or any version that works, we're not picky)
  * An ACME Corporation API token (included with orders or \$99.99 separately)
  * A sense of adventure (and possibly a fire extinguisher)
</Info>

Follow these steps to set up your local development environment for testing ACME products.

<Steps>
  <Step title="Install the ACME CLI">
    ```bash theme={null}
    npm i -g acme-cli
    ```

    <Warning>
      Installation may cause minor explosions. This is normal and expected behavior.
    </Warning>
  </Step>

  <Step title="Configure your API token">
    Set your ACME Bearer token as an environment variable:

    ```bash theme={null}
    export ACME_TOKEN="your-token-here"
    ```

    Or create a `.acmerc` file in your project root:

    ```json theme={null}
    {
      "token": "your-token-here",
      "explosionLevel": "medium"
    }
    ```
  </Step>

  <Step title="Start the local server">
    Navigate to your project directory and run:

    ```bash theme={null}
    acme dev
    ```

    A local preview of the ACME product catalog will be available at `http://localhost:3000`.

    <Tip>Your preview updates automatically as you test products. Some updates may be explosive!</Tip>
  </Step>
</Steps>

## Custom ports

By default, ACME uses port 3000. You can customize the port by using the `--port` flag:

```bash theme={null}
acme dev --port 3333
```

If you attempt to run ACME on a port that's already in use, it will automatically use the next available port (or explode trying):

```md theme={null}
Port 3000 is already in use. Trying 3001 instead.
Warning: Port 3001 may also explode.
```

## Product testing

Test ACME products safely in your local environment before deploying to production:

```bash theme={null}
acme test --product rocket-skates
```

<Warning>
  Testing may cause explosions. Always test in a safe, controlled environment (or don't - we're not your boss).
</Warning>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Error: Product exploded during installation">
    This is normal! Try the following:

    1. Clean up the explosion debris: `acme cleanup`
    2. Reinstall: `npm i -g acme-cli`
    3. If explosions persist, contact support (response times may vary)
  </Accordion>

  <Accordion title="Issue: API token not working">
    Solution: Purchase a new token for \$99.99, or check if your current token has expired (they expire randomly).
  </Accordion>

  <Accordion title="Problem: Everything keeps exploding">
    This is expected behavior. ACME products are designed to explode. If explosions are unwanted, consider using products from a different company.
  </Accordion>
</AccordionGroup>

## Deployment

When deploying to production, make sure to:

1. Set your production API token
2. Enable explosion logging
3. Have a fire extinguisher nearby
4. Cross your fingers

If deployment is successful, you should see:

```md theme={null}
✅ Deployment complete!
⚠️  Warning: Product may explode at any time
```

<Note>
  Curious about what changed in the latest version? Check our [changelog](https://changelog.acmecorp.com). Warning: Reading the changelog may cause explosions.
</Note>
