Skip to content

πŸ› οΈ Command-Line Tools

LibreFolio provides the dev.py script for administration tasks. This page covers the commands most relevant to system administrators.

πŸ‘©β€πŸ’» For Developers

For development-specific commands (frontend build, test runner, API sync, i18n audit), see the Developer Installation Guide.


πŸš€ Installation

Install all project dependencies (Python and Node.js):

./dev.py install

πŸ–₯️ Server (Production)

▢️ Starting the Server

# Standard start
./dev.py server

# With auto-calculated workers (2 Γ— (CPU-1))
./dev.py server --workers N

# Kill existing process on port before starting
./dev.py server --force

Multi-worker

For production, use --workers to run multiple Uvicorn workers. This improves throughput and is recommended for any deployment with more than 1 CPU core.


πŸ‘€ User Management

User management is done via ./dev.py user subcommands:

# Create a user (first user becomes admin automatically)
./dev.py user create <username> <email> <password>

# List all users
./dev.py user list

# Reset a user's password
./dev.py user reset <username> <new_password>

# Promote a user to admin
./dev.py user promote <username>

# Demote an admin to regular user
./dev.py user demote <username>

βš™οΈ System Management

πŸ”§ Initialize Global Settings

./dev.py user init-settings

Populates the database with default Global Settings if they don't already exist.

πŸ—„οΈ Database Migrations

# Apply pending migrations
./dev.py db upgrade

πŸ—„οΈ Database reset

./dev.py db create-clean recreates the database from scratch β€” all data is lost. Use only if you need a fresh start.


πŸ“š Documentation

# Build and deploy MkDocs documentation to GitHub Pages
./dev.py mkdocs deploy

# Generate gallery screenshots (requires running server + test data)
./dev.py mkdocs gallery

πŸ“‹ Full Command Tree

For a complete list of all available commands:

./dev.py --help

πŸ‘©β€πŸ’» Developer Commands

Additional commands for development workflows: