The official command-line tool for the Construct Framework.
Construct is a modern full-stack framework combining Vue 3 (frontend) and Base Go (backend) into one cohesive system.
curl -fsSL https://raw.githubusercontent.com/construct-base/cli/refs/heads/main/install.sh | bash
This will:
- Download the latest CLI binary for your platform
- Install to
~/.base/bin/construct
- Add to your PATH automatically
Download the binary for your platform from the latest release:
macOS (Apple Silicon):
curl -L https://github.com/construct-base/cli/releases/latest/download/construct-darwin-arm64.tar.gz | tar xz
mkdir -p ~/.base/bin
mv construct-darwin-arm64 ~/.base/bin/construct
chmod +x ~/.base/bin/construct
echo 'export PATH="$HOME/.base/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
macOS (Intel):
curl -L https://github.com/construct-base/cli/releases/latest/download/construct-darwin-amd64.tar.gz | tar xz
mkdir -p ~/.base/bin
mv construct-darwin-amd64 ~/.base/bin/construct
chmod +x ~/.base/bin/construct
echo 'export PATH="$HOME/.base/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Linux (amd64):
curl -L https://github.com/construct-base/cli/releases/latest/download/construct-linux-amd64.tar.gz | tar xz
mkdir -p ~/.base/bin
mv construct-linux-amd64 ~/.base/bin/construct
chmod +x ~/.base/bin/construct
echo 'export PATH="$HOME/.base/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
git clone https://github.com/construct-base/cli.git
cd cli
go build -o construct main.go
mv construct ~/.base/bin/
# Create a new project
construct new my-blog
# Navigate to project
cd my-blog
# Generate a CRUD structure
construct g Post title:string content:text published:bool
# Start development servers
construct dev
Create a new Construct project by downloading the latest framework.
construct new my-app
Aliases: g
, gen
Generate full-stack CRUD scaffolding (Go backend + Vue frontend).
# Basic structure
construct g Post title:string content:text published:bool
# With relationships
construct g Article title:string category_id:uint author_id:uint
# All field types
construct g Product name:string price:float stock:uint featured:bool
Supported field types:
string
,text
- Text fieldsint
,uint
- Integer fieldsfloat
,float64
- Decimal fieldsbool
,boolean
- Boolean fieldsdate
,datetime
,time
- Date/time fields
What gets generated:
- Backend (
api/{resource}/
): service.go, controller.go, module.go, validator.go - Model (
app/models/
): {resource}.go - Frontend (
vue/structures/{resource}/
): index.vue, composable.ts, types.ts - Auto-registration: Module added to
api/init.go
Start development servers for both Go (port 8100) and Vue (port 3100).
construct dev
Build the application for production. Creates a dist/
directory with:
- Compiled Go binary
- Built Vue SPA
- Runtime directories (storage/, logs/)
construct build
Start the production server from the dist/
directory.
construct start
Construct uses HMVC (Hierarchical Model-View-Controller) on both sides:
Backend (Go):
api/{resource}/
├── service.go # Business logic
├── controller.go # HTTP handlers
├── module.go # Module registration
└── validator.go # Input validation
Frontend (Vue):
vue/structures/{resource}/
├── index.vue # Main page with CRUD
├── composable.ts # API integration
└── types.ts # TypeScript types
# 1. Create project
construct new blog
# 2. Navigate to project
cd blog
# 3. Generate blog post structure
construct g Post title:string content:text published:bool category_id:uint
# 4. Generate category structure
construct g Category name:string description:text
# 5. Start development
construct dev
# 6. Visit http://localhost:3100
# - Frontend: Vue dev server
# - Backend API: http://localhost:8100/api
construct --version
# Clone the repository
git clone https://github.com/construct-base/cli.git
cd cli
# Install dependencies
go mod download
# Build
go build -o construct main.go
# Test
./construct --help
- construct-core - The Construct framework itself
- Documentation - Full documentation
MIT