Upgrade from fastkit 1.x
fastkit 2.0 changes how you create projects and what the templates generate. Projects you already have keep working. This page lists what to change in your commands, scripts and saved configurations. The changelog has the complete list.
Existing projects
Upgrading fastkit does not change a project it generated earlier. Projects from the removed templates keep working with addroute, doctor and runserver. Run fastkit doctor in each project to see which of the problems fixed in the 2.0 templates it still has, and which of them fastkit can fix for you: see Check and fix a project.
startdemo becomes init --template
fastkit startdemo still works and prints a one-line note. With -y it asks only for the project name:
$ fastkit startdemo fastapi-default --no-venv -y
Note: 'fastkit startdemo' is now 'fastkit init --template fastapi-default'. startdemo keeps working.
Enter the project name: orders2
...
To switch, use fastkit init --template <name> --project-name <name>. init does not ask for the author, email or description: pass --author, --author-email and --description, or let git config user.name and user.email fill the first two.
Removed templates
fastapi-async-crud, fastapi-dockerized, fastapi-psql-orm and fastapi-empty are gone:
$ fastkit init --template fastapi-async-crud --project-name x --no-venv -y
╭───────────────────────────────── Error ──────────────────────────────────╮
│ ❌ Template 'fastapi-async-crud' does not exist. Run 'fastkit │
│ list-templates' to see the available templates. │
╰──────────────────────────────────────────────────────────────────────────╯
| Removed | Use instead |
|---|---|
fastapi-async-crud, fastapi-psql-orm |
fastkit init --template fastapi-sqlmodel (async; SQLite, PostgreSQL or MySQL), or a level with --database |
fastapi-dockerized |
fastkit init --template fastapi-default, or a level with --feature deployment=Docker |
fastapi-empty |
fastkit init --level single-file |
The stack question is gone
init no longer asks for a minimal, standard or full stack. Those stacks added packages without code; levels and features generate the code for what they add. The closest replacements are --level single-file for minimal, and a level with --database and --feature migrations=Alembic or --feature async_tasks=Celery for standard and full. Choose a level or an example compares the levels.
Scripts that pipe answers
init no longer reads answers from standard input. Without a terminal it asks nothing and needs --project-name:
$ printf 'shop\n2\n' | fastkit init
╭───────────────────────────────── Error ──────────────────────────────────╮
│ ❌ Missing --project-name: there is no terminal to ask for it. Pass │
│ --project-name NAME or --config FILE. │
╰──────────────────────────────────────────────────────────────────────────╯
Replace the answers with options, or with --config (see Create projects from scripts and config files):
$ fastkit init --project-name api --level layered --database SQLite -y
...
│ Database │ SQLite │
│ Features │ Testing: Coverage │
...
--interactive is still accepted and has no effect. Configuration files saved by fastkit 1.x still load, but one result changes: a minimal preset, or no preset, now creates a single-file project (template fastapi-single-module). See Configurations saved by fastkit 1.x.
What changed in the generated code
These differences concern projects you generate with fastkit 2.0 and code you port from them; a project generated with 1.x stays as it was. Every template except fastapi-hello, the code init generates for its options and the code addroute writes follow one HTTP contract:
- business routes under
API_V1_PREFIX(default/api/v1),GET /healthat the root,GET /readywhere a database or cache exists; - list endpoints take
limitandoffsetand return{"items", "total", "limit", "offset"}; - an endpoint that creates a resource answers 201 with a
Locationheader; delete answers 204, PUT replaces and PATCH updates the fields sent; - a missing resource answers 404
{"detail": "<Resource> not found"}; - every project except
helloreads its configuration from one settings module that loads.env, and outsidedevelopmentit refuses to start with a missing, example or shortSECRET_KEY.
Some changes are specific to one template or option:
fastapi-mcp:POST /api/v1/auth/loginis removed (usePOST /api/v1/auth/token),/auth/mebecomesGET /api/v1/users/me, and/mcp-routes/*is replaced byGET /api/v1/mcp-server.fastapi-auth-jwt: a rejected refresh token answers 400{"error": "invalid_grant"}instead of 401.fastapi-llm-agent: the server generates conversation ids; an unknownconversation_idanswers 404.- The WebSocket option: the connection list moves from
/api/v1/ws/connectionsto/api/v1/connections.
The "Breaking changes" section of the changelog lists the rest, and its upgrade notes name the database migrations that fastapi-auth-jwt and fastapi-sqlmodel projects need.
Docker images
Images built from the 2.0 Dockerfiles set ENVIRONMENT=production and do not contain .env. Pass the settings at run time, including a SECRET_KEY of at least 32 bytes, or the app refuses to start. The generated Dockerfile of a production project shows the command:
-e ENVIRONMENT=production is needed because the generated .env sets ENVIRONMENT=development.