CLI Guide
Git is part of the dodil CLI. Every command is invoked as:
dodil git <group> <subcommand> [args] [flags]The CLI drives the REST control plane — repos, branches, PRs, checks, diffs. Cloning and pushing stay with plain git against the wire URLs the CLI prints (Clone & Push).
Install and authenticate
Install and authenticate the dodil CLI — see Install the CLI . Run dodil auth login once; git commands then reuse the shared config (~/.config/dodil/config.yaml) for the token and org. Verify with:
dodil git health
# git gateway reachable at https://git.dodil.io (3 repos)Git-specific notes:
- Endpoint — resolved in order:
DODIL_GIT_ENDPOINTenv var →--api-endpoint→ thegit.api_endpointconfig key → derived from the shared gateway endpoint (api.<domain>→https://git.<domain>). - Token —
--tokenaccepts either a bearer JWT or adk_API key; the CLI sends a JWT asBearerand adk_key as the Basic password automatically. Without the flag it falls back to the shared config’s token fromdodil auth login. - Org — repo names are resolved to repo ids through your org slug:
--org-name(or the shared config’sorg_name).
Repo arguments
Every <repo> argument accepts three forms, resolved automatically:
- a
repo_idUUID — used as-is; - a
name— resolved in your configured org; - an
org/nameaddress — resolved in that org.
Command map
| Group | Subcommands | What it does |
|---|---|---|
repo | list, get <repo>, create <name>, delete <repo> | Repository lifecycle |
branch | list <repo> | Branch listing |
pr | list, get, create, merge, close, approve, review | Pull requests |
check | list <repo> <sha> | CI checks for a commit |
diff | <repo> <from> <to> | Compare two revisions |
clone-url | <repo> | Print smart-HTTP + SSH clone URLs |
health | — | Gateway reachability probe |
Detailed pages:
- Repositories —
repo(create, list, inspect, delete). - Branches, PRs & Checks —
branch,pr,check,diff. - Clone & Push —
clone-urland the git-wire workflows.
Global flags
| Flag | Meaning | Example |
|---|---|---|
-o, --output | Output format: table (default) or json | -o json |
--api-endpoint | Git API base URL | --api-endpoint http://localhost:8090 |
--token | Auth token override (JWT or dk_ key) | --token "$DODIL_TOKEN" |
--org | Organization id | --org 0198… |
--org-name | Organization slug (name → repo_id resolution) | --org-name acme |
--config | Alternate config file | --config ./dodil.yaml |
--debug | Enable debug output | --debug |
Use -o json for automation; get and diff always print JSON.
See also
- Auth and Access — where tokens and roles come from
- API Reference — the endpoints each command calls
- Recipes — end-to-end scenarios built on these commands