Job Management

Interactive TUI#

Launch the interactive TUI with glci (no subcommand):

Navigation: arrow keys/hjkl to move, Enter to drill in, Esc to go back, ? for help.

Runs started from the TUI (Run Pipeline, or r/R on a job) send the same --token, --gitlab-url and --project as glci run, so pass them to glci itself (glci --token "$T" --project group/proj). They fetch --secrets all remote variables, like glci run with no flag. r and R re-run the job under what the shown pipeline, live or from history, was started with, as glci retry does (context, inputs, preset, secrets mode and the rest listed under Retrying failed jobs); the CI file stays the one the TUI was started with, since R picks the downstream jobs from it.

Enter on a manual job of a live run plays it in the pipeline shown. If the daemon refuses the play (the reasons are listed under Skipping and manual jobs), its reason appears under the title for a few seconds, for example could not play deploy: daemon: job is skipped behind a failed or skipped prerequisite, and the view keeps following the run: a refused play does not end the pipeline or mark it failed. The same notice appears when x/X/r/R cannot reach the daemon, when the daemon refuses a stop (could not stop <job>: …, for example for a job that finished just before the key press), and when it refuses an r/R run (could not run <job>: …).

While a run started with n is still going, n does not open a second run form (the run started with n is still running: …). Wait for it to finish, or stop it with X: in its view, or from its entry in the list.

Searching the pipeline graph#

Press / in the pipeline view to search jobs by name, then Enter to apply. Matching jobs stay bright, the rest are dimmed, and the bar under the graph keeps showing the term and how many jobs it matched. The search is a case-insensitive substring match, not a regex.

/ always starts a fresh search: it drops any term already applied. Esc while you are typing abandons the search, Esc with a term applied clears the filter, and a further Esc goes back.

Log view keys#

Pressing Enter on a job in the pipeline view opens its log (the same viewer the live glci run TUI uses). The bar under the pane shows the scroll position, whether follow mode is on, and the search term:

KeyAction
↑/↓, ctrl+u/ctrl+dScroll a line / half a page
g / GJump to the top / bottom
f or enterToggle follow mode (auto-scroll as new output arrives)
wToggle line wrap
←→ or h/lPan sideways (only when wrap is off)
/Search the log — type a term, Enter to apply
n / NJump to the next / previous match (wraps around)
escCancel the prompt, clear an applied search, or leave the log view

Search is a case-insensitive substring match over log lines, and it ignores the color codes runners emit, so a word split by an escape sequence is still found. Applying a term scrolls the first match at or after your current position to the top of the pane — wrapping to the top of the log if there is none below — and pauses follow mode so streaming output does not scroll it away.

The bar reports where you are in the match list (/needle [2/7]), or [no match] when nothing matched. On a live log the list is only rescanned when you press n/N, so a count that new output may have grown is shown with a + ([2/7+]).

Lines wider than the pane are clipped, not lost. Press w to reflow them onto as many rows as they need — the line you were reading stays at the top of the pane, and search matches still land on the right row — or pan sideways with ←→ to read the tail in place. With wrap off, the bar shows a ↔ scroll percentage whenever some line is wider than the pane, and the hints below it offer ←→ pan in the same situation; with wrap on it shows wrap instead. On a narrow terminal whole hints are dropped rather than cut mid-word.

Esc follows the same ladder as the graph: it cancels an open prompt, then clears an applied term, then leaves the log view. Opening a different job’s log clears the search as well.

Viewing logs#

glci log                    # all logs from latest pipeline
glci log 5                  # all logs from pipeline #5
glci log 5 build-job        # log for a specific job

When a job is still running, glci log streams from the daemon in real time. Once the job completes, it reads from the stored log on disk. Press Ctrl+C to stop streaming.

Either form catches you up on output produced before you attached, from different sources. Naming a job (glci log 5 build-job) replays that job’s complete trace from disk, then continues live. Without a job name, the replay comes from the daemon’s in-memory event buffer, which is capped (10 MB of log events by default) — on a very verbose pipeline its oldest output has already been evicted.

Nothing is lost at the switchover from replay to live, but a line written at that exact moment can be printed twice; a duplicate there is expected, not a bug.

Stopping pipelines#

glci stop                    # stop active pipeline for current project
glci stop 5                  # stop pipeline #5
glci stop 5 --job build      # stop specific job in pipeline #5

The pipeline (or, with --job, the job) is marked canceled at once; the runner then aborts the job and removes its containers as GitLab Runner does on GitLab: on the job’s next log update, or, for a job that is printing nothing, about 30 seconds after its last output.

If the daemon no longer tracks the pipeline (e.g., after a daemon restart), glci stop <id> automatically falls back to force-removing leftover Docker containers and the pipeline network, then marks the pipeline as canceled in history.

A job using retry: can be stopped between attempts too, while glci is still saving the failed attempt’s log. The retry is then never started, and the job is reported as canceled rather than with the failed attempt’s exit code.

When stopping a pipeline that has active child pipelines (from trigger: include:), all child jobs are automatically canceled first, ensuring clean shutdown across the entire pipeline hierarchy.

Retrying failed jobs#

Retry creates a new pipeline that re-runs only the failed jobs, reusing artifacts from the original run:

glci retry                  # retry all failed jobs from latest
glci retry 5                # retry all failed from pipeline #5
glci retry --job build      # retry only the "build" job

The retry command verifies that the specified job actually failed before starting.

The failed jobs re-run under what the original pipeline was started with: its CI file, the inputs it was given, simulation mode, context, --mr-source/--mr-target, -p preset, --secrets mode, --no-token and --mask names. A tag pipeline retries as a tag pipeline, fetching the same --secrets scopes. glci retry --simulate=false runs a simulated pipeline’s failures for real. Credentials and --env values are never recorded, so pass --token, --gitlab-url or --project to glci retry itself when the original run took them as flags. A [contexts] entry is replayed by name and re-read from the current config, its env included. Other glci run flags such as --executor, --image or --skip are not recorded; see glci retry.

Listing jobs#

glci jobs parses the CI config and lists all jobs that would run after rules evaluation:

glci jobs                   # list all jobs with stage, when, and needs
glci jobs --stage build     # filter by stage
glci jobs --json            # machine-readable JSON output
glci jobs --context tag=v1  # see jobs for a tag context
glci jobs -p quick          # see jobs for a pipeline preset

Active pipelines#

glci ps                  # show active pipelines and containers
glci ps --containers     # show only glci-managed containers (alias: -c)

Pipeline history#

glci history                 # list recent pipelines
glci history --limit 5
glci history show 3          # show pipeline details with job list
glci history clean           # delete all
glci history clean --keep 5  # keep last 5

History lives under ~/.glci/projects/ (or $GLCI_HOME/projects/): pipeline metadata, event logs, job traces, artifacts, releases and packages. Job traces hold whatever a job printed, secrets included, so glci writes this tree readable only by you - files 0600, directories 0700.

History written by older versions was created readable by other local accounts, and a file keeps the mode it was created with however often it is rewritten. glci repairs that for you: the first time it opens a project whose stored history is still group- or other-readable, it tightens that project’s whole tree, and every writer into the store tightens a file it finds permissive before writing to it. Nothing is appended to a readable trace.

The repair happens per project, when that project is next run, so history for a project you have not run since upgrading is left as it was. glci doctor reports it on its History permissions row, and you can tighten everything at once with:

chmod -R go-rwx "${GLCI_HOME:-$HOME/.glci}/projects"

Linting#

Validate CI configuration without running it:

glci lint                   # report job/stage count on success
glci lint --quiet           # exit code only, no output on success (alias: -q)
glci lint -f custom.yml     # lint a specific file

Exit codes: 0 for valid; 1 for an invalid config — a parse error or a structural issue (e.g., undefined stages, circular needs, a needs: or dependencies: entry naming a job in a later stage, a dependencies: entry naming no job); 2 when lint could not reach a verdict, such as an unreadable .glciconfig.toml, an unknown -p preset or a malformed --input. Lint evaluates no job or workflow: rules:, so a pipeline GitLab refuses only in some contexts, such as one where a job needs a job that rules: leave out, passes it; glci show --context <ctx> refuses it, as glci run does. include: rules are decided, against the -p preset’s context or the default one.

$ glci lint; echo "exit $?"
CI configuration is invalid:
  test-job job: need build-job is not defined in current or prior stages
exit 1

Named runner dispatch#

When named runners are configured, jobs are automatically dispatched to the matching runner based on their CI tags:

# ~/.glci/config.toml
[runners.gpu]
config_template = """
[[runners]]
  [runners.docker]
    gpus = "all"
"""

gpus is a privilege grant, so this template belongs in the global config — a template in a project .glciconfig.toml may not set it. See Restricted keys in a project config template.

# .gitlab-ci.yml
train-model:
  tags: [gpu]
  script: python train.py

The train-model job routes to the gpu runner. Jobs without matching tags run on the default shared runner. First tag match wins when a job has multiple tags.

Health checks#

glci doctor                 # check engine, daemon, token, CI config, git, job network

Runs eight checks and reports pass/fail/warning for each, plus a Project config row that appears only when there is something to say — keys a project .glciconfig.toml set that glci does not honor (a warning), a config file that does not parse (a hard failure, reported before the engine row), or a value in ~/.glci/config.toml that glci run would refuse — a [network] host_gateway that is not an address, a malformed [network.extra_hosts] entry, a bad [paths] container_* dir or [images] value (a Global config failure):

  1. Container engine – verifies the active engine (Docker or Podman) is reachable and reports its version. Under Podman it also checks the Docker-compatible API socket separately. See glci doctor for the engine-specific hints and config-drift warnings
  2. glci images – the images glci pulls for itself, each with the reference it resolved to and the config key it came from. Never fails; warns when a value in [images] is one glci can tell is wrong
  3. Daemon – checks if the glci daemon is running and reports PID
  4. GitLab token – verifies a token is configured
  5. CI config – parses the pipeline and reports job/stage count
  6. Git repository – confirms the current directory is inside a git repo (looking for .git here or in any parent, as git does) and reports branch and commit. From a subdirectory it also names the repository root
  7. History permissions – warns when stored pipeline history under ~/.glci/projects is readable by other local accounts (skipped on Windows)
  8. Job network – verifies a container can reach a port published on the Docker host at the address job containers really get for the mock server (a glci network’s gateway, Docker’s host-gateway, or the address pinned in [network] host_gateway). It runs last because it is the only check that starts containers of its own (and pulls the utility image on a cold machine); --no-job-network skips it and says so in the report

The whole report is printed either way, and the command exits 1 if any check hard-failed: a glci config file (.glciconfig.toml or ~/.glci/config.toml) that does not parse or holds a value glci run refuses, engine unreachable, Podman API socket unreachable, CI config parse error, not a git repository, containers unable to reach the Docker host, or an error while checking daemon status. A stopped daemon (it starts on demand) and a missing GitLab token are warnings only and keep exit 0, so glci doctor && glci run works as a gate.

Esc