# Sypnia Git documentation > Sypnia Git is a home for your code that works like GitHub: repositories, pull requests, issues, protected branches, webhooks, and plain git over SSH and HTTPS. Every change says which use case it touches, pushes can deploy with Sypnia Run, GitHub can keep a read-only copy updated on every push, and leaving for GitHub is one command and one line in sypnia.toml. Sypnia comes two ways, and every page says which one it is about: - **Plain git** (any git client, any ci; leave whenever you want): Ingest, storage, aggregation, problem grouping, sessions, replay data and uptime checks. You read it through: The HTTP API, the MCP server, the CLI and the Console: one built-in page with the problems list and the session replay viewer. - **Sypnia Cloud** (hosted by us, paid with credits): The same engine, run by us. You read it through: The full app: replay player, performance, uptime, daily summary, search and teams. Every page is also plain Markdown: add `.md` to its address (`https://git.docs.sypnia.com/start/open-source-and-cloud.md`). All pages in one file: https://git.docs.sypnia.com/llms-full.txt ## Start here What Sypnia Git is, how it works, what is open source and what is Sypnia Cloud, and the quickstarts. - [Start here: overview](https://git.docs.sypnia.com/start.md): Section index for Sypnia Git: GitHub-compatible code hosting in Sypnia Cloud (repositories, pull requests, issues linked to use cases, protected branches, CI hooks into Sypnia Run, webhooks), plain git over SSH and HTTPS, the Sypnia session, migration to and from GitHub with sypnia.toml, and mirroring. Engine: Forgejo behind Sypnia's own API and interface. [Engine, Cloud] - [What Sypnia Git is](https://git.docs.sypnia.com/start/what-it-is.md): Sypnia Git: hosted git repositories compatible with GitHub's way of working (pull requests with reviews, issues, labels, protected branches, webhooks, status checks), access with the Sypnia session, SSH keys, HTTPS tokens and deploy keys; issues and pull requests linked to Cases use cases; pushes can trigger Sypnia Run; import/export/mirror with GitHub via `npx @sypnia/git` and sypnia.toml. Not a CI system (Run is), not a replacement for every GitHub feature (no marketplace, no Codespaces). [Engine, Cloud] - [How it works](https://git.docs.sypnia.com/start/how-it-works.md): Flow: git push (SSH ssh.git.sypnia.com or HTTPS git.app.sypnia.com) → the git engine (Forgejo) stores the objects and runs hooks → Sypnia's layer checks protection rules, reads Case: trailers, emits events → Run builds a preview, webhooks fire, Cases links commits to cases → a pull request is reviewed and merged → Run deploys (production needs approval) → mirrors are updated. [Engine, Cloud] - [Open source and Sypnia Cloud](https://git.docs.sypnia.com/start/open-source-and-cloud.md): Open: plain git (any client), the git engine (Forgejo, GPLv3+), @sypnia/git CLI and client (MIT), the webhook format (GitHub-compatible). Sypnia Cloud: hosting, Sypnia session, links to Cases/Run/Agent, mirrors managed for you, backups, the web interface in Sypnia's design. Billing in credits. [Engine, Cloud] - [Quickstart: a new repository](https://git.docs.sypnia.com/start/quickstart-new.md): New repository: `npx @sypnia/git login` (device flow) → `npx @sypnia/git create laespiga/web` (or the web at git.app.sypnia.com) → `git clone https://git.app.sypnia.com/laespiga/web.git` (the CLI installs a git credential helper using the Sypnia session) or `git@ssh.git.sypnia.com:laespiga/web.git` with an SSH key → commit with `Case:` trailers → push. [Cloud] - [Quickstart: import from GitHub](https://git.docs.sypnia.com/start/quickstart-import.md): Import: `npx @sypnia/git login`, then `npx @sypnia/git import github owner/repo [--mirror]`: authorizes the Sypnia GitHub App (read-only; write access to that repository only with --mirror, which keeps GitHub as a read-only copy updated from Sypnia Git), copies git history (all branches, tags, LFS), issues, pull requests with comments and reviews, labels, milestones, releases; maps GitHub users to Sypnia accounts by verified e-mail, otherwise keeps the name as text; writes git.remote into sypnia.toml. [Cloud] - [How Sypnia uses it](https://git.docs.sypnia.com/start/how-sypnia-uses-it.md): Dogfooding: every Sypnia product's code lives in Sypnia Git, organization sypnia, each repository with a read-only mirror on GitHub, one way (the GitHub copy is where people outside find the open source; changes, contributions included, are made in Sypnia Git, and nothing comes back from GitHub). Telemetry (the pilot): repositories sypnia/telemetry (engine and console), sypnia/sypnia-js (SDKs), sypnia/sypnia-docs (these docs); every commit carries a Case: trailer (e.g. Case: send-alert); main protected (2 reviews for the engine, no force-push, signed commits, push protection for secrets); required checks sypnia-run/preview, sypnia-cases/check and tests; Sypnia Agent works on agent/ branches and opens pull requests, a person merges; Telemetry's fixes open pull requests in Sypnia Git with no app to install; merges to main deploy with Run (production approved in App); issues linked to cases, new requests become Cases proposals; history read by case. SSH host keys of ssh.git.sypnia.com as DNSSEC-signed SSHFP records in the sypnia.com zone in Domains. Nightly bundles to S3 as for any customer. [Engine, Cloud] ## Repositories Repositories, branches and protection, pull requests and reviews, and issues linked to use cases. - [Repositories: overview](https://git.docs.sypnia.com/repos.md): Section index: repositories (owner/name, private by default, organizations), branches and protection rules, pull requests (reviews, required checks, merge methods), issues (labels, milestones, linked to Cases use cases). [Engine, Cloud] - [Repositories](https://git.docs.sypnia.com/repos/repositories.md): A repository belongs to a person or an organization (owner/name). Private by default; internal (visible to the organization) or public. Holds git objects, branches, tags, Git LFS objects, issues, pull requests, releases, webhooks, protection rules. Addresses: https://git.app.sypnia.com//.git and git@ssh.git.sypnia.com:/.git. Archive (read-only) and delete (30-day recovery). [Engine, Cloud] - [Branches and protection](https://git.docs.sypnia.com/repos/branches-and-protection.md): Protection rules per branch pattern: no force-push, no deletion, changes only through pull requests, N required approvals (dismissed on new commits), required status checks (e.g. sypnia-run/preview, cases/check), linear history, signed commits, who may bypass (nobody by default; never agents). New repositories protect the default branch (main) with: PR required, 1 approval, no force-push. [Engine, Cloud] - [Pull requests](https://git.docs.sypnia.com/repos/pull-requests.md): Pull requests: from a branch (same repo or a fork) to a base; draft state; reviewers and teams; line comments and suggestions; review states (comment, approve, request changes); required checks; merge methods merge/squash/rebase; auto-merge when green. Shows the use cases touched (from Case: trailers) with a link to Cases, and the Run preview. Closes linked issues with 'Fixes #12'. Same API shape as GitHub's. [Engine, Cloud] - [Issues and use cases](https://git.docs.sypnia.com/repos/issues-and-cases.md): Issues: title, description, labels, assignees, milestones, comments; templates. Each issue can link one or more Cases use cases (field 'cases'); the Cases case shows its open issues. Commits link via trailer `Case: `; pull requests aggregate. Kinds: bug in a case (the case exists), new case (becomes a Cases proposal), outside the plan (contract proposal). Without a Cases project, the field is free text. [Engine, Cloud] ## Access Your Sypnia session, SSH keys, HTTPS tokens, deploy keys, and who can do what. - [Access: overview](https://git.docs.sypnia.com/access.md): Ways to authenticate to Sypnia Git: the Sypnia session (browser, and the CLI as a git credential helper), SSH keys (per person), HTTPS tokens (fine-grained, expiring), deploy keys (per repository, read-only by default). Roles: read, triage, write, maintain, admin, per person or team, from the organization. [Engine, Cloud] - [The Sypnia session](https://git.docs.sypnia.com/access/sypnia-session.md): Sign-in with the Sypnia account at auth.sypnia.com (OIDC) in the browser. For git over HTTPS, `npx @sypnia/git login` (device flow) installs a git credential helper (`git-credential-sypnia`) that hands git a short-lived token (1 h, refreshed from the DPoP-bound session in ~/.config/sypnia, mode 600). Roll-in: first visit adds Git to the account. Sign out revokes the session and its tokens. [Cloud] - [SSH keys](https://git.docs.sypnia.com/access/ssh-keys.md): SSH: host ssh.git.sypnia.com, user git; keys ed25519 (recommended), ecdsa, rsa ≥ 3072; security keys (sk-ssh-ed25519) supported. Add in Account → SSH keys or `npx @sypnia/git keys add ~/.ssh/id_ed25519.pub`. Host key fingerprints published as DNSSEC-signed SSHFP records of ssh.git.sypnia.com (check with ssh -o VerifyHostKeyDNS=yes or dig SSHFP); self-hosted: git keys host-records prints them. A key belongs to one person; it can also sign commits. [Engine, Cloud] - [HTTPS tokens](https://git.docs.sypnia.com/access/https-tokens.md): HTTPS tokens (prefix syp_git_): fine-grained by repository and permission (contents read/write, issues, pull requests, webhooks), expiry required (max 1 year), shown once, stored hashed. Use as the password with any username over HTTPS, or Bearer on the API. Revoke anytime; leaked-token scanning revokes tokens found in public places. [Cloud] - [Deploy keys](https://git.docs.sypnia.com/access/deploy-keys.md): Deploy keys: an SSH public key added to one repository (Settings → Deploy keys or `npx @sypnia/git deploy-keys add key.pub [--write]`), read-only unless --write, never able to bypass protected branches; one key per repository; last-used shown; revoke anytime. [Engine, Cloud] ## Automation CI hooks into Sypnia Run, webhooks, and status checks. - [Automation: overview](https://git.docs.sypnia.com/automation.md): Automation: pushes and pull requests trigger Sypnia Run (previews, deploys) through internal events; any external CI via webhooks + the status checks API; GitHub-compatible webhook payloads signed with HMAC-SHA256. [Engine, Cloud] - [CI and Sypnia Run](https://git.docs.sypnia.com/automation/ci-and-run.md): Built in with Sypnia Run: on push to a branch with a pull request, Run builds a preview and posts status sypnia-run/preview with its URL; on merge to the default branch, Run deploys (production deploys follow Run's approval rules). Configured in sypnia.toml (the [run] table). External CI: subscribe to push/pull_request webhooks, report results with POST /v1/repos/{owner}/{repo}/statuses/{sha} (state, context, target_url). Required checks are set in branch rules. [Engine, Cloud] - [Webhooks](https://git.docs.sypnia.com/automation/webhooks.md): Webhooks per repository or organization: events push, pull_request, pull_request_review, issues, issue_comment, create, delete, release, status, plus Sypnia's case_linked. Payloads follow GitHub's shape where an equivalent exists; headers X-Sypnia-Event, X-Sypnia-Delivery, X-Sypnia-Signature-256 (HMAC-SHA256 of the body with the secret; also X-Hub-Signature-256 for compatibility). Retries with backoff for 24 h on non-2xx; deliveries log with redeliver; 10 s timeout. [Engine, Cloud] ## Move in, move out Import from GitHub, export to GitHub, keep a read-only mirror on GitHub, and the project's sypnia.toml. - [Move in, move out: overview](https://git.docs.sypnia.com/migrate.md): Migration: `npx @sypnia/git import github owner/repo` (history, LFS, issues, PRs, reviews, labels, milestones, releases), `npx @sypnia/git export github owner/repo` (the reverse), `npx @sypnia/git mirror github owner/repo` (one way, Sypnia Git → a read-only copy on GitHub); `git.remote` in sypnia.toml says where the code lives for every Sypnia product. [Engine, Cloud] - [From GitHub](https://git.docs.sypnia.com/migrate/from-github.md): import github: one repo (`owner/repo`) or an organization (`--org owner`, all or selected). Uses the Sypnia GitHub App (read-only scopes: contents, metadata, issues, pull requests). Copies: git refs and objects (mirror clone), LFS, issues, PRs (as closed/merged history or open PRs if the branch exists), comments, reviews, labels, milestones, releases + assets. Users mapped by verified e-mail. Not copied: Actions workflows run (kept as files), secrets, Discussions, Projects, wikis (wiki repos copied as git). Idempotent re-runs; a report lists everything not copied. [Cloud] - [To GitHub](https://git.docs.sypnia.com/migrate/to-github.md): export github owner/repo: creates or uses a GitHub repository (via the Sypnia GitHub App with write access, granted only for the export), pushes all refs and LFS, recreates issues and PRs (with comments, labels, milestones; authorship noted in the text), releases; updates git.remote in sypnia.toml; the repository in Sypnia Git stays until you archive or delete it. Also `npx @sypnia/git export archive` → a .tar with a git bundle and JSON of issues/PRs (works without GitHub). [Cloud] - [Mirroring](https://git.docs.sypnia.com/migrate/mirroring.md): Mirrors go one way: Sypnia Git → GitHub. Work happens in Sypnia Git; the GitHub copy is read-only. `npx @sypnia/git mirror github owner/repo` sets it up (Sypnia GitHub App with write access to that repository only); every push to Sypnia Git pushes the changed branches, tags and LFS objects to GitHub. Nothing comes back: a commit pushed straight to GitHub, or a pull request opened there, is not brought into Sypnia Git, and the next update overwrites that branch. Protect the branches on GitHub so only the Sypnia GitHub App can push. Issues and pull requests are not mirrored (only moved at import/export). `--stop` ends the mirror and leaves the GitHub copy as it is. sypnia.toml: [git] mirror.github. [Cloud] - [sypnia.toml](https://git.docs.sypnia.com/migrate/sypnia-toml.md): sypnia.toml (TOML at the repository root) is the project's one configuration file, shared by every Sypnia product: top-level format = 1 and project = "", then one table per product ([git], [run], [data], [agent], [ai], [design], [skills]…). Each product reads only its table and ignores the others; each product's command line rewrites only its own table and keeps comments; never secrets. The [git] table: remote (where the code lives: https://git.app.sypnia.com//.git, or any git URL after leaving), default_branch, mirror.github (owner/repo of the read-only GitHub mirror). Run, Cases and Agent read git.remote to find the code; import and export change it. [Engine, Cloud] ## SDK, CLI and MCP The @sypnia/git package, the CLI, and the MCP tools for agents. - [SDK, CLI and MCP: overview](https://git.docs.sypnia.com/tools.md): @sypnia/git: /client (the Git API), /webhooks (verifyWebhook), CLI `npx @sypnia/git` (login, logout, create, import, export, mirror, keys, deploy-keys, tokens, pr, issue, credential helper). MCP: https://mcp.git.sypnia.com (list_repos, get_file, create_branch, open_pull_request, comment, list_issues, create_issue, link_case; no merges into protected branches). [Engine, Cloud] - [The SDK](https://git.docs.sypnia.com/tools/sdk.md): createClient({ token }) from '@sypnia/git/client': repos.get/create/list, branches.list/protect, pulls.create/get/merge/review, issues.create/list/linkCase, statuses.create, webhooks.create. verifyWebhook(body, headers, secret) from '@sypnia/git/webhooks' returns a typed event or throws. [Engine, Cloud] - [The CLI](https://git.docs.sypnia.com/tools/cli.md): Commands: login/logout (device flow; installs git-credential-sypnia), create owner/name [--private|--internal|--public], import github owner/repo | --org, export github owner/repo | export archive, mirror github owner/repo [--stop] (one way: a read-only copy on GitHub), keys add|list|remove, deploy-keys add key.pub [--write], tokens create --repo --scope --expires, pr create|list|checkout|merge, issue create|list|link --case . [Engine, Cloud] - [MCP](https://git.docs.sypnia.com/tools/mcp.md): MCP server https://mcp.git.sypnia.com (one endpoint for the product; the token decides). Tools: list_repos, get_file (path, ref), search_code, create_branch, commit_files (to a non-protected branch), open_pull_request, comment, list_issues, create_issue, link_case (issue/PR ↔ case id). No merging into protected branches, no deleting repositories, no changing access through MCP. [Cloud] ## API reference Every endpoint of the Git API, its authentication and its errors. - [API reference: overview](https://git.docs.sypnia.com/api.md): Base https://git.api.sypnia.com/v1, shaped like GitHub's REST API where equivalent. Auth Bearer: Sypnia token or syp_git_ token. Resources: repos, branches + protection, contents, commits, statuses, pulls (+ reviews, merge), issues (+ comments, cases), keys, deploy-keys, hooks, imports/exports/mirrors. Errors {error:{code,message}}: 401, 403 forbidden/protected_branch, 404, 409 conflict, 422 invalid_request, 429 rate_limited. [Cloud] ## Architecture How Sypnia Git is built, what runs where, and why we build on an open-source engine. - [Architecture: overview](https://git.docs.sypnia.com/architecture.md): Components: edge (CloudFront for web+HTTPS git at git.app.sypnia.com; NLB for SSH at ssh.git.sypnia.com), the git engine (Forgejo, Go, GPLv3+, on ECS with repositories on EFS or EBS), Sypnia's layer (TypeScript: the Git API git.api.sypnia.com, MCP, the web interface in Sypnia's design, OIDC with auth.sypnia.com, Case: trailer reader, events to Run/Cases/webhooks, mirrors and imports as jobs), Postgres (engine metadata + Sypnia tables), S3 (LFS, release files, git bundle backups), SQS (jobs). [Engine, Cloud] - [Choosing the engine](https://git.docs.sypnia.com/architecture/engine.md): Options compared (2026-11): Forgejo (Go, GPLv3+ since v9 in 2024; community governance under Codeberg e.V.; full forge: SSH/HTTPS, PRs, issues, protection, webhooks, OAuth/OIDC login, Actions, LFS, mirrors, GitHub migration; run unmodified behind our layer) — CHOSEN. Gitea (Go, MIT; company-led since 2022, with an open-core cloud) — same features, more permissive license, governance risk. gitoxide (Rust, Apache-2.0/MIT; a client library, no forge, server side incomplete) — not usable as a server. Our own server in Rust (gitoxide + our PRs/issues/protection) — a long tail of protocol and storage edge cases; only ever worth it for the busiest paths. Managed: AWS CodeCommit (back to general availability since Nov 2025, but no forge features we could build our UI on beyond basic PRs, AWS-only), GitHub as backend via App (we would be a skin on GitHub; contradicts 'no GitHub account needed'). GitLab CE (MIT, heavy: many services, high memory). [Engine, Cloud] - [Request paths](https://git.docs.sypnia.com/architecture/request-paths.md): Push over HTTPS: CloudFront → Sypnia layer auth (Sypnia token/syp_git_ token → engine user) → Forgejo smart HTTP → pre-receive hook calls Sypnia layer (protection rules, size limits) → objects written → post-receive event → SQS → Case: trailer reader, Run trigger, webhooks, mirror job. SSH: NLB → Forgejo SSH server (key lookup via Sypnia layer) → same hooks. Merge: API → rules check (approvals, required statuses) → engine merge → events. Mirror: job pushes refs to GitHub with the App's installation token; conflicts handled per mirroring rules. [Engine, Cloud] - [Data model](https://git.docs.sypnia.com/architecture/data-model.md): Git data: bare repositories on disk (EFS or EBS per shard), path by repository id. Engine metadata (repos, users mapping, PRs, issues, reviews, protection) in Postgres (the engine's schema). Sypnia tables (schema sypnia_git): accounts (Sypnia user ↔ engine user), case_links (repo, kind commit|issue|pull, ref, case_id, cases_project), mirrors (repo, target, last_sync, state), imports/exports (job state, report), tokens (hash, scopes, expires), webhook_deliveries. S3: LFS objects, release assets, nightly git bundles + metadata dumps. [Engine, Cloud] - [On AWS](https://git.docs.sypnia.com/architecture/aws.md): AWS: CloudFront (git.app.sypnia.com web + smart HTTP; git.api.sypnia.com; mcp.git.sypnia.com) → ALB → ECS Fargate (Sypnia layer, TS) and ECS on EC2 (Forgejo, repositories on EBS gp3 per shard, or EFS for the first phase); NLB TCP 22 for ssh.git.sypnia.com; RDS Postgres (shared Sypnia cluster, own database); S3 (LFS, assets, nightly bundles, versioned, cross-region copy); SQS + DLQ (events, jobs); Lambda workers (webhooks, mirrors, imports); EventBridge (events to Run, Cases, Agent); SSM/KMS (secrets, GitHub App key). [Cloud] - [Failures](https://git.docs.sypnia.com/architecture/failures.md): Engine down → pushes and clones fail with 503, the web shows read-only from cache where possible; layer down → web/API fail, SSH keeps working for known keys (short cache); disk lost → restore from last nightly bundle + replay of the day's pushes from the event log (target RPO ≤ 24 h first, then minutes with replication); webhook target down → retries 24 h; GitHub down → mirror queued, retried; import interrupted → resumes (idempotent); Postgres failover → seconds of errors. [Engine, Cloud] - [Codebase](https://git.docs.sypnia.com/architecture/codebase.md): Repository sypnia-git: packages/git (@sypnia/git: client, webhooks, CLI incl. git-credential-sypnia), layer/ (TS: api/, mcp/, auth/ OIDC bridge, hooks/ pre-receive service, events/, jobs/ import export mirror backup), engine/ (Forgejo build and config, our patches upstreamed when possible), spec/ (OpenAPI, webhook payload schemas), deploy/. Web interface in sypnia-cloud (private). [Engine, Cloud] ## Self-hosting Run the same engine yourself, or keep your code anywhere git works. - [Self-hosting: overview](https://git.docs.sypnia.com/self-hosting.md): Self-hosting options: (1) keep any git host (GitHub, GitLab, your own) and point git.remote in sypnia.toml at it — Run, Cases and Agent still work; (2) run the engine (Forgejo) yourself with its own docs, plus Sypnia's layer (docker compose: layer + engine + Postgres) for the Sypnia API, use-case links and webhooks; sign-in with any OIDC issuer (e.g. a Sypnia Data project). [Engine] ## Security The threat model, keys and tokens, signed commits, and the checklist. - [Security: overview](https://git.docs.sypnia.com/security.md): Threats/defenses: stolen credentials (session bound to device key, 1 h git tokens, expiring fine-grained PATs hashed with prefix for scanning, SSH keys per person); history rewriting (protected branches, no force-push, audit log of ref updates); malicious pushes (size limits, pre-receive checks); secrets committed (push protection scans for known token formats and blocks); cross-tenant (authorization on every request in Sypnia's layer and the engine; repository paths by id); supply chain of the engine (pinned versions, upstream security releases applied within days); webhook spoofing (HMAC signatures). Signed commits: SSH or GPG, verified badge, rule 'require signed commits'. [Engine, Cloud] ## Sypnia Cloud Your account and organizations, limits and plans for Sypnia Git. - [Sypnia Cloud: overview](https://git.docs.sypnia.com/cloud.md): Git in Sypnia Cloud: the Sypnia account (roll-in on first use), Sypnia organizations as owners with teams and roles; plans: Git alone or inside the global Sypnia subscription; extra capacity per item (storage, LFS, mirrors); prepaid with credits topped up via PayPal. [Cloud] ## Reference Glossary, decisions still open, the changelog and common questions. - [Reference: overview](https://git.docs.sypnia.com/reference.md): Reference for Sypnia Git: glossary, design decisions, FAQ, changelog. [Engine, Cloud] - [Glossary](https://git.docs.sypnia.com/reference/glossary.md): Sypnia Git vocabulary: repository, branch rule, pull request, required check, trailer, mirror (read-only, to GitHub), deploy key, HTTPS token, credential helper, engine, Sypnia layer, sypnia.toml. [Engine, Cloud] - [Design decisions](https://git.docs.sypnia.com/reference/decisions.md): Design decisions of Sypnia Git: the engine is Forgejo behind Sypnia's layer; licenses: @sypnia/git (CLI and client) MIT, Sypnia's layer AGPL-3.0, changes to the git engine under its own GPL; repository storage on EFS, with EBS per shard for large or busy repositories; work happens in Sypnia Git and GitHub is a read-only mirror, one way; issues and pull requests sync with GitHub at import and export, not continuously; push protection for secrets is on by default; plans are prepaid, Git alone or inside the Sypnia subscription. [Engine, Cloud] - [FAQ](https://git.docs.sypnia.com/reference/faq.md): FAQ: do I need GitHub (no); can I keep GitHub (yes, mirror); will my tools work (any git client; GitHub-shaped webhooks and API); can I leave (export in one command); is it built from scratch (no, on an open-source engine); GitHub Actions (workflow files are kept; Run or any CI runs builds). [Engine, Cloud] - [Changelog](https://git.docs.sypnia.com/reference/changelog.md): Changelog for Sypnia Git docs. [Engine, Cloud]