Git Push with Nostr
Use your Nostr identity to push to JSS repositories.
Prerequisites
- JSS running with
--gitenabled - Node.js installed
Install credential helper
npm install -g git-credential-nostr
Generate keypair
git-credential-nostr generate
Output:
Generated new Nostr keypair:
Private key: a1b2c3...
Public key: d4e5f6...
WebID: did:nostr:d4e5f6...
Setup:
git config --global nostr.privkey a1b2c3...
Configure git
git config --global credential.helper nostr
git config --global nostr.privkey <your-private-key>
Create repository ACL
cd myrepo
git-credential-nostr acl > .acl
git add .acl
git commit -m "Add ACL"
This creates an ACL with:
- Your Nostr identity as owner (full access)
- Public read access (for
git clone)
Push
git push origin main
The credential helper automatically generates a NIP-98 token. JSS verifies the signature and allows the push.
How it works
- Git requests credentials
git-credential-nostrgenerates a NIP-98 event (kind 27235)- Token sent as Basic Auth password
- JSS verifies Nostr signature
- Push proceeds if ACL allows