Running Pipelines
glci run executes CI jobs locally via a background daemon that survives terminal disconnection.
Basic usage#
glci run # run everything
glci run lint test # run specific jobs
glci run --stage build # run all jobs in a stage
glci run -d build-job # detached: start in background, exit immediately
In a terminal, glci run shows a live pipeline graph; press Enter on a job to open its log. The
graph pane supports / job-name search (see
Searching the pipeline graph)
and the log view supports follow mode, w line wrap, ←→ panning, plus / search with n/N
match navigation (see
Log view keys).
Job selection#
# Glob patterns (only * is a metacharacter)
glci run 'qa:*' # all qa: jobs
glci run 'static-analysis *' # all static-analysis shards
glci run rubocop 'lint-*' # mix exact and glob
Skipping and manual jobs#
glci run --skip slow-integration # skip a job (treated as success)
glci run --no-skip deploy-canary # force-run a normally-skipped job
glci run --no-skip-all # disable ALL skip rules
glci run --manual deploy-staging # auto-run a specific manual job
glci run --manual-all # auto-run ALL manual jobs
glci run --no-manual # disable manual auto-run
Naming a manual job selects it but does not play it: glci run deploy-staging plans the job and leaves it manual. Add --manual (or --manual-all, or list it under [manual] jobs in .glciconfig.toml) to run it: glci run deploy-staging --manual deploy-staging.
A manual job can be played from the TUI as soon as glci has started its pipeline, including while the pipeline is still starting: the play is accepted and the job runs once its prerequisites allow, as GitLab accepts a play as soon as the pipeline exists.
A play that glci cannot honour is refused with an error naming why, rather than accepted and then silently skipped (a play accepted before a cancel is canceled with the pipeline, see below):
- once the pipeline is being canceled:
pipeline is being canceled; - once the run is over, because nothing is running and nothing else can start:
pipeline has finished; - for a manual job that can no longer run because it is behind a failed or skipped prerequisite:
job is skipped behind a failed or skipped prerequisite; - for a job that is not, or is no longer, waiting to be played (already played, or not a manual job):
job not found or not in manual state; - once the daemon no longer holds the pipeline:
pipeline not found.
The TUI shows the reason under the pipeline title for a few seconds and keeps following the run, which a refused play leaves as it was (see Interactive TUI).
GitLab accepts a play on a canceled or finished pipeline and runs the job in it. A local run has already ended by then, so to run the job, start it again with glci run --manual <job>. A job played before you cancel the pipeline, and not yet started, is reported skipped, like every other job the canceled pipeline had not started (GitLab reports them canceled).
A manual job you do not play stays manual. Whether it holds back the rest of the pipeline depends on its allow_failure, as on GitLab:
- A non-blocking manual job does not hold later stages: every later stage-based job runs without waiting for it. A job-level
when: manualwith noallow_failurekey is non-blocking, since it defaults toallow_failure: true, as is any manual job withallow_failure: true. - A blocking manual job, with
allow_failure: falseor theallow_failure: exit_codes:form, holds every later stage-based job. Left unplayed, nothing else can run, so glci skips those jobs, and skipping them is what ends the run. A job that is manual only throughrules: - when: manualis blocking unless the rule setsallow_failure: true.
To make a job manual locally, or a manual job automatic, without editing .gitlab-ci.yml, set when (and, if needed, allow_failure) in a .glciconfig.toml job section. The override is applied before planning, so it schedules the job exactly as the same keyword in the YAML would.
A DAG job that lists a non-blocking manual job in its needs: does not wait for it. As on GitLab, an unplayed non-blocking manual job counts as skipped for the jobs that need it, so each is decided at once, even while its other needs still run: a when: always dependent runs, and any other, a manual one included, is skipped. Playing the manual job from the TUI while the run is still going (the run ends, and refuses later plays, once nothing is running and nothing else can start) brings back the jobs skipped because of it, as GitLab does: they wait for it and are decided again once it finishes. A blocking manual need is waited for. If it is never played, a dependent that is not itself manual is skipped once nothing else can run, and a manual one stays manual. A manual job behind a failure is skipped rather than left manual: one with a failed job in an earlier stage, or a DAG job with a need that failed or was skipped. It can no longer be played and no longer holds later stages, so a later when: always job still runs. A failure that is not behind the manual job, for example one in its own stage, leaves it playable.
Waiting on an unplayed manual job never fails a pipeline, but waiting on a job that can never run does. When nothing is running and nothing else can start, glci looks at each job still waiting. A job waiting on a needs: entry whose target is not in the pipeline is stalled, and so is any job (manual jobs included) waiting on a stalled one, through needs: or an earlier stage. A need without optional: true on a job that rules: left out never gets this far: GitLab refuses to create that pipeline, and glci refuses to start it, with GitLab’s message (see A job needs a job that “does not exist in the pipeline”). What is left is rarer, such as a target in a stage that stages: does not list. glci still runs the jobs that can run, then reports each stalled job as failed and fails the pipeline, so the run exits 1. The job’s trace says why, for example ERROR: job "test" can never run: it needs "compile", which is not in the pipeline, and the reason is also logged by the daemon and summed up in pipeline_done’s error (see Structured output), which the TUI shows. A trigger job whose downstream pipeline stalls fails too, whatever its strategy:. A pipeline resumed after a crash is judged the same way. See Pipeline fails with “pipeline cannot finish”.
Skip rules can be configured permanently in .glciconfig.toml:
[skip]
jobs = ["slow-integration"]
job_patterns = [".*windows.*"]
stages = ["deploy"]
Dirty mode#
By default, uncommitted and untracked files are included in the pipeline. Use --no-dirty to only use committed code.
The changes count for rules: changes: too: the run’s diff goes to the commit the overlay makes, so an edited or new file matches a changes: rule as it would once committed and pushed (see The changes diff).
glci commits each changed file the way git add in your project would, using your repository’s own Git configuration:
- Files that
.gitignore,.git/info/excludeorcore.excludesFileignore stay out. - Clean filters run, including ones configured only in
.git/configor attributed only in.git/info/attributes. A file you encrypt with git-crypt reaches the jobs encrypted, as a push would send it. This needs the filter’s program on the PATH of the glci daemon. A filter markedrequired, as git-crypt’s is, makes the overlay fail when its program is missing, rather than letting git store the plaintext. core.autocrlf,core.safecrlfandcore.filemodeapply, so line endings and file modes match what you would commit.- A file outside a sparse checkout’s cone is still included.
glci writes nothing to your index, and no Git objects or refs to your repository. Clean filters run in your repository as they do for git add, so they can write state of their own there: Git LFS, for example, keeps the file in .git/lfs/objects. What the jobs receive for an LFS-tracked file is its pointer: glci serves no LFS content, for committed files or dirty ones.
If the overlay fails, the run uses your committed code instead, and glci tells you why. Causes include git add refusing a file (for example, core.safecrlf stopping an irreversible line-ending conversion), a required clean filter whose program the daemon cannot find, and a detached HEAD that no branch points at. The warning says what runs, then the reason, on one line:
glci: warning: --dirty overlay failed, so the run uses the committed tree without your uncommitted changes: <reason>
The job and workflow rules: changes: of such a run compare against HEAD, the tree it runs. Its include: rules were decided while the overlay was being built, against the working tree.
glci runprints it on stderr before the first stage, and again under the summary at the end. It goes to stderr in--jsonmode too.glci run --jsonalso emits it as awarningevent withcode: "dirty_overlay_failed", right afterpipeline_start(see Structured output).glci run --detachedandglci retryprint it before they return.- The TUI shows it under the pipeline title as
warning: ...for the rest of the run. glci daemon logshas it as well.
See --dirty overlay failed for the fixes.
Simulation mode#
Replace all scripts with echo commands. Produces dummy artifacts so you can validate pipeline structure and artifact flow in seconds:
glci run --simulate
Artifact reuse#
Skip upstream jobs when their artifacts exist from a prior run – useful for iterating on a single failing job:
glci run --reuse-artifacts test-job
Cross-project triggers#
Map trigger: project: targets to local directories:
glci run --project-dir group/other-project=../other-project
Or in .glciconfig.toml:
[projects."group/other-project"]
dir = "../other-project"
branch = "main"
Watch mode#
glci run --watch automatically re-runs the pipeline when source files change. The watcher monitors the entire project directory, respects .gitignore patterns, and debounces rapid edits.
glci run --watch # re-run full pipeline on changes
glci run --watch test-job # re-run specific job on changes
glci run --watch --debounce 1s # custom debounce interval
glci run --watch --on-change 'make lint' # run a hook before re-running
The --on-change flag runs a shell command each time changes are detected, before the pipeline re-executes. The command receives GLCI_CHANGED_FILES in its environment (newline-separated list of changed paths).
--on-change-mode controls how that command runs:
block(default) — run the command synchronously and wait for it to exit before re-running. Best for short hooks like linters or notifications.restart— kill the previously launched process and relaunch it in the background without waiting. Best for long-running processes such as servers. On each change glci sendsSIGTERMto the process group (escalating toSIGKILLafter 3s), then starts a fresh instance; the final instance is terminated when you stop watching.
# Regenerate Pages on every change while keeping a preview server alive
glci run --watch pages --on-change 'glci pages serve' --on-change-mode restart
Watch mode is also available on glci show, glci lint, glci jobs, and glci merged:
glci show --watch # live pipeline visualization
glci lint --watch # continuous validation
glci jobs --watch --json # live job list as JSON
glci merged --watch # live fully-resolved config
Concurrent runs#
If you start glci run while another pipeline is already being prepared for the same project directory, the new request automatically queues behind the in-progress preparation. The CLI and TUI display “Waiting for pipeline preparation to finish…” while queued. Up to 3 requests can queue per directory; additional requests are rejected. Press Ctrl+C to abort the wait at any time.
Tolerated failures#
allow_failure is a property of the job, not of the kind of failure — exactly as it is on GitLab. A job that is allow_failure: true may fail for any reason without sinking the pipeline: a non-zero script exit, a job timeout (which is also how glci surfaces a runner that never picked the job up), or a runner that went silent mid-job. Jobs that are allow_failure: true, declared or implied by a job-level when: manual (see below), show the ⚠ marker in the pipeline view, and a tolerated failure leaves the run’s exit code at 0.
flaky-integration:
allow_failure: true
script:
- ./flaky.sh
A job with a job-level when: manual and no allow_failure key defaults to allow_failure: true, as it does on GitLab. Played (--manual, --manual-all, a [manual] rule, or the TUI) and failed, such a job leaves the run’s exit code at 0. The default follows the job’s own when:, not the one a rule produces: a job that is manual only through rules: - when: manual defaults to allow_failure: false, and a when: manual job whose matched rule sets when: on_success runs automatically but keeps allow_failure: true. An explicit allow_failure always wins: on the job (including one inherited through extends:), on the matched rule, or in a .glciconfig.toml job section.
The mapping form is different, and matches GitLab: allow_failure:exit_codes tolerates a job only when it reported one of the listed exit codes. A job that failed without reporting one — a timeout, or a runner system failure — is never tolerated by an exit_codes list, and allow_failure: {} with no exit codes tolerates nothing at all.
tolerate-137:
# Tolerated only when the script itself exits 137.
allow_failure:
exit_codes:
- 137
script:
- ./maybe-oom.sh
As on GitLab, rules:allow_failure replaces the job-level keyword outright, including any exit_codes list it declared. The same goes for an allow_failure override in a .glciconfig.toml job section.
The value must have the right type, or the pipeline is refused, as on GitLab. glci lint exits non-zero and glci run will not start. A job’s allow_failure takes a boolean or the exit_codes mapping (jobs:<name> allow failure should be a hash or a boolean value). A trigger job’s takes a boolean only (jobs:<name> allow failure should be a boolean value). So does a rule’s allow_failure or interruptible on a job, a trigger job or workflow: (jobs:<name>:rules:rule allow failure should be a boolean value). A wrong-typed value is never read as false, so it cannot quietly override the job’s own setting. As on GitLab, yes, no, on, off, true and false are booleans only written plain or tagged !!bool, in any letter case (Yes, oFF), not quoted and not a | or > block: allow_failure: yes is true, while allow_failure: "yes" (or !!str yes) is a string and refused like any other.
The effective value — the one the pipeline’s verdict used — is what a terminal job_status event carries under --json, and what decides whether the JUnit report records the job as skipped. See Structured output.
Trigger jobs (trigger:, including cross-project ones) run no script and so never report an exit code: only the boolean form can tolerate them. See Cross-project pipelines.
Three failures are never tolerated, whatever the job declared:
- A cancelled run. Cancelling with
glci stopor a second Ctrl+C stops the pipeline rather than failing it; the run is recorded as canceled and never reports a pass. Cancelling a single job (glci stop <pipeline> --job <name>, or the TUI’s cancel key) leaves the run going, and that job is tolerated like any other failure — as GitLab does. - A glci-side error, such as failing to queue the job on the embedded mock server. The job never ran, so
allow_failurehas nothing to say about it, and the run fails with the error rather than reporting a green pipeline for a glci malfunction. - A job that can never run, because it waits on a
needs:entry whose target is not in the pipeline (see Skipping and manual jobs). GitLab would not have created the pipeline at all, except for aparallel: matrix:shard pick, which glci does not resolve (see Optional needs).
Ctrl+C behavior#
In attached mode (the default):
- First Ctrl+C: detaches from the pipeline. Jobs continue in the background. Re-attach with
glci logor cancel withglci stop. Re-attaching replays what you missed while detached — in full for a named job, from the daemon’s capped event buffer otherwise. See Viewing logs. - Second Ctrl+C: cancels the pipeline immediately.
Flags reference#
| Flag | Description |
|---|---|
-d, --detached | Start pipeline in background and exit |
-e, --executor | Executor: docker, kubernetes (default “docker”) |
-f, --file | Path to CI config file (default “.gitlab-ci.yml”) |
--image | Default Docker image (default “alpine:latest”) |
--stage | Run only jobs in this stage |
--env KEY=VALUE | Set variable (repeatable) |
--env-file | Load variables from env file |
--secrets | Fetch remote variables: all, project, or none (default “all”) |
--refresh-secrets | Force refresh cached API variables |
--git-strategy | Source code strategy: clone, fetch, none, remote (default “clone”) |
--context | CI context: branch=NAME, merge_request, tag=NAME, env=NAME, or preset name (default: the pipeline pushing HEAD would create, usually branch=<checked-out branch>) |
--mr-source | Source branch for merge_request context; without --context or a preset context, implies merge_request |
--mr-target | Target branch for merge_request context; without --context or a preset context, implies merge_request |
--input KEY=VALUE | Set pipeline input (repeatable) |
--inputs-file | Load pipeline inputs from YAML file |
--dirty | Include uncommitted files (default: true) |
--no-dirty | Disable dirty mode |
--reuse-artifacts | Skip upstream deps when their artifacts exist |
--simulate | Echo commands without executing |
--timeout | Override job timeout (e.g. 30m, 1h) |
--no-registry | Disable embedded container registry |
--registry | Custom container registry URL |
--registry-user | Container registry username |
--registry-password | Container registry password |
--push-through | Mirror pushes to upstream registry |
--pull-policy | Docker image pull policy: always, if-not-present, never (default “if-not-present”) |
--token | GitLab private token |
--gitlab-url | GitLab instance URL |
--project | GitLab project path |
--no-token | Disable forwarding host GitLab token as CI_JOB_TOKEN |
--skip | Skip a job (treated as success; repeatable) |
--no-skip | Force-run a normally-skipped job (repeatable) |
--no-skip-all | Disable all skip rules |
--manual | Auto-run a manual job (repeatable) |
--manual-all | Auto-run ALL manual jobs |
--no-manual | Disable manual auto-run |
--project-dir | Map a project path to a local dir, for cross-project triggers and submodules (repeatable) |
--plain | Disable colors (also off when the output is not a terminal or NO_COLOR is set) |
--json | Emit line-delimited JSON events on stdout instead of human output |
--json-logs | With --json, include job trace output as job_log events |
--report FILE | Write the run’s result report to FILE when the pipeline finishes |
--report-format | Format for --report: junit (default) or json |
-p, --pipeline | Named pipeline preset from .glciconfig.toml |
-w, --watch | Re-run on file changes |
--debounce | Debounce interval for watch mode (default 500ms) |
--on-change | Shell command to run when files change (requires –watch) |
--on-change-mode | How --on-change runs: block (default) or restart (kill & relaunch in background) |
Driving glci from a script, a CI job or an editor integration? Use --json and
--report rather than parsing the terminal output — see
Structured Output.