Skip to content

Existing repositories

Wayglass does not replace where your code lives. wayglass init makes a trunk in Artifacts from the repository you already have, agents work in forks of that trunk, and landed changes go back to GitHub (or wherever) with your own credentials. Nothing in the history is rewritten.

For scenario-based answers, see Git repositories, synchronization, and familiar tools, including the distinction between local access to a private source and continuous synchronization with a host, which is on the roadmap but not built.

Run inside any git checkout, wayglass init:

  • creates the project and its trunk repo in Artifacts through the Worker;
  • writes .wayglass/policy.yaml (the built-in example, unless one exists), .wayglass/config.yaml and .wayglass/.gitignore, and commits only those three files, with a message that says why (chore: bring this repository under Wayglass). A dirty working tree stays yours;
  • pushes the current branch’s full history, plus that commit, to the trunk’s main with a 15-minute write token that lives in memory only;
  • adds a git remote named wayglass for the trunk, with the same read-only credential helper wayglass clone configures and a fetch refspec for the why-notes, so git fetch wayglass works without a token on disk;
  • leaves every other remote (origin on GitHub, say) alone.

Tags stay local unless you pass --tags. The trunk branch is always main: a checkout on master is pushed to main and init says so (git branch -m master main makes wayglass land fast-forward your local branch afterwards).

Before anything exists on the Worker, init checks what Artifacts would refuse and stops with nothing created:

Exit error.code Why
1 file_too_large A file over 32 MB somewhere in the history (Artifacts’ per-file limit). The message names the files; error.details.files lists path, size and blob hash. Remove them from history (git filter-repo) or start the trunk from a fresh history.
1 detached_head The trunk takes a branch; check one out first.
2 bad_source --from was given a URL git must not see (below).
2 usage --mirror names a remote the checkout does not have, or a directory was given without --from.

Submodules travel as gitlinks and Git LFS files as their pointers; the Worker reads neither. A repository over 1 GB of objects gets a warning, since Artifacts allows 1 GB per repo.

Terminal window
cd my-app # any branch; uncommitted changes are fine
wayglass init

The project is named after the directory (--project to choose), in the Worker’s main namespace (--jurisdiction eu for the EU one; it cannot change later). Add --tags to push tags, --public to opt the project in to the web audit view, and --mirror origin to have every wayglass land push the landed trunk to origin as well (it writes mirror: origin into .wayglass/config.yaml).

Created project my-app (trunk my-app, jurisdiction us).
Wrote .wayglass/policy.yaml from the example policy.
Pushed branch main at 8dd23422e385 to the trunk's main.
Remote wayglass is the trunk: plain git fetch wayglass works read-only and brings the why-notes along.
Next: 'wayglass agent setup' teaches coding agents the loop in AGENTS.md.

Then wayglass agent setup, commit the AGENTS.md block, and agents start with wayglass intent declare.

A repository on GitHub, GitLab or any git host

Section titled “A repository on GitHub, GitLab or any git host”

--from <url> clones first, with your git credentials: the ssh-agent, the credential helper, gh auth, whatever git clone would use. Wayglass never sees or stores them, so private repositories work the same as public ones.

Terminal window
# GitHub over HTTPS (public, or private through your credential helper)
wayglass init --from https://github.com/junegunn/fzf.git
# GitHub over SSH
wayglass init --from git@github.com:you/private-app.git
# GitLab, Bitbucket or self-hosted, into a directory of your choice
wayglass init --from ssh://git@gitlab.com/group/project.git app --project app
wayglass init --from https://git.example.com/team/repo.git --jurisdiction eu --tags

The clone lands in a directory named after the repository (or the one you give), the project takes the same name (--project overrides), and the source stays as remote origin. A clone whose default branch is not main is renamed to main locally so the checkout, wayglass/main and wayglass land agree; origin keeps its branch name, and publish knows it.

Cloned git@github.com:spf13/cobra.git into cobra (your git credentials; origin stays there).
Created project cobra (trunk cobra, jurisdiction us).
Wrote .wayglass/policy.yaml from the example policy.
Pushed branch main at b227eb1f3a3d to the trunk's main.
Remote wayglass is the trunk: plain git fetch wayglass works read-only and brings the why-notes along.
Next: cd cobra && wayglass agent setup

Accepted URLs: https://host/path, ssh://[user@]host[:port]/path and the scp form user@host:path. Refused, before git runs: a value starting with -, remote helpers (ext::, fd::), git:// and http:// (no authentication), a username, password or token inside the URL (the refusal never repeats it), and local paths or file:// unless you pass --allow-local.

To watch an agent’s work from your own machine, clone its fork read-only; plain git pull then keeps up with its pushes:

Terminal window
wayglass clone my-app --intent i83f41dd279
cd my-app-i83f41dd279 && git pull

wayglass clone my-app without --intent checks out the trunk with its why-notes, for review, land <intent-id> and why. Both configure the credential helper, so neither keeps a token.

Agents never push to origin; they push to their forks, and approved changes land on the trunk. To put the trunk, with its why-notes, on the original remote:

Terminal window
wayglass publish # origin, the branch its HEAD points at
wayglass publish --remote github --branch master

publish fetches the trunk head and refs/notes/wayglass from Artifacts with a 60-second read-only token (memory only, and it checks .git afterwards), then pushes both to the remote with your own git credentials. It never forces: if the remote has commits the trunk lacks it stops with publish_rejected (exit 1) and nothing moves.

With mirror: origin in .wayglass/config.yaml (init --mirror origin), wayglass land does this after every land, so publish is the catch-up or by-hand version.

GitHub and GitLab store the notes ref but do not show it in their web views. Anyone with a clone sees the why with:

Terminal window
git fetch origin '+refs/notes/wayglass:refs/notes/wayglass'
git log --show-notes=wayglass

Commits that landed on GitHub directly (a hotfix, a dependabot merge) are a change to the trunk like any other, so they go through an intent and get their why and decision:

Terminal window
wayglass intent declare --goal "Bring in upstream main" \
--reason "Two hotfixes were merged on GitHub while agents worked" --path "**"
git fetch origin
git merge origin/main # or origin/master; resolve conflicts here
wayglass push -m "merge: upstream main as of $(git rev-parse --short origin/main)"
wayglass propose # the policy decides; wide paths usually go to a person
wayglass land # once approved
wayglass publish # origin and the trunk agree again

Until that lands, publish keeps refusing with publish_rejected, which is the point: nothing reaches the trunk without a decision.

  • Artifacts’ own server-side import (public HTTPS only) is not used; the local clone and push take under a minute for a few thousand commits and work for private repositories too.
  • The trunk branch cannot be named anything but main.