oxidite-cli
Command-line interface for the Oxidite web framework. Provides tools for project scaffolding, code generation, migrations, and development server management.
Overview
oxidite-cli is the official command-line tool for the Oxidite web framework. It streamlines development workflows by providing commands for project creation, code generation, database migrations, and development server management.
Installation
Install the CLI tool globally:
# Install from crates.io (when published)
# Or install from local source
Features
- Project scaffolding - Create new Oxidite projects with a single command
- Code generation - Generate models, controllers, middleware, and other components
- Migration management - Create, run, and rollback database migrations
- Development server - Hot-reloading development server with file watching
- Interactive setup - Guided project creation with configuration options
- Health checks - Diagnose and troubleshoot common issues
- Asset management - Build and optimize static assets
Usage
Creating a New Project
Generate a new Oxidite project:
# Interactive project creation
# The interactive wizard will guide you through:
# - Project type selection (Fullstack, API, Microservice, Serverless)
# - Database configuration
# - Feature selection
# - Directory structure setup
Development Server
Start the development server with hot reloading:
# Navigate to your project directory
# Start the development server
# The server will watch for file changes and automatically restart
# Available at http://127.0.0.1:8080 by default
Code Generation
Generate common components:
# Generate a model
# Generate a controller
# Generate middleware
# Generate a migration
Database Migrations
Manage your database schema:
# Create a new migration
# Run pending migrations
# Rollback the last migration
# View migration status
Health Checks
Diagnose common issues:
# Run system diagnostics
# This checks:
# - Rust installation
# - Database connectivity
# - Configuration files
# - Dependency versions
# - Common setup issues
Full Command Reference
# Show help
# Project commands
# Development commands
# Code generation
# Database commands
# Utility commands
Project Types
The CLI supports different project types:
- Fullstack Application: Complete setup with templates, static files, and database
- REST API: Optimized for backend services (JSON only)
- Microservice: Minimal setup for specialized services
- Serverless Function: Lightweight event handler
Configuration
The CLI reads configuration from config.toml in your project root:
[]
= "my-app"
= 3000
= "development"
[]
= "sqlite::memory:"
= "./migrations"
[]
= "127.0.0.1"
= 4
= 30
Environment Variables
The CLI respects common environment variables:
# Override the port
OXIDITE_PORT=8080
# Use a different database
DATABASE_URL=postgresql://user:pass@localhost/db
# Set environment
OXIDITE_ENV=production
Integration with Oxidite
The CLI is designed to work seamlessly with Oxidite projects:
- Automatically generates Oxidite-compatible code
- Sets up proper directory structure
- Configures dependencies in Cargo.toml
- Creates appropriate example code
- Sets up development workflow
Troubleshooting
Common issues and solutions:
# If the CLI isn't found after installation
# If you get permission errors
# To update the CLI
License
MIT