Skip to content

FastAPI Admin CLI

A Django-inspired CLI tool for managing FastAPI applications with a modular structure and best practices.

  • 🚀 Project scaffolding with batteries included
  • 📦 Modular app structure like Django
  • 🐳 Built-in Docker integration
  • 🔄 Database migrations with Alembic
  • 🔐 Authentication with FastAPI-Users
  • 👤 Admin panel with SQLAdmin

Quick Install

pip install fastapi-admin-cli

Available Commands

Command Description
startproject Create a new FastAPI project
startapp Create a new app within the project
docker build Build Docker containers
docker run Run Docker containers
docker down Stop and remove containers
docker cmd "command" Run custom docker-compose commands
db makemigrations Create database migrations
db migrate Apply migrations (using alembic)
db shell Open API container shell
createsuperuser Create admin user
shell Launch container shell

Quick Start

  1. Create a new project:

    fastapi-admin startproject myproject
    cd myproject
    

  2. Set up environment:

    cp env.txt .env
    

  3. Launch with Docker:

    fastapi-admin docker build
    fastapi-admin docker run
    

  4. Create migrations:

    fastapi-admin db makemigrations
    fastapi-admin db migrate 
    

  5. Create admin user:

    fastapi-admin createsuperuser admin@example.com password123
    

See the Quick Start Guide for more details.

Documentation

License

MIT License - see LICENSE