@constructive-io/cli
v0.0.3
Published
Platform for schemas, APIs, and application programming
Downloads
231
Maintainers
Readme
constructive — Platform for building Schemas, APIs, and Apps
A unified cloud platform for data, APIs, and application development.
constructive brings together everything teams need to model data, ship APIs, and deploy modern applications. It provides a modular foundation for defining schemas, automating infrastructure, and delivering fast, secure experiences—without the complexity of traditional backend stacks.
✨ Features
- 🧱 Modular Building Blocks — Compose your app from reusable modules for data, logic, storage, and services. Swap, version, and extend components without rewriting your backend.
- 🔄 Automated Schema & API Generation — Define your data and relationships once; get auto-generated APIs, migrations, types, and client code across languages.
- ☁️ Zero-Config Cloud Deployments — Push code, get production. Deploy databases, APIs, functions, and frontends with instant environments and built-in rollout safety.
- 🏗️ Full-Stack Workspaces —
constructive initcreates a complete workspace with data models, API routes, auth, edge functions, and CI/CD already wired together. - 📊 Versioned Infrastructure — Every schema, API, and service change is tracked and versioned, enabling reproducible deployments and safe rollbacks.
- 🌐 Portable by Design — Built on open standards and SQL-first workflows, your app runs anywhere—from the constructive cloud to your own infra.
- 🚀 Optimized Developer Experience — Type-safe SDKs, hot reloading for data and APIs, local-first dev, and zero boilerplate to get from idea → production fast.
🚀 Quick Start
Install & Setup
# Install constructive globally
npm install -g @constructive-io/cli
# Start local Postgres (via Docker) and export env vars
constructive docker start
eval "$(constructive env)"Tip: Already running Postgres? Skip the Docker step and just export your PG* vars.
Create a Workspace and Install a Package
# 1. Create a workspace
constructive init --workspace
cd my-app
# 2. Create your first module
constructive init
cd packages/your-module
# 3. Install a package
constructive install @pgpm/faker
# 4. Deploy everything
constructive deploy --createdb --database mydb1
psql -d mydb1 -c "SELECT faker.city('MI');"
> Ann Arbor🛠️ Commands
Getting Started
constructive init- Initialize a new moduleconstructive init --workspace- Initialize a new workspace
Development Setup
constructive docker start- Start PostgreSQL container (via Docker)constructive docker stop- Stop PostgreSQL containerconstructive env- Print PostgreSQL environment variables for shell export
Database Operations
constructive deploy- Deploy database changes and migrationsconstructive verify- Verify database state matches expected migrationsconstructive revert- Safely revert database changes
Migration Management
constructive migrate- Comprehensive migration managementconstructive migrate init- Initialize migration trackingconstructive migrate status- Check migration statusconstructive migrate list- List all changesconstructive migrate deps- Show change dependencies
Module Management
constructive install- Install database modules as dependenciesconstructive extension- Interactively manage module dependenciesconstructive tag- Version your changes with tags
Packaging and Distribution
constructive plan- Generate deployment plans for your modulesconstructive package- Package your module for distribution
Utilities
constructive add- Add a new database changeconstructive remove- Remove a database changeconstructive export- Export migrations from existing databasesconstructive clear- Clear database stateconstructive kill- Clean up database connectionsconstructive analyze- Analyze database structureconstructive rename- Rename database changesconstructive admin-users- Manage admin users
💡 Common Workflows
Starting a New Project and Adding a Change
# 1. Create workspace
constructive init --workspace
cd my-app
# 2. Create your first module
constructive init
cd packages/new-module
# 3. Add some SQL migrations to sql/ directory
constructive add some_change
# 4. Deploy to database
constructive deploy --createdbWorking with Existing Projects
# 1. Navigate to your module
cd packages/your-module
# 2. Install a package
constructive install @pgpm/faker
# 3. Deploy all installed modules
constructive deploy --createdb --database mydb1
psql -d mydb1 -c "SELECT faker.city('MI');"
> Ann ArborTesting a module in a workspace
# 1. Install workspace dependencies
pnpm install
# 2. Enter the packages/<yourmodule>
cd packages/yourmodule
# 3. Test the module in watch mode
pnpm test:watchDatabase Operations
constructive deploy
Deploy your database changes and migrations.
# Deploy to selected database
constructive deploy
# Create database if it doesn't exist
constructive deploy --createdb
# Deploy specific package to a tag
constructive deploy --package mypackage --to @v1.0.0
# Fast deployment without transactions
constructive deploy --fast --no-txconstructive verify
Verify your database state matches expected migrations.
# Verify current state
constructive verify
# Verify specific package
constructive verify --package mypackageconstructive revert
Safely revert database changes.
# Revert latest changes
constructive revert
# Revert to specific tag
constructive revert --to @v1.0.0Migration Management
constructive migrate
Comprehensive migration management.
# Initialize migration tracking
constructive migrate init
# Check migration status
constructive migrate status
# List all changes
constructive migrate list
# Show change dependencies
constructive migrate depsModule Management
constructive install
Install database modules as dependencies.
# Install single package
constructive install @pgpm/base32
# Install multiple packages
constructive install @pgpm/base32 @pgpm/fakerconstructive extension
Interactively manage module dependencies.
constructive extensionconstructive tag
Version your changes with tags.
# Tag latest change
constructive tag v1.0.0
# Tag with comment
constructive tag v1.0.0 --comment "Initial release"
# Tag specific change
constructive tag v1.1.0 --package mypackage --changeName my-changePackaging and Distribution
constructive plan
Generate deployment plans for your modules.
constructive planconstructive package
Package your module for distribution.
# Package with defaults
constructive package
# Package without deployment plan
constructive package --no-planUtilities
constructive export
Export migrations from existing databases.
constructive exportconstructive kill
Clean up database connections and optionally drop databases.
# Kill connections and drop databases
constructive kill
# Only kill connections
constructive kill --no-drop⚙️ Configuration
Environment Variables
constructive uses standard PostgreSQL environment variables (PGHOST, PGPORT, PGDATABASE, PGUSER, PGPASSWORD).
Quick setup (recommended):
eval "$(constructive env)"Manual setup (if you prefer):
export PGHOST=localhost
export PGPORT=5432
export PGDATABASE=myapp
export PGUSER=postgres
export PGPASSWORD=passwordSupabase local development:
eval "$(constructive env --supabase)"Getting Help
Command Help
# Global help
constructive --help
# Command-specific help
constructive deploy --help
constructive tag -hCommon Options
Most commands support these global options:
--help, -h- Show help information--version, -v- Show version information--cwd <dir>- Set working directory
Credits
🛠 Built by Constructive — if you like our tools, please checkout and contribute to our github ⚛️
Disclaimer
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
