Skip to main content

Production-ready Spring Boot project generator CLI

Project description

ar-infra-cli logo

ar-infra-cli

CLI generator for production-ready Spring Boot backends
Opinionated infrastructure scaffolding powered by ar-infra-template

Designed & maintained by Abegà Razafindratelo


ar-infra-cli banner


Table of Contents


Introduction

The ar-infra-cli is a command-line tool designed to generate production-ready Spring Boot applications. It leverages the ar-infra-template as its foundation, ensuring that every generated project starts with a complete, enterprise-grade infrastructure.

This CLI automates the creation of new backend services, eliminating the repetitive setup work and enforcing consistent architecture and security practices across projects.


What's New in v0.1.3

GitHub App Integration

  • Automated repository setup: The ar-infra-bot GitHub App now handles repository authorization during project generation
  • Working CI/CD out-of-the-box: CodeQL and Semgrep workflows are automatically configured with proper permissions
  • Secure authorization flow: GitHub App provides secure, scoped access without requiring personal access tokens
  • Optional integration: Use --skip-github-app flag if you want to set up GitHub manually or don't need CI/CD

Enhanced User Experience

  • Improved CLI messaging: Clearer, more informative messages throughout the project generation process
  • Intuitive workflow: Smoother project setup experience with contextual prompts

Bug Fixes

  • Fixed formatting with no features: Project formatting now works correctly even when no infrastructure features are selected
  • Resolved CI authorization issues: CodeQL and Semgrep workflows no longer fail due to permission problems
  • Improved error handling: Better error messages when GitHub authorization is needed

What is ar-infra?

ar-infra refers to the architecture and infrastructure baseline defined by this ecosystem. It represents a structured, production-ready backend stack that includes:

  • Messaging (RabbitMQ)
  • Storage (S3-compatible bucket)
  • Database (PostgreSQL with Flyway migrations)
  • Email service
  • Security configuration
  • Health check endpoints
  • Integration testing with Testcontainers
  • CI/CD workflows
  • Dockerized runtime environment
  • OpenAPI documentation with Swagger UI

This architecture is designed to be reliable, maintainable, and secure, suitable for enterprise-scale applications.


What is ar-infra-template?

The ar-infra-template is the base template that implements the ar-infra architecture. It provides the full project structure, configurations, validators, health endpoints, and CI/CD pipelines.

It is not intended to be cloned and customized manually. Instead, it serves as the foundation for generated projects, ensuring that every new application starts with the same solid infrastructure.

For more information about the ar-infra architecture, visit the ar-infra-template repository.


What is ar-infra-cli?

The ar-infra-cli is the tool that generates new Spring Boot projects based on the ar-infra-template. It provides customization options such as:

  • groupId and artifactId
  • Project version
  • Feature selection (add or remove components as needed)
  • Target location customization
  • GitHub App integration for automated CI/CD setup

By running a single command, developers can bootstrap a fully configured Spring Boot application based on the ar-infra architecture without manual setup.


Installation

Binary Installation (Recommended)

Linux (x64)

curl -LO https://github.com/Abega1642/ar-infra-cli/releases/download/v0.1.3/ar-infra-linux-amd64
curl -LO https://github.com/Abega1642/ar-infra-cli/releases/download/v0.1.3/ar-infra-linux-amd64.sha256
shasum -a 256 -c ar-infra-linux-amd64.sha256
chmod +x ar-infra-linux-amd64
sudo mv ar-infra-linux-amd64 /usr/local/bin/ar-infra

macOS (Intel)

curl -LO https://github.com/Abega1642/ar-infra-cli/releases/download/v0.1.3/ar-infra-macos-amd64
curl -LO https://github.com/Abega1642/ar-infra-cli/releases/download/v0.1.3/ar-infra-macos-amd64.sha256
shasum -a 256 -c ar-infra-macos-amd64.sha256
chmod +x ar-infra-macos-amd64
sudo mv ar-infra-macos-amd64 /usr/local/bin/ar-infra

macOS (Apple Silicon)

curl -LO https://github.com/Abega1642/ar-infra-cli/releases/download/v0.1.3/ar-infra-macos-arm64
curl -LO https://github.com/Abega1642/ar-infra-cli/releases/download/v0.1.3/ar-infra-macos-arm64.sha256
shasum -a 256 -c ar-infra-macos-arm64.sha256
chmod +x ar-infra-macos-arm64
sudo mv ar-infra-macos-arm64 /usr/local/bin/ar-infra

Windows (PowerShell as Administrator)

Invoke-WebRequest -Uri "https://github.com/Abega1642/ar-infra-cli/releases/download/v0.1.3/ar-infra-windows-amd64.exe" -OutFile "ar-infra.exe"
Invoke-WebRequest -Uri "https://github.com/Abega1642/ar-infra-cli/releases/download/v0.1.3/ar-infra-windows-amd64.exe.sha256" -OutFile "ar-infra.exe.sha256"
certutil -hashfile ar-infra.exe SHA256
Move-Item ar-infra.exe C:\Windows\System32\ar-infra.exe

Python Package Installation

Using pipx (recommended for CLI tools):

pipx install ar-infra-cli

Using pip:

pip install ar-infra-cli

Usage

The ar-infra-cli provides a single command: ar-infra init. This command can be used in two modes: interactive or command-line.

Interactive Mode

The interactive mode guides you through project setup with prompts for each configuration option. This is the recommended approach for first-time users.

ar-infra init

The CLI will ask you to provide:

  • Group ID (e.g., com.example)
  • Artifact ID (e.g., myapp)
  • Project version (e.g., 1.0.0)
  • Output path
  • Features to include or exclude
  • GitHub repository setup (optional)

When you choose to push your project to a repository, the CLI will guide you through automated authorization via the ar-infra-bot GitHub App, ensuring your CI/CD workflows work immediately.

Command Line Mode

For automation or quick generation, all options can be provided directly via command-line flags.

ar-infra init --group=com.example --artifact=myapp --project-version=1.0.0

Skip GitHub App integration if you don't need CI/CD setup:

ar-infra init \
  --group=com.example \
  --artifact=backend-api \
  --skip-github-app

Available Options

Option Description Example
--group Maven group ID for the project com.example
--artifact Maven artifact ID for the project backend-api
--project-version Version of the generated project 1.0.0
--path Directory where the project will be created /home/user/projects
--project-dir Name of the project directory my-project
--features Comma-separated list of features to include postgresql,s3_bucket
--disable-features Comma-separated list of features to exclude rabbitmq,email
--no-cache Skip template caching and fetch fresh N/A
--skip-github-app Skip GitHub App integration N/A

Feature Flags

The following features can be enabled or disabled during project generation:

Feature Description
postgresql PostgreSQL database support with Flyway migrations
rabbitmq RabbitMQ message broker integration
s3_bucket AWS S3-compatible storage integration (BackBlaze)
email Email sending capabilities

By default, all features are enabled. Use --disable-features to exclude specific components.


Examples

Basic Usage

Generate a project with default settings in interactive mode:

ar-infra init

Quick Start

Generate a project with minimal configuration:

ar-infra init --group=com.mycompany --artifact=backend-api

Full Customization

Generate a project with all options specified:

ar-infra init \
    --group=dev.razafindratelo \
    --artifact=cool-project \
    --project-version=2.0.0 \
    --path=/home/user/projects \
    --project-dir=cool-project \
    --features=postgresql,s3_bucket

Minimal Configuration

Generate a project without messaging and email features:

ar-infra init \
    --group=com.example \
    --artifact=minimal-api \
    --disable-features=rabbitmq,email

Fresh Template Fetch

Generate a project with fresh template (bypass cache):

ar-infra init \
    --group=com.example \
    --artifact=myapp \
    --no-cache

Generated Project Structure

Projects generated by ar-infra-cli include:

  • Complete Spring Boot application structure
  • Gradle build configuration
  • Docker and Docker Compose setup
  • CI/CD workflows (GitHub Actions)
  • Integration tests with Testcontainers
  • Health check endpoints
  • OpenAPI documentation
  • Security configuration
  • Database migration scripts (Flyway)
  • Message broker configuration
  • S3 storage integration
  • Email service configuration

System Requirements

Binary Distribution

  • Linux: x86_64 architecture, GLIBC 2.17+
  • macOS: 10.13+ (Intel), 11.0+ (Apple Silicon)
  • Windows: Windows 10/11, x86_64 architecture

Python Package

  • Python: 3.11 or higher
  • Package Manager: pip or pipx

Additional Requirements

  • Internet connectivity for GitHub App integration (optional)
  • Git installed for repository operations

Conclusion

The ar-infra-cli is the entry point for teams adopting the ar-infra architecture. By combining the solid foundation of ar-infra-template with the automation of a CLI tool, it enables developers to start new backend projects quickly, consistently, and securely.

With v0.1.3, GitHub App integration ensures your CI/CD pipelines work immediately after your first push, eliminating the friction of manual repository setup.

This tool is maintained by Abegà Razafindratelo. For questions, issues, or contributions, please refer to the project repository or contact directly at a.razafindratelo@gmail.com.

For more information, visit the ar-infra-template repository.


Support and Documentation


Security Considerations

  • Binary integrity verification via SHA256 checksums is strongly recommended
  • All binaries are built via GitHub Actions with full transparency
  • Secrets are now injected at build time rather than bundled, improving security
  • The ar-infra-bot GitHub App uses minimal, scoped permissions
  • No code signing is provided; users should verify checksums before execution
  • Source code is available for audit

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

ar_infra_cli-0.1.3.tar.gz (54.7 kB view details)

Uploaded Source

Built Distribution

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

ar_infra_cli-0.1.3-py3-none-any.whl (68.6 kB view details)

Uploaded Python 3

File details

Details for the file ar_infra_cli-0.1.3.tar.gz.

File metadata

  • Download URL: ar_infra_cli-0.1.3.tar.gz
  • Upload date:
  • Size: 54.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ar_infra_cli-0.1.3.tar.gz
Algorithm Hash digest
SHA256 09c765145f6aa361bc8ca6d81fb97668730b2988ebd16359e21f59598b76a2e9
MD5 af18e2f1f564ef8b56ef8a0e7dc224cf
BLAKE2b-256 9054eb850ec10c34370f61fa41e5ddb6cf72a8ecde1ec463e42c14be34fc5201

See more details on using hashes here.

File details

Details for the file ar_infra_cli-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: ar_infra_cli-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 68.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ar_infra_cli-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6003dbf8ec9f8f0a3d659f53ea9d7f1f3324135eb289ceb2fa84be1d500a2c8b
MD5 0cbc615c3ec1d58e291a41d94858e287
BLAKE2b-256 57de13d5ed6837c2958027357d15751cd76c319cdb07bfa53172944dc3f336e0

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