Docs / fastkit-cli / Installation

Installation

Get FastKit CLI installed globally and your project ready. One install, then fastkit is available everywhere on your machine.

Requirements

Python 3.12+
Strictly required — FastKit CLI uses 3.12 features
fastkit-core
Required in your project — generated code depends on it
Alembic
Required for migrate commands — installed automatically with fastkit-core

Verify your Python version before proceeding:

bash
python --version   # must be 3.12 or higher

Install

FastKit CLI is installed as a global tool — not inside a project virtual environment. This makes the fastkit command available system-wide, just like git or npm.

uv installs CLI tools in isolated environments automatically:

bash
# Install uv if you don't have it
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

# Install fastkit-cli as a global tool
uv tool install fastkit-cli

Install globally with pip — make sure you're not inside a virtual environment when running this:

bash
pip install fastkit-cli

pipx installs CLI tools in isolated environments, similar to uv:

bash
# Install pipx if you don't have it
pip install pipx
pipx ensurepath

# Install fastkit-cli
pipx install fastkit-cli

FastKit CLI is a global tool. Your project's virtual environment needs fastkit-core, but fastkit-cli itself lives outside the project — just like Alembic or Black.

Verify Installation

Confirm the CLI is available and check all available commands:

bash
fastkit --help
Terminal
$ fastkit --help
Usage: fastkit [OPTIONS] COMMAND [ARGS]...
FastAPI with structure and developer experience.
Options:
--help Show this message and exit.
Commands:
make Generate modules, models, schemas, repositories...
migrate Database migration commands (Alembic wrapper)
db Database utilities (seed)
server Start the development server

Check the version:

bash
fastkit --version

Project Setup

FastKit CLI generates code that depends on fastkit-core. Install it inside your project's virtual environment:

bash
# Create your project
mkdir my-fastapi-project && cd my-fastapi-project

# Create virtual environment and activate
uv venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate

# Install fastkit-core in the project
uv add fastkit-core
bash
mkdir my-fastapi-project && cd my-fastapi-project

python -m venv venv
source venv/bin/activate   # Windows: venv\Scripts\activate

pip install fastkit-core
bash
mkdir my-fastapi-project && cd my-fastapi-project
poetry init
poetry add fastkit-core

What gets installed with fastkit-core

PackageVersionPurpose
fastapi≥ 0.115The web framework
uvicorn≥ 0.34ASGI server
pydantic≥ 2.10Data validation
sqlalchemy≥ 2.0.36ORM — used in generated models
alembiclatestMigrations — used by fastkit migrate
python-dotenv≥ 1.0Environment variable loading

Database Drivers

The generated models use SQLAlchemy but the database driver is separate. Install the one that matches your database inside the project virtual environment:

PostgreSQL Recommended
bash
pip install psycopg2-binary
MySQL / MariaDB
bash
pip install pymysql
SQLite Built-in

Built into Python — no installation needed. Perfect for development and testing.

Or use extras to install the driver together with fastkit-core:

bash
pip install "fastkit-core[postgresql]"   # includes psycopg2-binary
pip install "fastkit-core[mysql]"        # includes pymysql
pip install "fastkit-core[full]"         # all drivers

Troubleshooting

fastkit: command not found

The CLI installed but isn't in your PATH. Add pip's bin directory to your PATH:

bash
# Find where pip installs scripts
python -m site --user-base

# Add to PATH (add to ~/.bashrc or ~/.zshrc)
export PATH="$PATH:$(python -m site --user-base)/bin"

# Or reinstall with uv (handles PATH automatically)
uv tool install fastkit-cli
Python version error

FastKit CLI requires Python 3.12+. Check your version and install it if needed:

bash
python --version   # check current version

# Use uv to install a specific Python version
uv python install 3.12
uv python pin 3.12
ModuleNotFoundError: fastkit_core in generated files

The CLI is installed globally, but fastkit-core must be installed in your project's virtual environment:

bash
# Activate your project venv first
source venv/bin/activate

# Then install fastkit-core
pip install fastkit-core
fastkit migrate fails with Alembic error

Alembic must be configured in your project. Make sure alembic.ini and alembic/env.py exist. If not, initialize Alembic first:

bash
alembic init alembic