# FastAPI CLI Tool
A powerful CLI tool for generating production-ready FastAPI applications with multiple template options.
## Overview
This CLI tool provides three different templates to quickly bootstrap FastAPI applications:
- **Minimal**: A basic FastAPI application with minimal dependencies
- **API Only**: A modular API structure with authentication, database, and testing
- **Full-Stack**: A complete production-ready application with all features
## Installation
### From PyPI (when published)
```bash
pip install fastapi-template-cli
```
### From Source
```bash
git clone https://github.com/Sohail342/fastapi-template
cd cli-tool
pip install -e .
```
## Usage
### Basic Usage
```bash
# Create a new FastAPI project
fastapi-template create my-project
# Create with specific template
fastapi-template create my-project --template fullstack
# List available templates
fastapi-template templates
```
### Available Templates
#### 1. Minimal Template
- Basic FastAPI application
- Single file structure
- Perfect for learning and simple projects
```bash
fastapi-template create my-minimal-app --template minimal
```
#### 2. API Only Template
- Modular project structure
- Authentication with JWT
- Database integration with SQLAlchemy
- Testing setup
- API documentation
```bash
fastapi-template create my-api-app --template api_only
```
#### 3. Full-Stack Template
- Everything in API Only template plus:
- Production Docker setup
- Database migrations with Alembic
- Redis integration
- Email support
- Monitoring and logging
- Pre-commit hooks
- CI/CD ready
```bash
fastapi-template create my-fullstack-app --template fullstack
```
### CLI Commands
```bash
# Create new project
fastapi-template create <project-name> [--template TEMPLATE]
# List available templates
fastapi-template templates
# Show version
fastapi-template --version
# Show help
fastapi-template --help
```
## Template Details
### Minimal Template Features
- Single `main.py` file
- Basic FastAPI setup
- Health check endpoint
- Uvicorn development server
### API Only Template Features
- **Project Structure**:
```
├── app/
│ ├── __init__.py
│ ├── main.py
│ ├── api/
│ ├── core/
│ ├── crud/
│ ├── db/
│ ├── models/
│ └── schemas/
├── tests/
├── requirements.txt
├── .env.example
└── README.md
```
- **Features**:
- JWT Authentication
- SQLAlchemy ORM
- Pydantic models
- CRUD operations
- Testing with pytest
- Environment configuration
### Full-Stack Template Features
- **Complete Production Setup**:
- PostgreSQL database
- Redis caching
- Docker & Docker Compose
- Alembic migrations
- Email support
- Security headers
- CORS configuration
- Monitoring endpoints
- Comprehensive testing
- Development tools
- **Development Tools**:
- Black formatting
- Ruff linting
- MyPy type checking
- Pre-commit hooks
- Makefile commands
## Development
### Setup Development Environment
```bash
git clone <repository-url>
cd cli-tool
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
pip install -e .
```
### Running Tests
```bash
pytest
```
### Building Package
```bash
python -m build
```
## Project Structure
```
cli-tool/
├── fastapi_template/
│ ├── __init__.py
│ ├── cli.py # CLI interface
│ └── templates/ # Template directories
│ ├── minimal/
│ ├── api_only/
│ └── fullstack/
├── tests/ # CLI tool tests
├── pyproject.toml # Package configuration
└── README.md # This file
```
## Contributing
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Make your changes
4. Add tests for new features
5. Run tests (`pytest`)
6. Commit your changes (`git commit -m 'Add amazing feature'`)
7. Push to the branch (`git push origin feature/amazing-feature`)
8. Open a Pull Request
## Template Customization
Each template can be customized by modifying the template files in the `templates/` directory. The templates are designed to be:
- **Extensible**: Easy to add new features
- **Configurable**: Environment-based configuration
- **Maintainable**: Clean code structure
- **Testable**: Comprehensive test coverage
## Requirements
- Python 3.11+
- For Full-Stack template:
- PostgreSQL
- Redis (optional)
- Docker (optional)
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Support
For issues and questions:
1. Check the [Issues](https://github.com/your-repo/issues) page
2. Create a new issue with detailed information
3. Join our community discussions
## Roadmap
- [ ] Additional template options (GraphQL, microservices)
- [ ] Plugin system for custom templates
- [ ] Interactive CLI wizard
- [ ] Database initialization scripts
- [ ] Deployment configurations (AWS, GCP, Azure)
- [ ] Frontend integration templates (React, Vue, Angular)
Raw data
{
"_id": null,
"home_page": null,
"name": "fastapi-template-cli",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "fastapi, cli, scaffold, template, python",
"author": null,
"author_email": "FastAPI Template CLI <sohailahmad34280@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/b8/bf/b013c4b76517a29fa5c813e6daa993d3398cdab9ff51ceeede838ec587ff/fastapi_template_cli-0.1.3.tar.gz",
"platform": null,
"description": "# FastAPI CLI Tool\r\n\r\nA powerful CLI tool for generating production-ready FastAPI applications with multiple template options.\r\n\r\n## Overview\r\n\r\nThis CLI tool provides three different templates to quickly bootstrap FastAPI applications:\r\n\r\n- **Minimal**: A basic FastAPI application with minimal dependencies\r\n- **API Only**: A modular API structure with authentication, database, and testing\r\n- **Full-Stack**: A complete production-ready application with all features\r\n\r\n## Installation\r\n\r\n### From PyPI (when published)\r\n```bash\r\npip install fastapi-template-cli\r\n```\r\n\r\n### From Source\r\n```bash\r\ngit clone https://github.com/Sohail342/fastapi-template\r\ncd cli-tool\r\npip install -e .\r\n```\r\n\r\n## Usage\r\n\r\n### Basic Usage\r\n```bash\r\n# Create a new FastAPI project\r\nfastapi-template create my-project\r\n\r\n# Create with specific template\r\nfastapi-template create my-project --template fullstack\r\n\r\n# List available templates\r\nfastapi-template templates\r\n```\r\n\r\n### Available Templates\r\n\r\n#### 1. Minimal Template\r\n- Basic FastAPI application\r\n- Single file structure\r\n- Perfect for learning and simple projects\r\n\r\n```bash\r\nfastapi-template create my-minimal-app --template minimal\r\n```\r\n\r\n#### 2. API Only Template\r\n- Modular project structure\r\n- Authentication with JWT\r\n- Database integration with SQLAlchemy\r\n- Testing setup\r\n- API documentation\r\n\r\n```bash\r\nfastapi-template create my-api-app --template api_only\r\n```\r\n\r\n#### 3. Full-Stack Template\r\n- Everything in API Only template plus:\r\n- Production Docker setup\r\n- Database migrations with Alembic\r\n- Redis integration\r\n- Email support\r\n- Monitoring and logging\r\n- Pre-commit hooks\r\n- CI/CD ready\r\n\r\n```bash\r\nfastapi-template create my-fullstack-app --template fullstack\r\n```\r\n\r\n### CLI Commands\r\n\r\n```bash\r\n# Create new project\r\nfastapi-template create <project-name> [--template TEMPLATE]\r\n\r\n# List available templates\r\nfastapi-template templates\r\n\r\n# Show version\r\nfastapi-template --version\r\n\r\n# Show help\r\nfastapi-template --help\r\n```\r\n\r\n## Template Details\r\n\r\n### Minimal Template Features\r\n- Single `main.py` file\r\n- Basic FastAPI setup\r\n- Health check endpoint\r\n- Uvicorn development server\r\n\r\n### API Only Template Features\r\n- **Project Structure**:\r\n ```\r\n \u251c\u2500\u2500 app/\r\n \u2502 \u251c\u2500\u2500 __init__.py\r\n \u2502 \u251c\u2500\u2500 main.py\r\n \u2502 \u251c\u2500\u2500 api/\r\n \u2502 \u251c\u2500\u2500 core/\r\n \u2502 \u251c\u2500\u2500 crud/\r\n \u2502 \u251c\u2500\u2500 db/\r\n \u2502 \u251c\u2500\u2500 models/\r\n \u2502 \u2514\u2500\u2500 schemas/\r\n \u251c\u2500\u2500 tests/\r\n \u251c\u2500\u2500 requirements.txt\r\n \u251c\u2500\u2500 .env.example\r\n \u2514\u2500\u2500 README.md\r\n ```\r\n\r\n- **Features**:\r\n - JWT Authentication\r\n - SQLAlchemy ORM\r\n - Pydantic models\r\n - CRUD operations\r\n - Testing with pytest\r\n - Environment configuration\r\n\r\n### Full-Stack Template Features\r\n- **Complete Production Setup**:\r\n - PostgreSQL database\r\n - Redis caching\r\n - Docker & Docker Compose\r\n - Alembic migrations\r\n - Email support\r\n - Security headers\r\n - CORS configuration\r\n - Monitoring endpoints\r\n - Comprehensive testing\r\n - Development tools\r\n\r\n- **Development Tools**:\r\n - Black formatting\r\n - Ruff linting\r\n - MyPy type checking\r\n - Pre-commit hooks\r\n - Makefile commands\r\n\r\n## Development\r\n\r\n### Setup Development Environment\r\n```bash\r\ngit clone <repository-url>\r\ncd cli-tool\r\npython -m venv venv\r\nsource venv/bin/activate # On Windows: venv\\Scripts\\activate\r\npip install -r requirements.txt\r\npip install -e .\r\n```\r\n\r\n### Running Tests\r\n```bash\r\npytest\r\n```\r\n\r\n### Building Package\r\n```bash\r\npython -m build\r\n```\r\n\r\n## Project Structure\r\n\r\n```\r\ncli-tool/\r\n\u251c\u2500\u2500 fastapi_template/\r\n\u2502 \u251c\u2500\u2500 __init__.py\r\n\u2502 \u251c\u2500\u2500 cli.py # CLI interface\r\n\u2502 \u2514\u2500\u2500 templates/ # Template directories\r\n\u2502 \u251c\u2500\u2500 minimal/\r\n\u2502 \u251c\u2500\u2500 api_only/\r\n\u2502 \u2514\u2500\u2500 fullstack/\r\n\u251c\u2500\u2500 tests/ # CLI tool tests\r\n\u251c\u2500\u2500 pyproject.toml # Package configuration\r\n\u2514\u2500\u2500 README.md # This file\r\n```\r\n\r\n## Contributing\r\n\r\n1. Fork the repository\r\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\r\n3. Make your changes\r\n4. Add tests for new features\r\n5. Run tests (`pytest`)\r\n6. Commit your changes (`git commit -m 'Add amazing feature'`)\r\n7. Push to the branch (`git push origin feature/amazing-feature`)\r\n8. Open a Pull Request\r\n\r\n## Template Customization\r\n\r\nEach template can be customized by modifying the template files in the `templates/` directory. The templates are designed to be:\r\n\r\n- **Extensible**: Easy to add new features\r\n- **Configurable**: Environment-based configuration\r\n- **Maintainable**: Clean code structure\r\n- **Testable**: Comprehensive test coverage\r\n\r\n## Requirements\r\n\r\n- Python 3.11+\r\n- For Full-Stack template:\r\n - PostgreSQL\r\n - Redis (optional)\r\n - Docker (optional)\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n## Support\r\n\r\nFor issues and questions:\r\n1. Check the [Issues](https://github.com/your-repo/issues) page\r\n2. Create a new issue with detailed information\r\n3. Join our community discussions\r\n\r\n## Roadmap\r\n\r\n- [ ] Additional template options (GraphQL, microservices)\r\n- [ ] Plugin system for custom templates\r\n- [ ] Interactive CLI wizard\r\n- [ ] Database initialization scripts\r\n- [ ] Deployment configurations (AWS, GCP, Azure)\r\n- [ ] Frontend integration templates (React, Vue, Angular)\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A CLI tool for scaffolding modern FastAPI projects",
"version": "0.1.3",
"project_urls": {
"Documentation": "https://github.com/sohail432/fastapi-template-cli#readme",
"Homepage": "https://github.com/sohail432/fastapi-template-cli",
"Issues": "https://github.com/sohail432/fastapi-template-cli/issues",
"Repository": "https://github.com/sohail432/fastapi-template-cli"
},
"split_keywords": [
"fastapi",
" cli",
" scaffold",
" template",
" python"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "747a0a777f06658ebadeb017242c7685d02180543bd0695a0bc0c9f276ce202a",
"md5": "7d2a46933a98852ec524fe53f5946194",
"sha256": "931e8ebd2812b73ba1b116ca00199741e4e0ff4894984f87acef00ccb5e97dbc"
},
"downloads": -1,
"filename": "fastapi_template_cli-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7d2a46933a98852ec524fe53f5946194",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 50056,
"upload_time": "2025-08-20T13:24:42",
"upload_time_iso_8601": "2025-08-20T13:24:42.446442Z",
"url": "https://files.pythonhosted.org/packages/74/7a/0a777f06658ebadeb017242c7685d02180543bd0695a0bc0c9f276ce202a/fastapi_template_cli-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "b8bfb013c4b76517a29fa5c813e6daa993d3398cdab9ff51ceeede838ec587ff",
"md5": "20b5aa6163fdcf29e2aaec9973fb619c",
"sha256": "d19afae3fa581f68b35863493382d008218fd1193161d6ccf804e6e595dfcd66"
},
"downloads": -1,
"filename": "fastapi_template_cli-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "20b5aa6163fdcf29e2aaec9973fb619c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 35020,
"upload_time": "2025-08-20T13:24:44",
"upload_time_iso_8601": "2025-08-20T13:24:44.000804Z",
"url": "https://files.pythonhosted.org/packages/b8/bf/b013c4b76517a29fa5c813e6daa993d3398cdab9ff51ceeede838ec587ff/fastapi_template_cli-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-20 13:24:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sohail432",
"github_project": "fastapi-template-cli#readme",
"github_not_found": true,
"lcname": "fastapi-template-cli"
}