A CLI tool that generates CI pipeline configurations from templates, with built-in support for Nx monorepos.
cigen
simplifies CI/CD configuration management by:
- Generating CI pipeline configurations from reusable templates
- Integrating with Nx monorepo tooling to understand project dependencies
- Supporting multiple CI providers (starting with CircleCI)
- Providing plugin-based architecture for cache backends and CI providers
- Rust (will automatically use 1.88.0 via
rust-toolchain.toml
) - Git
Clone the repository:
git clone https://github.com/DocSpring/cigen.git
cd cigen
-
Install Rust (if not already installed):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
NOTE: Homebrew is not recommended for installing Rust.
-
The project will automatically use the correct Rust version:
When you run any
cargo
command, it will automatically download and use Rust 1.88.0 with rustfmt and clippy included (configured inrust-toolchain.toml
). -
Run the setup script (installs git hooks and checks your environment):
./scripts/setup.sh
-
Build the project:
cargo build
context7
- https://github.com/upstash/context7
- Installed automatically via npx
Run all tests:
cargo test
Run tests with output:
cargo test -- --nocapture
Debug build:
cargo build
Release build (optimized):
cargo build --release
From source:
cargo run -- --help
After building:
./target/debug/cigen --help
Or for release build:
./target/release/cigen --help
Format code:
cargo fmt
Run linter:
cargo clippy
Check code without building:
cargo check
Run with verbose logging:
RUST_LOG=debug cargo run
This project uses Lefthook for git hooks. The setup script installs it automatically, but you can also install it manually:
# macOS
brew install lefthook
# Or download directly
curl -sSL https://github.com/evilmartians/lefthook/releases/latest/download/lefthook_$(uname -s)_$(uname -m) -o /usr/local/bin/lefthook
chmod +x /usr/local/bin/lefthook
The git hooks will:
- pre-commit: Run
cargo fmt --check
,cargo clippy
, andcargo test
- pre-push: Run full checks including
cargo check
To skip hooks temporarily: git commit --no-verify
cigen/
├── src/
│ ├── main.rs # CLI entry point
│ └── lib.rs # Library code
├── tests/
│ └── integration_test.rs # Integration tests
├── scripts/
│ └── setup.sh # Developer setup script
├── .cigen/ # Templates and configuration (future)
├── Cargo.toml # Project dependencies
├── rust-toolchain.toml # Rust version specification
├── .rustfmt.toml # Code formatting rules
├── .clippy.toml # Linting configuration
├── lefthook.yml # Git hooks configuration
└── README.md # This file
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Run tests and ensure they pass (
cargo test
) - Format your code (
cargo fmt
) - Run clippy and fix any warnings (
cargo clippy
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For issues and feature requests, please use the GitHub issue tracker.