DEV Community

Cover image for Auto-Generate Optimized GitHub Actions Workflows For Any Stack With This New CLI Tool
Dhanush N
Dhanush N

Posted on

Auto-Generate Optimized GitHub Actions Workflows For Any Stack With This New CLI Tool

We’ve all been there.

You finish building a new project. It’s clean, it’s working, and it’s ready to ship.

But then comes the worst part: Writing the CI/CD pipeline.

You open Google, copy a 3-year-old GitHub Actions workflow from Stack Overflow, spend 45 minutes debugging YAML indentation errors, and realize you forgot to configure dependency caching or security scans.

I got tired of repeating this manual process, so I built a zero-config CLI tool to solve it once and for all: ciraft.

🔍 What is ciraft?

ciraft is a lightweight CLI utility that scans your codebase, auto-detects your programming languages, package managers, and container setups, and instantly generates a production-grade CI/CD pipeline in seconds.

Instead of writing YAML from scratch, you just run:

npx ciraft
Enter fullscreen mode Exit fullscreen mode

🛠️ How It Works (Behind the Scenes)

When you run ciraft, it performs a local analysis of your project files:

Detects your package managers: npm, pnpm, yarn, pip, poetry, go, or cargo.
Scans for tests and linters: Jest, pytest, vitest, ruff, etc.
Looks for Docker configuration: Dockerfiles, multi-stage targets, and Compose configurations.
Applies security best practices: Sets strict permissions, sets up matrix builds, configures concurrency gates, and automatically appends a Trivy vulnerability scan for Docker images.
It then renders a optimized .github/workflows/ci.yml using pre-compiled templates.

⚡ Try It Right Now
You can run it via npx or install it directly using Homebrew:

bash

Install via Homebrew

brew install https://raw.githubusercontent.com/DhanushNehru/ciraft/main/Formula/ciraft.rb

# Scan and generate
ciraft
Enter fullscreen mode Exit fullscreen mode

🤝 Let's Collaborate (PRs Welcome!)

ciraft is 100% open-source, and I want to support every stack under the sun.

Currently, it supports Node.js, TypeScript, Python, Go, Rust, and Docker.

If you want to add support for a new language (like PHP, Java, Ruby, or Elixir) or a new CI provider (like GitLab CI or Jenkins), check out the repository! I have pre-written 30+ detailed GitHub Issues tagged with good first issue and hacktoberfest to help you get started.

👉 Check out the repository, drop a ⭐ if it saves you time, and let's build this together: ciraft

💬 What's the most annoying part of writing CI/CD pipelines for you? Let's discuss in the comments below! 👇

Top comments (0)