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
| Command | What 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 logout | drop local tokens |
agit whoami | who this machine is on the hub |
agit setup | install hooks / skill / MCP / AGENTS.md (idempotent) |
agit config [k] [v] | hub.url and friends |
agit init | create an agent repo by hand (normally import does it) |
agit upgrade | self-update the CLI to the hub’s latest tag |
Sessions
| Command | What it does |
|---|
agit import (no id) | list this repo’s sessions waiting to be adopted |
agit import <id> -n <agent> -b branch | adopt a session onto a branch |
agit commit | settle new turns since last settlement |
agit status | identity + 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 branch | move between session lines |
History
| Command | What 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 export | name a point · jsonl/ir/markdown/runtime formats |
Parallel lines
| Command | What 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/merge | propose a branch to someone else’s repo |
Hub
| Command | What 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
| Command | What it does |
|---|
agit scan | outbound secret/sensitivity scan |
agit doctor [--check-backend] | integrity + runtime capability table |
agit hooks ingest · agit mcp | machinery for integrations (rarely run by hand) |
agit context · agit plumbing | context resolution / low-level object ops |