All commands support --json as a global flag. JSON mode is the preferred interface for agents because successful commands return { "ok": true, "type": "...", "data": ... } and failures return { "ok": false, "error": ... }.

Store Commands

CommandPurposeArgumentsFlags
glyph initInitialize .glyph/ in the current project.NoneNone
glyph import <path>Import files from a workspace path into the public source graph.path: directory to importNone
glyph statusShow store status, database path, and object counts.NoneNone
glyph graphShow source graph summary.NoneNone
glyph init --json
glyph import . --json
glyph status --json
glyph graph --json

Work Commands

CommandPurposeArgumentsFlags
glyph work start <name>Create a work context from a realm projection.name--from <realm> defaults to public
glyph work listList work contexts.NoneNone
glyph work status <name>Show one work context.nameNone
glyph work snapshot <name>Create a manual snapshot for a work context.nameNone
glyph work claim <name>Claim a work context for a user or agent.name--actor, --mode, --ttl
glyph work heartbeat <name>Refresh an active claim.name--actor, --ttl
glyph work release <name>Release an active claim.name--actor
glyph work conflicts <name>Detect conflicts with other active work.nameNone
glyph work depend <work> <depends-on>Record ordering between work contexts.work, depends-onNone
glyph work prune <name>Remove a completed work projection while retaining graph history.nameNone
glyph work discard <name>Prototype placeholder for policy-controlled discard.nameNot implemented in prototype 0
glyph work start docs-update --from public --json
glyph work claim docs-update --actor agent:codex:docs --mode exclusive --ttl 30m --json
glyph work heartbeat docs-update --actor agent:codex:docs --ttl 30m --json
glyph work conflicts docs-update --json
glyph work release docs-update --actor agent:codex:docs --json

File Commands

CommandPurposeArgumentsFlags
glyph read <work> <path>Read a file from a work context.work, pathNone
glyph write <work> <path>Write stdin into a file in a work context.work, path--reason
glyph project <work> <dir>Materialize a work context into a filesystem directory.work, dirNone
glyph diff <work>Show file-level changes in a work context.workNone
glyph read --json returns UTF-8 content directly when possible and base64 for binary data.
glyph read docs-update README.md --json
glyph write docs-update README.md --reason "refresh overview" --json < README.md
glyph project docs-update .glyph/workspaces/docs-update --json
glyph diff docs-update --json

Snapshot And Publication Commands

CommandPurposeArgumentsFlags
glyph checkpoint <work>Create a named milestone snapshot.work--message
glyph publish <work>Publish a work context into a realm.work--to, --mode
glyph publication listList publications.NoneNone
glyph publication inspect <id>Prototype placeholder for publication metadata inspection.idNot implemented in prototype 0
Publication modes are squash and preserve. squash publishes the final state as one public transition. preserve keeps the work context’s snapshot history visible in the destination realm.
glyph checkpoint docs-update --message "docs ready" --json
glyph publish docs-update --to public --mode squash --json
glyph publication list --json

Hook Commands

CommandPurposeArgumentsFlags
glyph hook listList installed local hooks.NoneNone
glyph hook run <event>Run one local hook event.event--work, --to, --mode
Prototype 0 looks for executable hook files under .glyph/hooks/. The currently meaningful events are pre-publish and post-publish.
glyph hook list --json
glyph hook run pre-publish --work docs-update --to public --mode squash --json

Git And Remote Commands

CommandPurposeArgumentsFlags
glyph export gitExport a realm to a clean Git repository.None--realm, --out, --gitignore, --gitinclude
glyph remote add <name> <spec>Add an export remote.name, spec--mode
glyph remote listList configured remotes.NoneNone
glyph remote inspect <name>Show remote metadata.nameNone
glyph remote sync <name>Export and push a remote.nameNone
Git compatibility modes for generated files are none, generated, and overwrite. Defaults come from glyph.yaml.
glyph export git --realm public --out .glyph/exports/origin --gitignore generated --gitinclude generated --json
glyph remote add origin github:OWNER/REPO --mode export-only --json
glyph remote sync origin --json

Mount Commands

CommandPurposeArgumentsStatus
glyph mount add <path> <spec>Planned external source mount registration.path, specDeferred from prototype 0
glyph mount listPlanned mount listing.NoneDeferred from prototype 0
glyph mount update <path>Planned mount refresh.pathDeferred from prototype 0
glyph mount inspect <path>Planned mount inspection.pathDeferred from prototype 0
Mounts are the future equivalent of linking another source repository into a subdirectory while preserving separate upstream identity.

Visualizer Commands

CommandPurposeArgumentsFlags
glyph viz exportExport a static local mesh visualizer.None--out
When --out is omitted, Glyph reads defaults.viz.export.out from glyph.yaml and falls back to .glyph/visualizer.
glyph viz export --json
glyph viz export --out .glyph/visualizer --json

Completion And Help

Cobra also provides generated shell completion and help commands:
glyph completion bash
glyph completion zsh
glyph help work
glyph help export git
These are inherited from the CLI framework and are useful for humans, but agents should prefer --json command output over parsing help text.