cigen vs Turborepo remote cache
Turborepo replays a JavaScript monorepo task's logs and outputs when its hash is cached. cigen decides whether a whole CI job runs, in any language. What each is good at, and how to use both.
Turborepo is a task runner for JavaScript and TypeScript monorepos. Its cache hashes each task’s inputs and, on a hit, replays the task’s logs and restores its outputs instead of running it. Shared through a remote cache, a task one machine ran doesn’t run again on another. cigen works at the CI-config level instead: it decides whether each CI job does its work at all, whatever tool the job runs.
What Turborepo does
A task’s hash combines a global hash (the resolved turbo.json task definitions, lockfile changes that affect the root,
globalDependencies files, globalEnv values, some flags) and a package hash (the package’s turbo.json, its
package.json, lockfile changes that affect it, and its files, or the inputs you configure). On a hit, Turborepo
replays the terminal output and restores the files declared in outputs; files you don’t declare aren’t cached
(Caching).
Remote caching is free: Vercel Remote Cache costs nothing on any plan, and you can self-host a cache that speaks the
Remote Caching API. Artifacts can be signed with an HMAC key, and a failed signature counts as a miss
(Remote caching). turbo run --affected runs only packages
changed between main and HEAD (or TURBO_SCM_BASE and TURBO_SCM_HEAD), and treats every package as changed when
the checkout is too shallow to compare (turbo run).
Where Turborepo is the better choice
- It restores outputs. A cached build gives back its
dist/, so the next task can use it. cigen records only that a job passed; it stores no build artifacts and doesn’t plan to. - It works per task inside one job, across every package of a monorepo, and knows the package graph from your
package.jsonfiles. - The remote cache is free and needs almost no setup.
Where cigen fits better
- cigen runs any command in any language. Turborepo tasks are
package.jsonscripts in a JavaScript workspace. - Many CI jobs aren’t Turborepo tasks: a Rust test suite, a Docker build, Playwright against a running server, a migration check. cigen skips those from their inputs.
- cigen generates the CI config itself (GitHub Actions and CircleCI files, with the skip steps written for you). With
Turborepo you still write the workflow, install dependencies and call
turboin each job. - A cigen job that skips doesn’t install dependencies or restore a cache first. A Turborepo cache hit happens after the
job has checked out, installed Node and run
pnpm install.
Using both
cigen skips the job when nothing it depends on has changed since it passed; when something has, Turborepo replays the tasks it can:
# cigen.yml
provider: github
workflows:
ci:
github:
on:
pull_request: {}
push: { branches: [main] }
jobs:
build:
image: node:24
inputs:
[
'apps/**',
'packages/**',
'turbo.json',
'package.json',
'pnpm-lock.yaml',
]
steps:
- run: pnpm install --frozen-lockfile
- run: pnpm exec turbo run build test
When to pick which
- Turborepo: a JavaScript or TypeScript monorepo where tasks repeat across packages and machines, and restored outputs matter.
- cigen: CI jobs in any language, jobs that aren’t
package.jsonscripts, and generated CI config with skipping built in. - Both: a monorepo where cigen skips untouched jobs and Turborepo speeds up the ones that run.
What cigen can’t do yet
cigen is being rebuilt in the open. On GitHub Actions a skipped job still takes a runner and a checkout until the planned planner job exists. Pass records live in the GitHub Actions cache: scoped by branch and expired after 7 days unused. The release install step needs v0.2.0, which isn’t out yet. See the roadmap.