Installation
Get FastKit CLI installed globally and your project ready. One install, then fastkit is available everywhere on your machine.
Requirements
migrate commands — installed automatically with fastkit-coreVerify your Python version before proceeding:
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:
# 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:
pip install fastkit-cli
pipx installs CLI tools in isolated environments, similar to uv:
# 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:
fastkit --help
Check the version:
fastkit --version
Project Setup
FastKit CLI generates code that depends on fastkit-core. Install it inside your project's virtual environment:
# 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
mkdir my-fastapi-project && cd my-fastapi-project
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install fastkit-core
mkdir my-fastapi-project && cd my-fastapi-project
poetry init
poetry add fastkit-core
What gets installed with fastkit-core
| Package | Version | Purpose |
|---|---|---|
fastapi | ≥ 0.115 | The web framework |
uvicorn | ≥ 0.34 | ASGI server |
pydantic | ≥ 2.10 | Data validation |
sqlalchemy | ≥ 2.0.36 | ORM — used in generated models |
alembic | latest | Migrations — used by fastkit migrate |
python-dotenv | ≥ 1.0 | Environment 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:
pip install psycopg2-binary
pip install pymysql
Built into Python — no installation needed. Perfect for development and testing.
Or use extras to install the driver together with fastkit-core:
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:
# 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
FastKit CLI requires Python 3.12+. Check your version and install it if needed:
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:
# 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:
alembic init alembic