Skip to main content

Cedric

Cedric is a command line tool for creating clean Python backend projects for Django, FastAPI, and Flask. It generates a professional project structure with database configuration, JWT authentication endpoints, OpenAPI documentation, Docker files, CI, tests, and agent-ready project metadata.

Cedric is designed for two workflows:

  • Human developers who want a consistent project foundation without repetitive setup.
  • AI coding agents that need explicit conventions, safe edit boundaries, and machine-readable project metadata.

Status

Cedric v2 is a full rewrite of the original Django-only scaffolder. The new CLI uses cedric as the primary command and keeps cedric-setup only as a deprecated compatibility entry point.

Features

  • Generate Django, FastAPI, or Flask projects from one CLI.
  • Choose SQLite, Turso/libSQL, local Postgres, Neon Postgres, or AWS RDS Postgres.
  • Create a uv-based Python project with pyproject.toml and a starter lockfile.
  • Include JWT auth scaffolding with register, login, refresh, logout, me, and password reset endpoints.
  • Include OpenAPI documentation suited to each framework.
  • Generate Docker, Docker Compose, GitHub Actions CI, tests, scripts, and docs.
  • Write .cedric/project.json so Cedric and AI agents can understand the project.
  • Provide lifecycle commands for refreshing DB, auth, Docker, and CI files.

Requirements

  • Python 3.10 or newer.
  • pipx, pip, or another Python package installer.
  • uv is recommended for working inside generated projects.

Installation

Install the published package:

pip install cedric

For isolated CLI usage:

pipx install cedric

For local development on Cedric itself:

git clone https://github.com/yesabhishek/cedric.git
cd cedric
uv sync --extra dev
uv run cedric --help

Run Locally By Framework

FastAPI:

cedric init --name my_api --framework fastapi --database sqlite --no-input
cd my_api
uv sync
cp .env.example .env
./scripts/dev.sh

Manual FastAPI run command:

uv run uvicorn app.main:app --reload

Open Swagger UI at /docs or the schema at /openapi.json.

Django:

cedric init --name my_service --framework django --database sqlite --no-input
cd my_service
uv sync
cp .env.example .env
uv run python manage.py migrate
./scripts/dev.sh

Manual Django run command:

uv run python manage.py runserver

Open the app at / and the schema at /api/schema/.

Flask:

cedric init --name my_gateway --framework flask --database sqlite --no-input
cd my_gateway
uv sync
cp .env.example .env
./scripts/dev.sh

Manual Flask run command:

uv run flask --app app run --debug

Open the schema at /openapi.json.

CLI Reference

Create a project:

cedric init --name <name> --framework <django|fastapi|flask> --database <preset>

Useful options:

  • --target-dir <path> writes the project into another directory.
  • --force replaces an existing project directory.
  • --no-input disables prompts for scripts and AI agents.
  • --audience <human-developer|ai-agent|dual> selects README guidance style.

Start the guided wizard:

cedric init

Supported Templates

Frameworks:

  • django
  • fastapi
  • flask

Database presets:

  • sqlite: local file-backed SQLite.
  • turso: Turso/libSQL SQLite-compatible hosted database.
  • postgres-local: local Postgres with Docker Compose support.
  • neon: Neon hosted Postgres.
  • aws-rds: AWS RDS Postgres.

Auth module:

  • jwt: email and password JWT authentication.

Generated Project Layout

Cedric projects include:

.
|-- .cedric/project.json
|-- .env.example
|-- AGENTS.md
|-- Dockerfile
|-- README.md
|-- app/
|-- config/
|-- docker-compose.yml
|-- docs/
|-- migrations/
|-- pyproject.toml
|-- scripts/
`-- tests/

Framework-specific files are generated where appropriate. Django projects also include manage.py and an authentication/ app.

Authentication API

The default auth module documents and scaffolds these endpoints:

Method Path Purpose
POST /auth/register Create an account
POST /auth/login Return access and refresh tokens
POST /auth/refresh Refresh tokens
POST /auth/logout Logout hook
GET /auth/me Return the current user
POST /auth/password-reset Password reset integration stub

The generated auth code is a solid starting point, not a complete identity platform. Review password reset, rate limiting, and audit requirements before production.

OpenAPI Support

  • FastAPI projects use native OpenAPI at /openapi.json.
  • Django projects use Django REST Framework with drf-spectacular at /api/schema/.
  • Flask projects use flask-smorest at /openapi.json.

Each project also includes docs/openapi.yaml as a concise contract reference for the generated auth surface.

Working With AI Agents

Every generated project includes:

  • AGENTS.md with commands, architecture notes, and edit boundaries.
  • .cedric/project.json with framework, database, auth, template version, and enabled module metadata.
  • Docs that describe auth, database configuration, and OpenAPI expectations.

Use AGENTS.md and .cedric/project.json before large automated edits to confirm project conventions and Cedric metadata.

Development

Run checks for Cedric itself:

uv sync --extra dev
uv run pytest
uv run ruff check .
uv build

The test suite covers project spec validation, CLI commands, generated file trees, README variants, and legacy command migration messages.

Releases

Releases are published through GitHub Releases and then to production PyPI after approval in the protected pypi GitHub environment. See RELEASE.md for the full branch, pull request, sanity check, tag, and release workflow.

Compatibility

The old cedric-setup command and v2.0.1 lifecycle commands are removed. Use:

cedric init --name <name>

The v1 Django-only src package has been replaced by the v2 cedric package.

License

Cedric is distributed under the GPL-3.0-only license. See LICENSE for details.

Metadata

Release files for cedric 2.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cedric 2.0.3
File Size Uploaded
cedric-2.0.3.tar.gz 72.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cedric 2.0.3
File Interpreter ABI Platform
cedric-2.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 105.7 kB

Release files / cedric-2.0.3.tar.gz

Download URL cedric-2.0.3.tar.gz
Size 72.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a35526dedd5a46c0d77e9141c78be753f0a2f8ccc80540eafe398676170aff0e
BLAKE2b-256 checksum
How to use checksums
578c69647d192be3c7bc35429d315932041a2d4c6d88db2d3eb80dc4992d102c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / cedric-2.0.3-py3-none-any.whl

Download URL cedric-2.0.3-py3-none-any.whl
Size 33.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b76f2bfc6f4e45cfe41f69a1fb765cfe3345119f8f435c912800f543ed4c4ce
BLAKE2b-256 checksum
How to use checksums
7bb1b252b50f3dd62ad4fa414989e4ff6c60fde6881d27e834fe28fcf43bdcf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

2.0.3 This release

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.32

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page