Every page here is rendered by ply, a zero-dependency TypeScript git client, speaking git's smart-HTTP protocol from a Cloudflare Worker: no clone, no git binary. Each page shows every round trip it made: the call, bytes, cache tier and time.
Paste a URL, github.com/owner/repo, or owner/repo.
{props.error ?
{props.error}
: null}
PasteA public https URL on an allowlisted host. A username or password in the URL is rejected and never forwarded.
BrowseBranches, trees, files and READMEs, rendered on the server.
InspectEvery page shows its git round trips as a waterfall; the pack map shows how the server deltified objects.
Supported hosts}>
{ALLOWED_HOSTS.map(host =>
{host}
)}
https, no username or password, port 443. A trailing dot or a lookalike host is rejected.
This is a submodule (gitlink) {loaded.blob}. The blob is not in this repository.
if (loaded.note === 'too-big') return
This file is {formatBytes(loaded.size)}, over the {formatBytes(VIEWER_CAPS.maxFileDisplayBytes)} display cap. It was not buffered. Open a smaller file, or fetch it with git.
if (loaded.note === 'binary') return
Binary file, {formatBytes(loaded.size)}. Not shown as text. Download raw bytes (not HTML).
want {shortOid(props.loaded.want)} · asked {props.loaded.filterRequested} · honoured {props.loaded.filterHonoured} · client asked for ofs-delta and did not ask for a thin pack
: null}
)
}
function errorTitle(code: string, status: number): string {
if (code === 'rate_limited' || status === 429) return 'Too many requests'
if (code === 'not_found' || status === 404) return 'Not found'
if (code === 'auth' || status === 401 || status === 403) return 'Repository not found, or private'
if (code === 'limit_exceeded' || status === 413) return 'Too big for this viewer'
if (code === 'timeout' || status === 504) return 'The git host timed out'
if (code === 'unavailable' || status === 503) return 'Viewer unavailable'
if (code === 'bad_request' || status === 400) return 'That URL is not supported'
return 'Something went wrong'
}
function errorHint(code: string, status: number, message: string): string {
if (code === 'rate_limited' || status === 429) return 'Wait for the retry window, then open the repository again. The limit is per client.'
if (code === 'unavailable' || status === 503) return 'The rate limiter is not available, so the viewer stops rather than fetching without a limit.'
if (code === 'limit_exceeded' || status === 413) return 'Open a smaller path or a single file. Huge repositories and packs are refused on purpose.'
if (code === 'timeout' || status === 504) return 'The git host did not answer in time. Try the same URL again.'
if (/credentials/.test(message)) return 'Remove the username and password from the URL and paste it again. Credentials are never forwarded.'
if (/allowlisted|Supported hosts/.test(message)) return 'Use one of the supported hosts. owner/repo by itself means github.com.'
return 'Go back to the viewer and paste a public repository URL.'
}
const PRIVATE_HINT = 'Private repositories are not visible here. GitHub answers 401 for a missing repository and a private one.'
function RefHint(props: { host: string; repoPath: string; hint: ViewerHint }) {
const links = props.hint.nearby
const intro = 'That name is not a branch or tag. Open the ref picker on the repository root'
if (!links.length) return <>{intro}.>
return (
<>
{intro}, or try{' '}
{links.map((item, index) => (
<>
{index > 0 ? ', ' : null}
{item.label}
>
))}
.
>
)
}
function PathHint(props: { host: string; repoPath: string; ref: string | null; hint: ViewerHint }) {
const cue = props.hint.path
const missing = cue === null ? 'that entry' : cue.missing
const existing = cue === null ? '' : cue.existingPath
const where = existing.length > 0 ? existing : 'the repository root'
const href = viewerHref(props.host, props.repoPath, { ref: props.ref === null ? '' : props.ref, path: existing })
if (cue !== null && cue.notDirectory) return <>{missing} is a file, not a directory. Open {where}.>
return <>No entry named {missing}. The deepest directory that exists is {where}.>
}
function FailureBanner(props: Extract) {
const tone = errorTone(props.code, props.status)
// The banner is a flex row (Kumo's icon + text). One span keeps the sentence and its links on the same line.
if (props.code === 'auth') return {PRIVATE_HINT}
if (props.part === 'ref') return
if (props.part === 'path') return
if (notInNamespace(props)) return That name is not in this namespace. Open the repository index.
if (props.part === 'repo') return This repository could not be opened.
return {errorHint(props.code, props.status, props.message)}
}
/** A /r/ that the public namespace does not have. */
function notInNamespace(props: { part: string; message: string }): boolean {
return props.part === 'repo' && /no repository |not a repository/.test(props.message)
}
/**
* The way back up from an error. A missing repository has no root to go back to: a public-namespace name links to the
* namespace index, any other missing repo gets only "Back to the viewer".
*/
function UpLink(props: Extract) {
if (notInNamespace(props)) return <>Repository index · >
if (props.part === 'repo' || props.host.length === 0 || props.repoPath.length === 0) return null
return <>Repository root · >
}
function errorTone(code: string, status: number): 'alert' | 'info' {
if (code === 'not_found' || status === 404 || code === 'auth' || status === 401 || status === 403) return 'info'
return 'alert'
}
function supportedHosts(message: string): readonly string[] {
const marker = 'Supported hosts:'
const at = message.indexOf(marker)
if (at < 0) return []
return message.slice(at + marker.length).replace(/\.$/, '').split(',').map(host => host.trim()).filter(host => host.length > 0)
}
function ErrorPage(props: Extract) {
const title = errorTitle(props.code, props.status)
const hosts = supportedHosts(props.message)
const specific = props.part === 'repo' || props.part === 'ref' || props.part === 'path'
const headline = specific ? props.summary : title
const knownRepo = props.host.length > 0 && props.repoPath.length > 0
return (
{knownRepo ? (
) : null}
{knownRepo && props.part !== 'ref' && props.ref ? : null}