Generate a minimal GitHub Actions CI workflow from an existing repository.
RepoFlow is a lightweight open-source CLI that detects your repository type, infers install / test / build commands, and generates a conservative GitHub Actions CI workflow for existing repositories.
It supports Node.js, Python, and Go repositories, with framework hints for Next.js, Vite, NestJS, Nuxt, FastAPI, Django, Flask, and Gin. RepoFlow can preview workflow YAML in the terminal, generate .github/workflows/ci.yml, and guide setup through an interactive init flow.
Writing a CI workflow is easy when you already know:
- which runtime version to use,
- which package manager the repo expects,
- which install command is safe,
- whether a build step should exist at all.
RepoFlow helps with that first layer.
It can:
- detect the repo type,
- infer a package manager and common commands,
- preview the workflow before writing files,
- fail conservatively on unsupported projects instead of guessing too much.
Install from npm:
npm install -g @xiaoba17/repoflowInspect a repository:
repoflow detect --cwd /path/to/repoPreview a workflow without writing files:
repoflow preview --cwd /path/to/repoGenerate .github/workflows/ci.yml:
repoflow generate --cwd /path/to/repoRun the guided setup flow:
repoflow init --cwd /path/to/repoImportant behavior:
previewandgeneratekeep the minimal workflow template by default.initlets you choose between aminimaltemplate and anenhancedtemplate path.- optional enhancements are only exposed when RepoFlow sees a concrete signal for them.
{
"language": "node",
"framework": "nextjs",
"packageManager": "pnpm",
"runtimeVersion": "20",
"installCommand": "pnpm install --frozen-lockfile",
"testCommand": "pnpm test",
"buildCommand": "pnpm build",
"ciProvider": "github-actions",
"confidence": 0.95
}name: CI
on:
push:
branches:
- main
pull_request: {}
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 20
- run: pnpm install --frozen-lockfile
- run: pnpm test
- run: pnpm build- existing single-repo projects that need a minimal CI quickly,
- repositories where install / test / build steps can be inferred from common conventions,
- teams that want to preview generated YAML before writing files.
- highly customized CI/CD pipelines,
- advanced release automation,
- deployment orchestration and secrets-heavy workflows,
- unsupported or ambiguous project layouts.
- Node.js
20+ - npm
10+recommended
RepoFlow is distributed as an npm CLI package.
npm install -g @xiaoba17/repoflowNotes:
- GitHub Releases provide source snapshots and release notes only.
- Standalone native binaries are not published yet.
- The installed CLI command is
repoflow.
Scans a repository and prints normalized detection output as JSON.
repoflow detect --cwd /path/to/repoGenerates a GitHub Actions workflow preview and prints it to stdout without writing any files.
repoflow preview --cwd /path/to/repoGenerates .github/workflows/ci.yml for a supported repository.
Behavior:
- creates
.github/workflowsif it does not exist, - prompts before overwriting an existing
ci.yml, - fails conservatively for unknown project types.
repoflow generate --cwd /path/to/repoRuns a guided setup flow for .github/workflows/ci.yml.
Flow:
- confirms the detected project type,
- lets you choose the default branch:
mainormaster, - lets you keep or remove the detected build step when one exists,
- lets you choose a
minimalorenhancedworkflow path when enhancements are available, - can enable dependency cache for supported projects, including
pip,poetry, Node package managers, and Go modules, - can add a lint step when RepoFlow detects a supported lint tool such as Node
scripts.lint, Pythonruff, or Gogolangci-lint, - shows the final YAML preview before writing,
- asks before overwriting an existing workflow.
repoflow init --cwd /path/to/repo- Node.js
- Python
- Go
- Next.js
- Vite
- NestJS
- Nuxt
- FastAPI
- Django
- Flask
- Gin
- Node.js: default runtime
20 - Python: default runtime
3.11 - Go: default runtime
1.22
Package manager defaults:
npm:npm cipnpm:pnpm install --frozen-lockfileyarn:yarn install --frozen-lockfilepip:pip install -r requirements.txtpoetry:poetry install --no-interaction,poetry run pytestgo:go mod download,go test ./...,go build ./...
Framework-aware defaults:
- Node can fall back to
next build,vite build,nest build, ornuxt buildwhen a matching framework is detected and no build script is declared - Django falls back to
python manage.py testwhen no explicit test command orpytestsignal is detected
Enhanced template heuristics:
- Python lint is only offered when
ruffis detected fromrequirements.txt,pyproject.toml, orpoetry.lock - Go lint is only offered when
golangci-lintis detected fromgo.modor a root.golangci.*config - choosing the
minimalpath ininitkeeps output aligned with the defaultpreview / generatetemplate
The repository includes minimal sample projects under fixtures/, including:
fixtures/node-existing-workflowfixtures/node-npmfixtures/node-pnpmfixtures/node-yarnfixtures/node-nextjsfixtures/node-vitefixtures/node-nestjsfixtures/node-nuxtfixtures/node-lintfixtures/python-basicfixtures/python-rufffixtures/python-fastapifixtures/python-djangofixtures/python-flaskfixtures/python-poetryfixtures/python-poetry-rufffixtures/go-basicfixtures/go-ginfixtures/go-golangci
These fixtures serve both as sample repositories and as regression inputs for CLI tests.
RepoFlow already includes a few useful quality signals:
- fixture-backed sample coverage,
- a slim npm package focused on runtime assets,
- a documented release-readiness check,
- a GitHub Actions workflow that validates the main development baseline.
Run the release-readiness check:
npm run release:checkThis runs:
npm testnpm run buildnpm run pack:dry-run
The published npm package is intentionally slimmed down to runtime assets only:
dist/README.mdLICENSEpackage.json
The pack:dry-run script uses a temporary npm cache directory to avoid local cache permission issues.
The repository CI baseline validates the project with:
npm cinpm testnpm run build
Install dependencies:
npm installRun commands directly from TypeScript source:
npm run dev -- detect --cwd /path/to/repo
npm run dev -- preview --cwd /path/to/repo
npm run dev -- generate --cwd /path/to/repo
npm run dev -- init --cwd /path/to/repoBuild the CLI:
npm run buildRun tests:
npm testUse the CLI locally after linking:
npm run build
npm link
repoflow detect --cwd /path/to/repo
repoflow preview --cwd /path/to/repo
repoflow generate --cwd /path/to/repo
repoflow init --cwd /path/to/repoYou can also run the built file directly:
node dist/cli.js detect --cwd /path/to/repo
node dist/cli.js preview --cwd /path/to/repo
node dist/cli.js generate --cwd /path/to/repo
node dist/cli.js init --cwd /path/to/repo- deepen GitHub Actions workflow enhancements,
- expand framework-aware detection,
- organize workflow capabilities more clearly,
- move toward conservative release workflow support.
MIT