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 openforgeyarn
yarn global add openforgepnpm
pnpm add -g openforgeHomebrew (macOS)
brew install openforgeVerify the installation:
openforge --version
# Output: openforge v2.4.0Requirements
- 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
| Option | Type | Default | Description |
|---|---|---|---|
entry | string | './src/index.js' | Entry point for the build |
output.path | string | './dist' | Output directory |
plugins | array | [] | List of plugins to use |
Usage Examples
Initialize a new project
openforge init my-project
cd my-project
openforge devDevelopment server
openforge dev
# Server running at http://localhost:3000Production build
openforge build
# Output: dist/bundle.js (45kb gzipped)Run with custom config
openforge build --config custom.config.jsAdvanced 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=trueAccess 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.