Getting Started
Command Line Interface
Manage FastCMS from the terminal — create users, collections, and inspect system info.
Command Line Interface
FastCMS includes a powerful CLI for managing your CMS directly from the terminal. Perfect for automation, DevOps workflows, and quick administration.
Installation
The CLI is included with FastCMS. No additional installation is required.
# Make the script executable (first time only)
chmod +x fastcms
# Run the CLI
./fastcms --help
# Or use Python directly
python fastcms_cli.py --helpAvailable 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.
info Display FastCMS system information.
list-collections List all collections.
list-users List all users.Quick Start
1. Create Your First Admin User
fastcms create-adminYou'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-310578dfab8f2. Create Your First Collection
fastcms create-collection \
--name products \
--type base \
--field title:text \
--field price:number \
--field active:bool3. 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: 0User Management
Create Admin User
fastcms create-admin \
--email admin@example.com \
--name "John Administrator"
# Password will still be prompted for securityCreate Regular User
fastcms create-user \
--email user@example.com \
--name "Regular User" \
--role userList All Users
fastcms list-usersCollection 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:emailExample: 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:textList All Collections
fastcms list-collectionsDelete Collection
fastcms delete-collection old_productsWarning: This is irreversible. Deletes the collection metadata, all records, and the database table.
CI/CD Integration
.github/workflows/setup.yml:
name: Setup FastCMS
on:
push:
branches: [main]
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run migrations
run: alembic upgrade head
- name: Create admin user
run: |
fastcms create-admin \
--email ${{ secrets.ADMIN_EMAIL }} \
--name "CI Admin"Docker Entrypoint
#!/bin/bash
set -e
# Run migrations
alembic upgrade head
# 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 uvicorn app.main:app --host 0.0.0.0 --port 8000Troubleshooting
| Problem | Solution |
|---|---|
command not found | Use python fastcms_cli.py --help or add to PATH |
| Database connection error | Run alembic upgrade head and check DATABASE_URL |
| User already exists | Use fastcms list-users and pick a different email |
| Invalid field type | Use text not string, number not int, bool not boolean |