Thesis
Glyph needs two first-class interfaces: a human CLI and an agent contract. Theglyph CLI should make Glyph understandable and operable by humans. The agent contract should let coding agents work directly with scoped source projections, work contexts, and publication requests without pretending to be humans typing Git commands.
The first agent contract can be a documented CLI protocol plus a skill document. A full MCP server can be added later when it clearly pays for itself.
Problem
Most developer tools expose one interface and force everyone through it. Git’s CLI became the universal substrate for humans, scripts, CI, and agents. Glyph should not repeat that mistake. At the same time, Glyph should avoid building a second integration surface too early. If agents can reliably useglyph --json with a small skill document that explains the operating model, command protocol, and safety rules, that is enough for bootstrap.
Humans need:
- Clear commands
- Status and review views
- Publication controls
- GitHub remote configuration
- Debuggable policy behavior
- Structured read/write operations
- Scoped context
- Stable workspace IDs
- Machine-readable errors
- Provenance capture
- Safe publication requests
Goals
- Define the minimum human CLI shape.
- Define the minimum Agent API shape.
- Keep commands aligned with Glyph concepts, not Git concepts.
- Support bootstrap, realms, work contexts, projections, policy, and GitHub remotes.
- Make agent operations auditable by default.
Non-Goals
- Final command names for every future feature.
- Building a full TUI or hosted UI.
- Making the CLI Git-compatible.
- Supporting every automation protocol.
- Designing SDKs for every language.
- Requiring MCP before agents can use Glyph effectively.
CLI Principles
- Use Glyph vocabulary directly.
- Prefer explicit publication over implicit pushes.
- Show current realm and work context clearly.
- Avoid branch/stage/rebase terminology.
- Make policy denials explainable.
- Make GitHub remote behavior visible.
- Support a global
--jsonflag for stable non-interactive agent output. - Never prompt by default; commands must either complete from arguments/flags/stdin or return a structured error.
Minimum CLI Surface
Project
Realms
Work Contexts
Files And Projections
Publication
Policy
Remotes
Mounts
glyph work start should create a virtual workspace automatically. Users should not need a separate command to make work editable.
The CLI should expose glyph checkpoint for explicit milestones, while automatic snapshots remain the primary safety mechanism.
All commands should support non-interactive operation. Commands that need input must accept it via arguments, flags, stdin, or environment variables. In --json mode, successful command output should use a stable envelope:
glyph read --json should return file bytes in an envelope instead of writing raw bytes. UTF-8 content should use "encoding":"utf-8" and binary content should use "encoding":"base64":
CLI Defaults
Projects may define command defaults inglyph.yaml so humans and agents do not have to repeat common flags.
Example:
glyph.yaml defaults. Defaults must never trigger publication, sync, destructive cleanup, or visibility widening by themselves.
Agent Contract Principles
- Protocol-first, transport-later.
- Scoped by workspace and policy.
- Machine-readable success and failure.
- Every write records provenance.
- Publication requests are explicit.
- Agents can request context widening but cannot grant it to themselves.
- A checked-in skill document can be the first integration layer.
- The CLI must remain complete enough for non-interactive agent operation.
Skill-Based Agent Integration
Prototype agents should be able to use Glyph through:- The
glyphCLI - Global
--json - stdin for file writes
- stable exit codes
- stable JSON success and error envelopes
- a project skill document that explains how the agent should operate
- Start or reuse a work context before editing.
- Read and write through
glyph readandglyph writewhen practical. - Use
glyph projectonly when a tool needs a real directory. - Prefer
glyph diffandglyph checkpointbefore publication. - Never publish implicitly.
- Choose
--mode squashfor noisy exploratory work and--mode preservewhen audit-visible history matters. - Prune completed workspace projections only after publication, discard, or explicit user request.
- Include concise write reasons for provenance.
- Treat policy denials as constraints, not obstacles to bypass.
- Use Git export or remote sync only when explicitly requested.
Future Local API
A local API may still be useful once the CLI protocol stabilizes. It should mirror the CLI concepts instead of inventing a separate model.Workspace
create_workspace(task, from_realm, allowed_paths?)get_workspace(workspace_id)close_workspace(workspace_id)
Files
list(workspace_id, path)read(workspace_id, path)write(workspace_id, path, content, reason)delete(workspace_id, path, reason)search(workspace_id, query)diff(workspace_id)
Work
snapshot(workspace_id, reason)set_intent(workspace_id, intent)get_provenance(workspace_id)request_review(workspace_id)request_publication(workspace_id, to_realm, history_mode)prune_workspace(workspace_id, retention_policy?)
Policy
explain_denial(workspace_id, operation, path)request_context(workspace_id, reason, paths_or_realms)
Commands
run(workspace_id, command, policy)
Agent Metadata
Agent operations should record:- Agent identity
- Agent provider
- Model or runtime identity where available
- User request or task summary
- Workspace ID
- Files read
- Files written
- Commands requested
- Tool outputs referenced
- Snapshots created
- Publication requests
agent:codex:session-01, agent:claude-code:session-02, or agent:cursor:session-03.
This is not for surveillance theater. It is so humans can review agent work with context.
Optional MCP Surface
Glyph may eventually expose an MCP server for coding agents. The MCP server can wrap the Agent API and expose tools such as:glyph_create_workspaceglyph_read_fileglyph_write_fileglyph_searchglyph_diffglyph_snapshotglyph_request_publicationglyph_explain_policy_denial
Prototype Defaults
- The first CLI is named
glyph. - The first agent integration is
glyph --jsonplus a project skill document. - Global
--jsonis supported for agent-friendly output. - Commands are non-interactive by default.
- Agent workspaces are tied to work contexts.
- Writes require a reason string.
glyph work startcreates a virtual workspace.glyph checkpointis the explicit milestone command.glyph publish --mode squashpublishes a clean final-state event while retaining detailed history by policy.glyph publish --mode preserveexposes selected workspace history in the destination realm.glyph work pruneremoves active projections and caches, not retained source history.- Command execution is available only through a policy-mediated runner.
- Denials return structured error codes.
- GitHub remote support starts with
export-only. - Remote sync is explicit by default.
- MCP support is optional and can follow once the CLI protocol proves useful.
Success Criteria
This spec is successful if a prototype can:- Initialize a Glyph project.
- Create realms and work contexts.
- Read and write files through a local Agent API.
- Materialize a workspace for human editing.
- Show status without Git concepts.
- Publish a work context to
public. - Configure a GitHub remote origin in
export-onlymode. - Configure a GitHub repository as a mounted subdirectory.
- Export public state through the remote translator.