Documentation

Everything you need to get started with OpenForge CLI.

Getting Started

OpenForge CLI is a modern build tool designed for speed and simplicity. This guide will help you get up and running in minutes.

Quick Start

For the impatient: npm install -g openforge && openforge init

Installation

Install OpenForge globally using your preferred package manager:

npm

npm install -g openforge

yarn

yarn global add openforge

pnpm

pnpm add -g openforge

Homebrew (macOS)

brew install openforge

Verify the installation:

openforge --version
# Output: openforge v2.4.0

Requirements

  • Node.js: v18.0.0 or higher
  • Operating System: macOS, Linux, or Windows 10+
  • Memory: 512MB RAM minimum (2GB recommended)
  • Disk Space: 100MB for installation

Configuration

Create an openforge.config.js file in your project root:

// openforge.config.js
export default {
  entry: './src/index.js',
  output: {
    path: './dist',
    filename: 'bundle.js'
  },
  plugins: [],
  optimization: {
    minify: true,
    treeshake: true
  }
}

Configuration Options

OptionTypeDefaultDescription
entrystring'./src/index.js'Entry point for the build
output.pathstring'./dist'Output directory
pluginsarray[]List of plugins to use

Usage Examples

Initialize a new project

openforge init my-project
cd my-project
openforge dev

Development server

openforge dev
# Server running at http://localhost:3000

Production build

openforge build
# Output: dist/bundle.js (45kb gzipped)

Run with custom config

openforge build --config custom.config.js

Advanced Setup

Using Plugins

import react from '@openforge/plugin-react';
import css from '@openforge/plugin-css';

export default {
  plugins: [
    react(),
    css({ modules: true })
  ]
}

Environment Variables

OpenForge automatically loads .env files:

# .env
API_URL=https://api.example.com
DEBUG=true

Access in your code:

const apiUrl = process.env.API_URL;

Monorepo Support

// openforge.config.js
export default {
  workspaces: ['packages/*'],
  hoisting: true
}

Upgrade Notes

Upgrading from v1.x

v2.0 includes breaking changes. See the migration guide for details.

v2.4.0 (Current)

  • Added workspace support for monorepos
  • Improved plugin API
  • Fixed memory leak in watch mode

v2.3.0

  • Added CSS modules support
  • Performance improvements

FAQ

How do I report a bug?

Open an issue on GitHub Issues with reproduction steps.

Is OpenForge production-ready?

Yes! OpenForge is used by thousands of projects in production, including several Fortune 500 companies.

How do I contribute?

Check our Community page for contribution guidelines.

Need more?

Check out the full API reference on GitHub.

Full Documentation