📖 Documentation

Quick Start

Get up and running with #divisions in under 5 minutes. This guide covers installation, configuration, and your first deployment.

⏱️ 5 min read 🛠️ CLI v2.4+ 🔗 Updated: Oct 2025

Prerequisites

Before you begin, ensure your environment meets the following requirements:

  • Node.js 18.0 or later
  • npm 9+ or pnpm 8+
  • A valid #divisions API key (generate one here)
  • Basic familiarity with terminal commands
💡 Tip Use nvm to manage Node versions easily across different projects. Ensure your default version is set to 18+.

1. Install the CLI

The #divisions CLI is the primary tool for managing projects, deployments, and monitoring. Install it globally using npm:

Terminal
npm install -g @divisions/cli

Verify the installation by checking the version:

Terminal
divisions --version
# Output: 2.4.1

2. Initialize a Project

Create a new project directory and scaffold the default structure. The CLI will prompt you for project metadata:

Terminal
mkdir my-app && cd my-app
divisions init

This generates:

  • divisions.yaml - Core configuration
  • .env.example - Environment template
  • src/ - Application entry point
  • package.json - Dependencies & scripts

3. Configure Environment

Copy the example environment file and add your API key. This step connects your local environment to the #divisions platform:

Terminal
cp .env.example .env
echo "DIVISIONS_API_KEY=your_key_here" >> .env

Edit divisions.yaml to set your runtime preferences:

divisions.yaml
project:
  name: "my-app"
  region: "us-east-1"
  runtime: "nodejs18.x"

deploy:
  env: "production"
  auto_scale: true
  min_instances: 2
⚠️ Important Never commit your .env file to version control. It is already included in .gitignore by default.

4. Deploy & Verify

Run the deploy command. The CLI will bundle your assets, upload them to the edge network, and provision your environment:

Terminal
divisions deploy --env production

# Output:
Building assets...
Uploading to edge nodes...
Provisioning runtime...
Live at: https://my-app.divisions.app

Monitor real-time logs directly from your terminal:

Terminal
divisions logs --follow

Troubleshooting

Common Issues

  • Authentication Failed: Verify your API key has the deploy:write permission scope.
  • Build Timeout: Increase build_timeout in divisions.yaml if your project uses heavy dependencies.
  • Port Conflicts: The dev server uses port 3000 by default. Override with --port 3001.

For advanced debugging, enable verbose logging:

Terminal
divisions deploy --verbose

Next Steps

Your application is now live. Explore these resources to scale your workflow: