owner/repo@ref:path

gref is the shorthand you already type in chat and CLIs, written down as a small, portable grammar tools can share.

Examples

kzu/sandbox
kzu/sandbox@v1.2.3:src/hello.cs
github.com/kzu/sandbox@main:program.cs
gist.github.com/kzu/0ac826dc7de666546aaedd38e5965381:run.cs
gitlab.com/kzu/runcs@main:program.cs
Piece Meaning
host/ Optional forge (github.com, gitlab.com, gist.github.com, …)
owner/repo Repository (or gist id)
@ref Optional branch, tag, or commit (may include /, e.g. feature/foo)
:path Optional file or directory inside the repo

Omitted host, ref, or path are filled in by the application (many tools default host to github.com).

Spec

The formal grammar and rules live in gref.md and on the versioned site:

gref.sh — latest published spec, with prior versions available from the version menu.

Used by

gref is the remote-ref shape used by:

  • go# — run file-based C# apps locally or from a remote ref (dnx go -- owner/repo@ref:path)
  • runfile — run C# programs from GitHub, Gist, or GitLab refs (dnx runfile owner/repo@ref:path)

Those tools may accept additional host-specific conveniences beyond the core format; the spec defines the portable string.

License

MIT — see license.txt.