# Repos

Repos need no outside account or token. Every push saves a full snapshot as commit 1, 2, 3 …; deploying an older number is a rollback. An assistant connected over MCP can create a repo, push what it wrote and put a commit live in one conversation (create_repo, push_files, get_repo_files, deploy_repo, list_repos, update_repo, copy_repo, search_public_repos).

Every project has its own repo, which every upload deploy commits to: with the project docs and the Roadmap, it is the project's memory (see Repos: project memory). A push answers the commit number, `docs.missing` (the project docs the repo still lacks) and `todo`, what the project still lacks.

## In plain words

A place inside Harakumo to keep your app's code, with every saved version numbered, so any version can be put live again.

For example: An AI assistant saves each change as a new version. If version 8 breaks something, you put version 7 back.

## Limits

- A push over REST: up to 500 files, 10 MB per file, 25 MB in total. One push_files tool call is smaller (300 files of about 600 KB), so large projects push over REST or in parts.
- Text files up to 512 KB read back one by one; larger and binary files are listed with their size. Binary files are pushed base64-encoded (`"base64": true`).
- Environment files (.env and friends) are never readable back through the API. Do not commit secrets.
- Repos are workspace-wide: project keys cannot use them.
- Written through the API and the AI connector, and browsed in Repos (repos.harakumo.com), which shows every repo in your workspaces with its files and commits. There is no git push or SDK method for repos yet.

## Reference

**SDK**

```js
// Repos are reached over REST or the AI connector; the SDK has no repo methods yet.
```

**REST**

```http
GET    /api/repos                    # every repo, with commit counts
GET    /api/repos/explore?q=&sort=stars   # public repos anyone can read or copy; no sign-in needed
POST   /api/repos                    { "name": "school-site", "description"? }
GET    /api/repos/:id                # the repo and its commit history
PATCH  /api/repos/:id                { "name"?: "new-name", "description"? }   # history stays; the repo's address changes
POST   /api/repos/:id/commits        { "message": "…", "files": [{ "path": "index.html", "content": "…" }] }
POST   /api/repos/:id/commits        { "keep": true, "files": [{ "path": "docs/ARCHITECTURE.md", "content": "…" }], "remove"?: ["old.js"] }   # only these change; every other file stays
# A push answers { commit, docs?: { missing }, todo, note }: todo lists what the project still lacks
GET    /api/repos/:id/files?commit=2                  # file tree at a commit (default: latest)
GET    /api/repos/:id/files?commit=2&path=index.html  # one file
POST   /api/repos/:id/deploy         { "projectId": 12, "commit": 1 }   # an older commit is a rollback
POST   /api/repos/:id/copy           { "name"?, "description"? }   # "Use this template": a public repo, or one of yours, as commit 1 of a new repo here
DELETE /api/repos/:id
```
