Skip to main content

CLI tool for generating FastAPI boilerplate code using the Fastgear library

Project description

FastGear CLI

codecov Python 3.13+ License: MIT

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

Using uv (recommended)

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

๐ŸŽฏ 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)

๐Ÿ“ License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastgear_cli-0.2.0.tar.gz (74.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastgear_cli-0.2.0-py3-none-any.whl (36.1 kB view details)

Uploaded Python 3

File details

Details for the file fastgear_cli-0.2.0.tar.gz.

File metadata

  • Download URL: fastgear_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 74.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","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}

File hashes

Hashes for fastgear_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 25335c569287f8dbc724aaf9d5cda8073b448b755763695625688ee2cf74e176
MD5 25a5d1538b5d81c94ee57fd64d741340
BLAKE2b-256 9f7351df6d73f4f4b429f6f2b5473168d106b5cad7a89be7d3c4ac6c6da5fe84

See more details on using hashes here.

File details

Details for the file fastgear_cli-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fastgear_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 36.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","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}

File hashes

Hashes for fastgear_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fc0d5af51b2729efd0de6b7b767adc250ebeca476960ef27992315a7c84d02ba
MD5 340ca50d8f5cc8632a0886b09c222c86
BLAKE2b-256 3382b3c7cbe2f1cdee7b5af65f53932f25b6be146eef0ecfbbdc0ba00e1660c9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page