Skip to main content

FastGear CLI

Supported Python Versions PyPi Version Tests codecov
A powerful CLI tool to bootstrap FastAPI projects powered by the FastGear library — with best practices, pre-configured templates, and modern development tools out of the box.

🎯 What is FastGear CLI?

FastGear CLI is the official command-line companion for the FastGear library. It streamlines the creation of FastAPI projects by generating a complete, production-ready project structure with:

  • Pre-configured FastGear integration for accelerated API development
  • FastAPI application scaffolding with best practices
  • Modern Python project setup with type hints and validation

Note: Projects generated by FastGear CLI are designed to work seamlessly with the FastGear library, which provides utilities, patterns, and abstractions to supercharge your FastAPI development.

✨ Features

  • 🚀 FastAPI Project Setup - Create production-ready FastAPI projects in seconds
  • ⚡ FastGear Integration - Pre-configured to use the FastGear library
  • 🐳 Docker Support - Optional Docker configuration with Dockerfile and docker-compose
  • 🤖 AI Agent Tools - Integrate AI-powered development tools (GitHub Copilot)
  • 🔄 CI/CD Integration - Pre-configured CI/CD pipelines (GitHub Actions)
  • 📦 Modern Dependencies - Uses uv for fast, reliable dependency management
  • 🔍 Dry-Run Mode - Preview files before creation
  • ✅ Type-Safe - Full type hints and Pydantic models
  • 🧪 Test Coverage - Comprehensive test suite with pytest

📋 Requirements

  • Python 3.13+
  • uv (recommended for dependency management)

🔧 Installation

uv pip install fastgear-cli

Using pip

pip install fastgear-cli

From source

git clone https://github.com/hmarcuzzo/fastgear-cli.git
cd fastgear-cli
uv pip install -e .

🚀 Quick Start

Create a new project in the current directory:

fg init

Create a project in a specific directory:

fg init /path/to/project

Preview what files would be created (dry-run):

fg init --dry-run
# or
fg init -n

📖 Usage Examples

Basic Project Creation

$ fg init

? Project name: my-awesome-api
? Project title: My Awesome API
? Use Docker? Yes
? Use AI agent tools? No
? Use CI/CD pipeline? Yes
? Select CI/CD provider: GitHub Actions

📦 Generating uv.lock...
🎉  Project 'my-awesome-api' created successfully!

Your new FastAPI project is ready with FastGear pre-configured!

Dry-Run Mode

Preview the project structure before creating files:

$ fg init --dry-run

? Project name: my-awesome-api
? Project title: My Awesome API
? Use Docker? Yes

🔍 Dry run mode - no files created

Files that would be created:
└── 📁 my-awesome-api
    ├── 📁 docker
    │   ├── 📄 Dockerfile
    │   └── 📄 docker-compose.yml
    ├── 📁 src
    │   └── 📁 my_awesome_api
    │       ├── 📄 __init__.py
    │       └── 📄 main.py          # FastAPI app with FastGear
    ├── 📁 tests
    │   ├── 📄 __init__.py
    │   └── 📄 test_main.py
    ├── 📄 .dockerignore
    ├── 📄 .gitignore
    ├── 📄 pyproject.toml           # Includes FastGear dependency
    └── 📄 README.md

Total: 12 file(s)

Custom Directory

Create a project in a specific location:

fg init ~/projects/new-api

Add Components to an Existing Module

Create an entity:

fg add entity user --path src/modules/user

Create a service and inject a repository explicitly:

fg add service user --path src/modules/user \
  --repository-path src.modules.user.repositories.UserRepository

Create a repository and choose interactively whether to inject an entity:

fg add repository user --path src/modules/user

Create a full module and choose components interactively:

fg add module user --path src/modules

Create a module non-interactively:

fg add module user --path src/modules \
  --module-components entity,repository,service,controller

Preview created files without writing:

fg add module user --path src/modules --module-components service,controller --dry-run

🎯 Commands

init

Initialize a new FastAPI project with FastGear.

Usage:

fg init [DIRECTORY] [OPTIONS]

Arguments:

  • DIRECTORY - Target directory (default: current directory)

Options:

  • --dry-run, -n - Show what files would be created without creating them
  • --help - Show help message

Interactive Prompts:

  1. Project name - The name of your project (used for directory and package names)
  2. Project title - Human-readable project title
  3. Use Docker? - Include Docker configuration files
  4. Use AI agent tools? - Include AI development tools configuration
  5. Use CI/CD pipeline? - Include continuous integration/deployment setup
  6. Select CI/CD provider - Choose your CI/CD platform (if enabled)

add

Add components to an existing project/module.

Usage:

fg add [ELEMENT_TYPE] [ELEMENT_NAME] [OPTIONS]

Element types:

  • entity
  • repository
  • service
  • controller
  • module

Arguments:

  • ELEMENT_TYPE - Component type to generate
  • ELEMENT_NAME - Component/module name (normalized to snake_case)

Common options:

  • --path, -p - Base directory where files are generated (default: current directory)
  • --use-folders/--no-use-folders - Generate in folders (entities/, services/, etc.) or flat files
  • --dry-run, -n - Preview output without writing files

Dependency options:

  • --entity-path - Entity import path used by repository
  • --repository-path - Repository import path used by service
  • --service-path - Service import path used by controller

Module option:

  • --module-components - Comma-separated list for module: entity,repository,service,controller

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for fastgear-cli 0.5.5

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

Source distribution (sdist)

Source distribution for fastgear-cli 0.5.5
File Size Uploaded Provenance Actions
fastgear_cli-0.5.5.tar.gz 105.2 kB Without provenance Details for fastgear_cli-0.5.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fastgear-cli 0.5.5
File Interpreter ABI Platform Actions
fastgear_cli-0.5.5-py3-none-any.whl Python 3 none any Details for fastgear_cli-0.5.5-py3-none-any.whl

Total release size: 170.0 kB

Release files / fastgear_cli-0.5.5.tar.gz

Download URL fastgear_cli-0.5.5.tar.gz
Size 105.2 kB
Tags Source
SHA-256 checksum
How to use checksums
75f1767081a6ba25e0df28efd90a4199e47c80aee27aa02da364944dced8d587
BLAKE2b-256 checksum
How to use checksums
6b095a635748cb2226ad9d7eba9469cc4d894f1ade74d0a4ffea70f1ecf15cd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fastgear_cli-0.5.5-py3-none-any.whl

Download URL fastgear_cli-0.5.5-py3-none-any.whl
Size 64.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6595c655813a75569e29cc08054c498f52d5ef1ad2cff04fe2ed87551a81a93
BLAKE2b-256 checksum
How to use checksums
fea9e8fce0a894f54cc336607f3a8f5fc6c9a003eb25c3d8a693edd06b1a00bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for fastgear-cli 0.5.5

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

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