@noya-app/git-remote
v1.0.1
Published
Noya git services
Readme
@noya-app/git-remote
A lightweight Git HTTP building block library built with isomorphic-git, running on an in-memory filesystem. A Hono-based server and CLI now live in apps/git-server.
Features
- Multi-repo support with
/:owner/:repoURL structure - Git Smart HTTP protocol helpers (clone/fetch via git-upload-pack, push via git-receive-pack)
- In-memory storage via
buffs/memory-fswith optional pluggable persistence - TypeScript with modular architecture
- Can be used as a library or with the
apps/git-serverdev server
Installation
npm installUsage
As a Library
import {
registry,
fs,
MemoryStorage,
advertiseRefs,
receivePack,
uploadPack,
} from "@noya-app/git-remote";
// Use the git-service helpers inside your own HTTP framework.Dev Server (apps/git-server)
Start the development server (uses Hono) from the workspace root:
bun run dev --filter '@noya-app/git-server'Optionally append
-- --bootstrapto create a test repo on startup (e.g.bun run dev --filter '@noya-app/git-server' -- --bootstrap)
Build for production:
bun run build --filter '@noya-app/git-server'Run tests:
npm run testAPI Endpoints
Repository Management
| Method | Path | Description |
| ------ | ------------------------- | --------------------- |
| POST | /api/repos | Create a repository |
| GET | /api/repos | List all repositories |
| GET | /api/repos/:owner/:name | Get repository info |
| DELETE | /api/repos/:owner/:name | Delete a repository |
Git Protocol
| Method | Path | Description |
| ------ | -------------------------------- | ------------------------- |
| GET | /:owner/:repo/info/refs | Service advertisement |
| POST | /:owner/:repo/git-upload-pack | Pack upload (clone/fetch) |
| POST | /:owner/:repo/git-receive-pack | Pack receive (push) |
Examples
Create a repository:
curl -X POST http://localhost:3000/api/repos \
-H "Content-Type: application/json" \
-d '{"owner": "alice", "name": "my-project"}'List repositories:
curl http://localhost:3000/api/reposClone a repository:
git clone http://localhost:3000/alice/my-projectPush to a repository:
cd my-project
echo "Hello" > README.md
git add .
git commit -m "Initial commit"
git push origin mainLicense
MIT
