@mgzon/cli
v2.0.6
Published
MGZON Command Line Interface - Official CLI tool for MGZON ecommerce platform
Maintainers
Readme
MGZON CLI 🚀
__ __ ____ _____ ___ _ _ ____ _ ___
| \/ | / ___| |__ / / _ \ | \ | | / ___| | | |_ _|
| |\/| | | | _ / / | | | | | \| | | | | | | |
| | | | | |_| | / /_ | |_| | | |\ | | |___ | |___ | |
|_| |_| \____| /____| \___/ |_| \_| \____| |_____| |___|The official Command Line Interface for MGZON App Development Platform
📦 Installation
Option 1: Install via npm (Recommended for developers)
Install globally using npm:
npm install -g @mgzon/cliOr using yarn:
yarn global add @mgzon/cliOr using pnpm:
pnpm add -g @mgzon/cliOption 2: Standalone Executables (No Node.js required)
Download the pre-built executables for your platform:
Linux
# Download and make executable
curl -L https://github.com/Mark-Lasfar/mgzon-cli/releases/download/v1.0.0/mgzon-linux -o mgzon
chmod +x mgzon
sudo mv mgzon /usr/local/bin/macOS
# Download and make executable
curl -L https://github.com/Mark-Lasfar/mgzon-cli/releases/download/v1.0.0/mgzon-macos -o mgzon
chmod +x mgzon
sudo mv mgzon /usr/local/bin/Windows
# Download from releases page and add to PATH
# https://github.com/Mark-Lasfar/mgzon-cli/releases/download/v1.0.0/mgzon-win.exeVerify installation:
mz --version
# or
mgzon --versionOption 3: GUI Application
For users who prefer a graphical interface, download the MGZON GUI app:
- Linux: Download AppImage
- macOS: Download DMG
- Windows: Download EXE
The GUI provides the same functionality as the CLI but with a user-friendly interface.
GUI Features
- Dashboard: Quick access to common actions and system status
- Project Management: Create, open, and manage MGZON projects
- App Management: List, create, and manage your applications
- File Storage: Upload and manage files in MGZON storage
- Settings: Configure authentication, CLI settings, and preferences
- Terminal Output: Real-time command execution feedback
The GUI automatically detects and uses the bundled CLI executable for all operations.
Running the GUI
Linux (AppImage):
chmod +x MGZON.GUI-1.0.0.AppImage
./MGZON.GUI-1.0.0.AppImagemacOS (DMG): Double-click the downloaded DMG file and drag the app to Applications.
Windows (EXE): Double-click the downloaded EXE file to install and run.
🚀 Quick Start
Try the Demo Script
Run the included demo script to see common CLI usage:
# Make sure you're in the project directory
cd mgzon-cli
# Run the demo
./demo.shManual Quick Start
# Create a new MGZON app
mz init my-app --template=nextjs
# Navigate to your app
cd my-app
# Install dependencies
npm install
# Start development server
mz serve
# Deploy to MGZON
mz deploy🔧 Core Commands
🏗️ Project Management
mz init [name]- Create a new MGZON appmz serve- Start local development servermz build- Build your app for productionmz deploy- Deploy app to MGZON cloud
🔐 Authentication
mz login- Login to your MGZON accountmz logout- Logout from current sessionmz whoami- Show current user info
🔑 API Management
mz keys:list- List your API keysmz keys:generate- Generate new API keymz keys:revoke <key-id>- Revoke an API key
📊 App Management
mz apps:list- List your appsmz apps:create <name>- Create new appmz apps:info <app-id>- Show app detailsmz apps:delete <app-id>- Delete an app
📦 Database
mz db:create- Create database schemamz db:migrate- Run database migrationsmz db:seed- Seed database with sample data
📁 File Management
mz storage:upload <file>- Upload file to storagemz storage:list- List storage filesmz storage:delete <file-id>- Delete file
🎨 Templates
Available templates for mz init:
# Next.js template (default)
mz init my-app --template=nextjs
# React template
mz init my-app --template=react
# Vue.js template
mz init my-app --template=vue
# Static site template
mz init my-app --template=static
# E-commerce template
mz init my-app --template=ecommerce⚙️ Configuration
Environment Setup
Create .mgzonrc in your project root:
{
"projectId": "your-project-id",
"apiKey": "your-api-key",
"environment": "development"
}Or use environment variables:
export MGZON_API_KEY="your-api-key"
export MGZON_PROJECT_ID="your-project-id"Global Configuration
# Set default organization
mz config:set organization=my-org
# Set default environment
mz config:set environment=staging
# View all configurations
mz config:list🔌 Plugins
Extend CLI functionality with plugins:
# Install plugin
mz plugins:install @mgzon/plugin-analytics
# List installed plugins
mz plugins:list
# Update plugins
mz plugins:update🐛 Troubleshooting
Common Issues
"Command not found" after installation
# Add npm global bin to PATH export PATH="$PATH:$HOME/.npm-global/bin" # For fish shell: set -U fish_user_paths $HOME/.npm-global/bin $fish_user_pathsAuthentication failed
# Clear authentication cache mz logout mz loginDeployment failed
# Check deployment logs mz logs --deployment=<deployment-id> # View build logs mz logs --build=<build-id>
🛠️ Development
Local Development
# Clone repository
git clone https://github.com/mgzon/mgzon-cli.git
cd mgzon-cli
# Install dependencies
npm install
# Build project
npm run build
# Run demo script
./demo.sh
# Link for local development
npm link
# Run tests
npm test
# Run in development mode
npm run dev -- --helpProject Structure
mgzon-cli/
├── src/
│ ├── commands/ # CLI commands
│ ├── lib/ # Core libraries
│ ├── utils/ # Utility functions
│ ├── types/ # TypeScript types
│ └── index.ts # Entry point
├── dist/ # Compiled output
├── tests/ # Test files
└── docs/ # Documentation📚 Documentation
Complete documentation is available in the docs/ directory:
- Installation Guide - Detailed installation instructions
- User Flow Guide - Step-by-step user workflows
- GUI-Backend Interaction - How the GUI communicates with services
- End-to-End Flow - Complete user journey from installation to execution
- Architecture Diagram - High-level system overview
For privacy and security reasons, implementation details are not exposed in this public repository. The documentation provides comprehensive guidance on usage and architecture without revealing sensitive code.
See our Privacy & Security Implementation Plan for details on our approach to protecting intellectual property and user data.
🤝 Contributing
We welcome contributions! Please see our Contributing Guide.
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -am 'Add new feature' - Push to the branch:
git push origin feature/my-feature - Submit a pull request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
📞 Support
- 📧 Email: [email protected]
- 🐛 Issues: GitHub Issues
- 💬 Discord: Join our community
- 🐦 Twitter: @mgzon_dev
Made with ❤️ by the MGZON Team
