glab(1)

πŸ“¦
version 1.128.0 Β· 2 versions
, in arch rolling

πŸŽ€ NAME πŸŽ€

okay bestie, this is the glab(1) manual page for glab-govern-audit-sync β€” Sync agent session data to GitLab. (EXPERIMENTAL) πŸ’…


✨ SYNOPSIS ✨

glab govern audit sync [flags]

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the vibe: this command reads new entries from the local agent transcript since the last sync and POSTs them to GitLab as audit events. πŸ“€

The audit events contain the prompts you type, each tool call with its arguments (such as commands, file paths, and edits, replaced with a marker when over 8 KB), each tool call's outcome, duration, and error message, and the model and token usage of each response. Tool output and the text of responses are not sent. no cap. πŸ™ˆ

Before anything is sent, glab replaces common secret formats with a marker such as [REDACTED:gitlab_token]: GitLab, GitHub, Slack, npm and PyPI tokens, AWS, Google, Stripe, OpenAI and Anthropic API keys, JWTs, private keys, credentials in Authorization and token headers or under credential-like keys, and passwords in URLs. This is best effort: other secrets in prompts, commands, or file contents are sent as they are. πŸ’€ so like, keep that in mind.

When glab creates a session on GitLab, it also sends the glab version and the agent's version. A session that has never synced and has had no activity in the last 89 days is not uploaded, because GitLab does not accept events that old. ⏳

Some agents record less:

  • OpenCode 🐚: prompts and responses are not sent, and a tool call's outcome is sent only if the call had finished when it was first synced.
  • Codex πŸ“¦: a tool call's outcome is "completed", because Codex does not record whether it succeeded.
  • Cursor πŸ–±οΈ: only prompts and tool calls are sent, timed by the transcript's last modification, because Cursor records no results, token usage, timestamps, or version. A Cursor session is not synced if the files its tool calls read or write are outside the workspace glab finds, or if several directories match the workspace's name and those files don't show which, so that it is not uploaded to the wrong project.

If a GitLab instance does not accept an agent's sessions yet, they are not uploaded, then or after the instance is upgraded. Sessions from after the upgrade are. 🫢

Called by the Stop hook after every agent turn. Also used by the SessionEnd hook (with --complete) to mark the session as complete. The hooks also record the session's project, host, and transcript location so that --all can sync it later. πŸ”—

Project is resolved from the Git remote of the current directory, or overridden with -R/--repo. πŸ“

With --all, syncs every session the hooks have recorded, each to the project and host it was recorded with. Sessions inactive for 24 hours are marked completed. Sessions from agents that use hooks are skipped while the glab hooks are missing, so removing the hooks pauses them. The fallback periodic sync installed by glab govern setup runs this, and glab govern doctor shows the result of its last run. πŸ‘‘

Supports Claude Code, OpenCode, Codex, and Cursor sessions. OpenCode sessions are read with opencode session export, or opencode export before OpenCode 2. With --all, it also finds and syncs the sessions of Codex and Cursor, when they are enabled with glab govern setup --agents, by scanning their transcripts, for repositories on GitLab hosts glab is logged in to. 🌈

⚠️ This feature is an experiment and is not ready for production use. It might be unstable or removed at any time. For more information, see https://docs.gitlab.com/policy/development_stages_support/. 😭

πŸ’– OPTIONS πŸ’–

  • --all[=false] β€” Sync all sessions recorded by the hooks. Used by the fallback periodic sync. πŸ—‚οΈ
  • --complete[=false] β€” Mark the session as completed. Used by the SessionEnd hook. βœ…
  • -R, --repo="" β€” Select another repository. You can use either OWNER/REPO or GROUP/NAMESPACE/REPO. The full URL or Git URL is also accepted. 🧭
  • --silent[=false] β€” Suppress all output. Used when invoked from hooks. 🀫

πŸ‘‘ OPTIONS INHERITED FROM PARENT COMMANDS πŸ‘‘

  • -h, --help[=false] β€” Show help for this command. πŸ†˜

🌸 EXAMPLE 🌸

# Sync the current agent session to GitLab
$ glab govern audit sync

# Sync and mark the session as completed
$ glab govern audit sync --complete

# Sync against a specific project
$ glab govern audit sync -R my-group/my-project

# Sync every recorded session that has unsynced activity
$ glab govern audit sync --all

⭐ SEE ALSO ⭐

glab-govern-audit(1)


mwah πŸ’‹ this lil page was Auto generated by spf13/cobra, dated Nov 2026, and it's part of the glab(1) manual. slay. πŸŽ€

πŸ“¦ where this page comes from