AutoFlow is a powerful CI/CD workflow automation tool that automatically generates pipeline configurations for various CI/CD platforms. Built with Go using the Charm stack (Bubble Tea and Lipgloss), AutoFlow features an interactive Terminal User Interface that guides you through detecting your project's runtime and generating the appropriate workflow files.
- Automatic Runtime Detection - Detects Go, Python, and Node.js projects automatically
- Multi-Platform Support - Generates configurations for various CI/CD platforms
- Interactive TUI - Beautiful terminal interface for easy configuration
- Smart Defaults - Intelligently selects Docker images, package managers, and scripts
- Extensible Architecture - Plugin-based registry system for adding new extractors and executors
graph TB
subgraph TUI["Terminal User Interface"]
L[Landing Screen] --> E[Executor Selection]
E --> X[Extractor Selection]
X --> D[Directory Browser]
D --> R[Result Display]
end
subgraph Registry["Plugin Registry"]
REG[Registry Manager]
REG --> EXT[Extractors]
REG --> EXE[Executors]
end
subgraph Extractors["Runtime Extractors"]
GO[Go Extractor]
PY[Python Extractor]
NODE[Node.js Extractor]
end
subgraph Executors["CI/CD Executors"]
GH[GitHub Actions]
GL[GitLab CI]
end
D --> REG
EXT --> GO
EXT --> PY
EXT --> NODE
EXE --> GH
EXE --> GL
GO --> |ExtractorResult| GH
GO --> |ExtractorResult| GL
PY --> |ExtractorResult| GH
PY --> |ExtractorResult| GL
NODE --> |ExtractorResult| GH
NODE --> |ExtractorResult| GL
sequenceDiagram
participant User
participant TUI
participant Registry
participant Extractor
participant Executor
participant FileSystem
User->>TUI: Launch autoflow
TUI->>User: Enter workflow name
User->>TUI: Select CI/CD platform
User->>TUI: Select runtime type
User->>TUI: Navigate to project directory
TUI->>Registry: Get selected extractor
Registry->>Extractor: Analyze project
Extractor->>FileSystem: Read config files
FileSystem-->>Extractor: go.mod / package.json / pyproject.toml
Extractor-->>Registry: ExtractorResult
TUI->>Registry: Get selected executor
Registry->>Executor: Generate workflow
Executor->>FileSystem: Write YAML config
FileSystem-->>TUI: Success
TUI->>User: Display generated configuration
# Clone the repository
git clone https://github.com/zraisan/autoflow.git
cd autoflow
# Build the binary
go build -v ./...
# Run AutoFlow
./autoflow- Go 1.21 or later
Simply run autoflow to launch the interactive TUI:
./autoflowYou'll be guided through:
- Workflow Name - Enter a name for your CI/CD workflow
- Platform Selection - Choose your target CI/CD platform
- Runtime Selection - Select your project's runtime (Go, Python, or Node.js)
- Directory Selection - Navigate to your project directory
- Review & Save - View the generated configuration and save it
- Detects version from
go.mod - Generates
golang:versionDocker image - Includes
go buildandgo testcommands - Adds linting support where available
- Detects version from
.venvor system Python - Supports multiple package managers:
- pip -
requirements.txt - uv -
pyproject.tomlwith uv config - poetry -
pyproject.tomlwith poetry config
- pip -
- Extracts linting and testing commands from
pyproject.toml
- Parses
package.jsonfor configuration - Detects version from
.nvmrcorenginesfield - Supports multiple package managers:
- npm -
package-lock.json - pnpm -
pnpm-lock.yaml - yarn -
yarn.lock - bun -
bun.lockb
- npm -
- Normalizes npm scripts (lint, test, build, deploy)
AutoFlow generates .github/workflows/{name}.yml with:
- Triggers on push to main branch
- Runs on
ubuntu-latest - Platform-specific setup actions (
setup-node,setup-go,setup-python) - Extracted build and test scripts
Example output:
name: ci
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.21"
- run: go build -v ./...
- run: go test -v ./...AutoFlow generates .gitlab-ci-{name}.yml with:
- Docker image based on detected runtime
- Organized stages for build and test
- Extracted scripts for each job
Example output:
image: golang:1.21
stages:
- build
- test
build:
stage: build
script:
- go build -v ./...
test:
stage: test
script:
- go test -v ./...Contributions are welcome! Here's how you can help:
- Create a new file in
extractors/(e.g.,rust.go) - Implement the
Extractorinterface:
type RustExtractor struct{}
func (e *RustExtractor) Extract(path string) registry.ExtractorResult {
// Read project config file
// Extract version and scripts
return registry.ExtractorResult{
Runtime: "rust",
Version: version,
Image: "rust:" + version,
PackageManager: "cargo",
Scripts: scripts,
}
}- Register in the registry
- Create a new file in
executors/(e.g.,circleci.go) - Implement the
Executorinterface - Generate the appropriate configuration format
- Register in the registry
MIT License - see LICENSE file for details.
