Docs / CLI

CLI

Full command reference for agit.

Every command, grouped by what you’re doing. agit <cmd> --help is the always-accurate source; this page is the map.

Identity & setup

CommandWhat it does
agit login [--device] [--with-token]sign in: browser approval, or a device code shown for another device; PAT from stdin for CI
agit logoutdrop local tokens
agit whoamiwho this machine is on the hub
agit setupinstall hooks / skill / MCP / AGENTS.md (idempotent)
agit config [k] [v]hub.url and friends
agit initcreate an agent repo by hand (normally import does it)
agit upgradeself-update the CLI to the hub’s latest tag

Sessions

CommandWhat it does
agit import (no id)list this repo’s sessions waiting to be adopted
agit import <id> -n <agent> -b branchadopt a session onto a branch
agit commitsettle new turns since last settlement
agit statusidentity + session + sync state
agit resume [branch|@]continue a session (native or materialized)
agit run <owner/repo[@ref]>fetch → arbitrate → materialize → launch
agit fork <ref> -b <name>branch a new session off any point
agit new -b <name>fresh session, shared files inherited
agit switch <branch> · agit branchmove between session lines

History

CommandWhat it does
agit log [ref] [-v]turn-by-turn history
agit show <ref>render a turn / event / file
agit diff <a> <b>what changed between two points
agit view <ref> [--json]the session’s actual context composition
agit search <query>corpus-wide search (MCP is the primary surface)
agit tag · agit exportname a point · jsonl/ir/markdown/runtime formats

Parallel lines

CommandWhat it does
agit merge <src> [--into b] [--manual]agent-driven reconciliation, two-parent commit
agit cherry-pick <ref#n..#m>lift turns into a VIEW, no agent needed
agit revert <ref#n.k>drop an event from the VIEW (log untouched)
agit pr create/list/show/fetch/mergepropose a branch to someone else’s repo

Hub

CommandWhat it does
agit push [agent] [--private]publish (secret scan first; no —force)
agit pull [branch] [--prune]fetch + fast-forward
agit fetch [owner/name]objects only, no local branch moves
agit clone <owner/name> [--mine]full copy; read-only by default, no login needed
agit share [session]one-shot encrypted read link (--views, --expire, --password)

Care & feeding

CommandWhat it does
agit scanoutbound secret/sensitivity scan
agit doctor [--check-backend]integrity + runtime capability table
agit hooks ingest · agit mcpmachinery for integrations (rarely run by hand)
agit context · agit plumbingcontext resolution / low-level object ops