🚀 Shafikul CLI
Lightning-fast FastAPI Project Scaffolding — Generate production-ready boilerplate with user authentication, database models, and a complete folder structure in seconds.
📋 What is Shafikul CLI?
Shafikul CLI is a command-line scaffolding tool that generates complete FastAPI projects with best practices built-in. Instead of manually creating routers, models, templates, and configurations, let the CLI do it for you—instantly.
Perfect for:
- 🎯 Rapid Prototyping — Start building features, not boilerplate
- 👥 User Authentication — Pre-configured login, logout, and registration
- 🗄️ Database Setup — SQLAlchemy models, Alembic migrations, auto-generated
- 🎨 Templates Ready — Organized template structure for web routes
- ⚡ Zero Config — Works out of the box with sensible defaults
✨ Features
| Feature | Status |
|---|---|
| 🏗️ Auto-generate FastAPI project structure | ✅ |
| 🔐 Built-in user authentication (login, logout, registration) | ✅ |
| 🗄️ SQLAlchemy models & Alembic migrations | ✅ |
| 🛣️ Auto-generate routers (Web & API) | ✅ |
| 📝 HTML templates (layouts, pages, error handling) | ✅ |
⚙️ Auto-update main.py and .env |
✅ |
| 🎨 CSS, JavaScript, and static assets folders | ✅ |
| 🧩 Interactive CLI with multiple input options | ✅ |
| 🌈 Colored console output | ✅ |
| 📦 Pip installable package | ✅ |
📦 Installation
From PyPI (Recommended)
pip install shafikul_cli
From Source (Development)
git clone https://github.com/build-with-shafikul/shafikul_cli.git
cd shafikul_cli
pip install -e .
🚀 Quick Start
1️⃣ Create a New FastAPI Project
mkdir project_name
shafikul_cli create app
2️⃣ Follow the Interactive Prompts
The CLI will create folders, files, install dependencies, and initialize the database automatically.
3️⃣ Start the Development Server
python main.py
Then visit http://127.0.0.1:8000 in your browser.
📖 CLI Commands
View Help
shafikul_cli --help
Check Version
shafikul_cli --version
# or
shafikul_cli -v
About
shafikul_cli --about
# or
shafikul_cli -a
Create Resources (Interactive)
shafikul_cli create app
📁 Project Structure
your-project/
│
├── 📄 main.py # FastAPI application entry point
├── 📄 requirements.txt # Python dependencies
├── 📄 .env # Environment variables (gitignored)
├── 📄 .env.example # Environment template
├── 📄 .gitignore # Git ignore rules
├── 📄 alembic.ini # Database migration config
│
├── 📂 app/ # Application core
│ ├── database.py # Database connection & session
│ └── models.py # SQLAlchemy ORM models
│
├── 📂 config/ # Configuration
│ └── app.py # App settings & constants
│
├── 📂 router/ # Route handlers
│ ├── web/ # Web routes (HTML responses)
│ │ ├── auth.py # Login, logout, register
│ │ ├── public.py # Public pages
│ │ └── error.py # Error pages
│ └── api/ # API routes (JSON responses)
│ └── users.py # User API endpoints
│
├── 📂 templates/ # Jinja2 HTML templates
│ ├── layouts/ # Base templates
│ │ ├── main.html # Main layout
│ │ └── auth.html # Auth layout
│ └── pages/ # Page templates
│ ├── public/ # Public pages
│ │ └── index.html
│ ├── auth/ # Auth pages
│ │ ├── login.html
│ │ └── register.html
│ ├── authenticated/ # Protected pages
│ │ └── dashboard.html
│ └── error/ # Error pages
│ └── 404.html
│
├── 📂 asset/ # Static assets
│ ├── css/
│ │ └── style.css
│ ├── js/
│ │ └── script.js
│ └── images/
│ └── icon.png
│
├── 📂 static/ # Served static files
│ └── images/
│ └── icon.png
│
├── 📂 utility/ # Helper functions
│ └── helper_function.py
│
├── 📂 migrations/ # Alembic migrations
│ ├── versions/
│ └── env.py
│
└── 📂 test.db # SQLite database (example)
🔐 Authentication Features
Shafikul CLI comes with pre-built authentication out of the box:
✅ Included
- User Registration — Form validation & password hashing
- User Login — Session management with secure cookies
- User Logout — Session cleanup
- Password Security — Bcrypt & Argon2 hashing
- Protected Routes — Dashboard & user pages
- Database Models — User table with indexes
🎯 Routes
GET / → Homepage
GET /register → Registration form
POST /register → Handle registration
GET /login → Login form
POST /login → Handle login
GET /dashboard → Protected dashboard
POST /logout → Logout user
GET /404 → Not found page
🗄️ Database & Migrations
The CLI automatically sets up:
- SQLite Database (configurable)
- SQLAlchemy ORM — Type-safe models
- Alembic Migrations — Version control for schema
Run Migrations
alembic upgrade head
Create New Migration
alembic revision --autogenerate -m "Add new column"
Rollback
alembic downgrade -1
📦 Dependencies
Shafikul CLI installs the following packages:
| Package | Purpose |
|---|---|
| FastAPI | Web framework |
| Uvicorn | ASGI server |
| Jinja2 | Template engine |
| SQLAlchemy | ORM |
| Alembic | Migrations |
| Passlib + Bcrypt | Password hashing |
| Argon2-CFFI | Advanced password hashing |
| python-dotenv | Environment variables |
| python-multipart | Form data parsing |
See requirements.txt for the complete list.
🛠️ Development
Fork & Contribute
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name
- Make your changes and test thoroughly
- Commit with clear messages:
git commit -m "Add: description of your feature"
- Push to your fork:
git push origin feature/your-feature-name
- Open a Pull Request with a clear description
Development Setup
git clone https://github.com/build-with-shafikul/shafikul_cli.git
cd shafikul_cli
pip install -e ".[dev]" # Install with dev dependencies
📚 Example Usage
Generate a Complete Blog Project
# Create project
shafikul_cli create app
🐛 Troubleshooting
Command not found: shafikul_cli
Make sure you've installed the package:
pip install shafikul_cli
Port 8000 already in use
Change the port in main.py:
uvicorn.run("main:app", host="127.0.0.1", port=8000, reload=True)
Database migration failed
Reset your database:
rm test.db
alembic upgrade head
📄 License
MIT License — See LICENSE for details.
👤 Author
Md Shafikul Islam
⭐ Show Your Support
If you find this tool helpful, please give it a star on GitHub — it means a lot! 🙌
Made with ❤️ by Md Shafikul Islam
Simplifying FastAPI development, one command at a time.
Metadata
Release files for shafikul-cli 2.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| shafikul_cli-2.2.6.tar.gz | 116.8 kB | With provenance | Details for shafikul_cli-2.2.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| shafikul_cli-2.2.6-py3-none-any.whl | Python 3 | none | any | Details for shafikul_cli-2.2.6-py3-none-any.whl |
Total release size: 232.3 kB
Release files / shafikul_cli-2.2.6.tar.gz
| Download URL | shafikul_cli-2.2.6.tar.gz |
|---|---|
| Size | 116.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
08e6843fcbaba778b9d5ea82be95239b77f18d310bef93a16c457d27236fb911
|
|
BLAKE2b-256 checksum How to use checksums |
c19e1129ff199774019112e1bb8eea94e130d8eeca1d8b901bff5c722802508b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.
Transparency logRelease files / shafikul_cli-2.2.6-py3-none-any.whl
| Download URL | shafikul_cli-2.2.6-py3-none-any.whl |
|---|---|
| Size | 115.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
89d7cb808aee06b8f52850c0f61efbd6d8f2dadbce08fdd200a0e7dffe866f8c
|
|
BLAKE2b-256 checksum How to use checksums |
67727c272505db2d6efd03048a4988aaebb7dc2fa487152c6617cc244d3f87cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.
Transparency logSecurity for shafikul-cli 2.2.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for shafikul_cli-2.2.6.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.