🚧 v0 · early access — not for production🚧 FastCMS is under active development — not ready for production use. APIs and features may change without notice.
FastCMS
Getting Started

Command Line Interface

Manage FastCMS from the terminal — create users, collections, run migrations, and start the dev server.

Command Line Interface

FastCMS includes a CLI for managing your CMS directly from the terminal. Install it from PyPI and the fastcms command is available globally.

Running the CLI

# Install FastCMS (if not already installed)
uv tool install pyfastcms

# Show all available commands
fastcms --help

Available Commands:

Commands:
  create-admin       Create a new admin user.
  create-collection  Create a new collection.
  create-user        Create a new user.
  delete-collection  Delete a collection by name.
  dev                Start the FastCMS development server.
  info               Display FastCMS system information.
  init               Initialize a new FastCMS project.
  list-collections   List all collections.
  list-users         List all users.
  migrate            Database migration commands.

Quick Start

1. Create Your First Admin User

fastcms create-admin

You'll be prompted for email, password, and name:

$ fastcms create-admin
Email: admin@fastcms.dev
Password:
Repeat for confirmation:
Name: FastCMS Admin

✅ Admin user created successfully!
   Email: admin@fastcms.dev
   Name: FastCMS Admin
   Role: admin
   ID: 9ded1234-bed5-48a4-b0ce-310578dfab8f

2. Create Your First Collection

fastcms create-collection \
  --name products \
  --type base \
  --field title:text \
  --field price:number \
  --field active:bool

3. Check System Information

fastcms info
⚡ FastCMS System Information

  ✓ Database: Connected
  • Users: 1
  • Collections: 1

  • Data directory: /path/to/fastCMS/data
  • Database size: 0.15 MB
  • Backups: 0

User Management

Create Admin User

fastcms create-admin \
  --email admin@example.com \
  --name "John Administrator"
# Password will still be prompted for security

Create Regular User

fastcms create-user \
  --email user@example.com \
  --name "Regular User" \
  --role user

List All Users

fastcms list-users

Collection Management

Create Collection

Field Format: --field field_name:field_type

Available field types: text, number, bool, email, url, date, select, relation, file, json, editor

Example: Blog Posts Collection

fastcms create-collection \
  --name blog_posts \
  --type base \
  --field title:text \
  --field content:editor \
  --field published:bool \
  --field publish_date:date \
  --field author_email:email

Example: Auth Collection

Auth collections automatically include email, password, verified, role, and token_key fields.

fastcms create-collection \
  --name customers \
  --type auth \
  --field company:text \
  --field phone:text

List All Collections

fastcms list-collections

Delete Collection

fastcms delete-collection old_products

Warning: This is irreversible. Deletes the collection metadata, all records, and the database table.

Development Server

fastcms dev

Starts uvicorn with auto-reload enabled. On first run, it checks for admin users and prompts you to create one.

# Custom port and host
fastcms dev --port 8001 --host 127.0.0.1

# Disable auto-reload
fastcms dev --no-reload

# Skip the first-run admin check
fastcms dev --skip-check

Project Initialization

fastcms init my-project --database sqlite

Creates a new project directory with .env, .gitignore, and README.md pre-configured.

OptionDefaultDescription
--databasesqliteDatabase type (sqlite or postgres)
--templateProject template (blog, ecommerce, saas)

Database Migrations

The migrate command wraps Alembic for database schema management.

# Run all pending migrations
fastcms migrate up

# Rollback the last migration
fastcms migrate down

# Show current migration status
fastcms migrate status

# Create a new migration (after model changes)
fastcms migrate create "add_new_field"

CI/CD Integration

.github/workflows/setup.yml:

name: Setup FastCMS

on:
  push:
    branches: [main]

jobs:
  setup:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.13'
      - name: Install uv
        uses: astral-sh/setup-uv@v3
      - name: Install FastCMS
        run: uv tool install pyfastcms
      - name: Run migrations
        run: fastcms migrate up
      - name: Create admin user
        run: |
          fastcms create-admin \
            --email ${{ secrets.ADMIN_EMAIL }} \
            --name "CI Admin"

Docker Entrypoint

#!/bin/bash
set -e

# Run migrations
fastcms migrate up

# Create admin if environment variables are set
if [ -n "$ADMIN_EMAIL" ] && [ -n "$ADMIN_PASSWORD" ]; then
  fastcms create-admin \
    --email "$ADMIN_EMAIL" \
    --name "${ADMIN_NAME:-Admin}"
fi

# Start application
exec fastcms dev --no-reload --host 0.0.0.0 --port 8000

Troubleshooting

ProblemSolution
command not foundEnsure pyfastcms is installed: uv tool install pyfastcms (or pip install pyfastcms inside a venv)
Database connection errorRun fastcms migrate up and check DATABASE_URL in .env
User already existsUse fastcms list-users and pick a different email
Invalid field typeUse text not string, number not int, bool not boolean
SQLite lock errorAnother process (e.g., Docker) is using the database file

On this page