MCPcopy Index your code
hub / github.com/DanConwayDev/ngit-cli

github.com/DanConwayDev/ngit-cli @v2.6.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.6.1 ↗ · + Follow
1,816 symbols 5,873 edges 122 files 401 documented · 22%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

ngit

nostr plugin for git

  • clone a nostr repository, or add as a remote, by using the url format nostr:///
  • remote branches beginning with pr/ are open PRs from contributors; ngit list can be used to view all PRs
  • to open a PR, push a branch with the prefix pr/ or use ngit send for advanced options
  • publish a repository to nostr with ngit init

browse gitworkshop.dev/repos to find nostr repositories.

install

install options:

  1. live on the edge with one-line install: curl -Ls https://ngit.dev/install.sh | bash
  2. build from source: clone this repository, install rust and cargo, checkout the latest release tag, run cargo build --release and move ./target/release/ngit and ./target/release/git-remote-nostr to your PATH.
  3. install with cargo: install rust and cargo, run cargo install ngit, maken sure ~/.cargo/bin is in your PATH
  4. install with nix: add ngit.url = "github:DanConwayDev/ngit-cli"; as a flake input and then include inputs.ngit.packages."${pkgs.system}".default in packages.
  5. download the latest release binaries from gitworkshop.dev/ngit and add to PATH

run the commands ngit and git-remote-nostr to ensure the binaries are in your PATH.

configuration

Run ngit --customize to list supported git config keys and their environment-variable overrides. Useful examples:

git config nostr.repo-relay-only true       # only publish nostr events to repo relays
git config nostr.http-io-timeout-ms 600000 # allow large GRASP pushes up to 10 minutes of socket silence

contributions welcome!

gitworkshop.dev/danconwaydev.com/ngit to report issues and see PRs

use ngit to submit PRs with clone url: nostr://danconwaydev.com/relay.ngit.dev/ngit

primer

nostr is a decentralised communications protocol with:

  • permissionless account creation - created via a public/private key pair
  • verifiable signed messages
  • messages transported via relays rather than P2P

for code collaboration, nostr is used for:

  • repository identification and discovery
  • state (ie. git refs)
  • proposals (PRs), issues and related discussion

a git server is still required for data storage and syncing state. multiple git servers can be used for reduncancy and they can be seemlessly swapped out by maintainers just like nostr relays. see maintainer model for details on how multi-maintainer repositories work.

eg self-hosted, github, codeberg, etc.

             ┌──────────┐
             │  Author  │
             └──/─┬─\───┘
        ,------'  │  '--------.-------.
┌──────▼─┐   ┌────▼───┐   ┌───▼───┐  ┌─▼─────┐  ┌───────┐
│  Git   │   │  Git   │   │ Relay │  │ Relay │  │ Relay │
│ Server │   │ Server │   │       │  │       │  │       │
└────────┘   └────\───┘   └───┬───┘  └──/────┘  └─/─────┘
                   \------.   │   ,----/---------/
                         ┌─▼──▼──▼─┐
                         │  User   │
                         └─────────┘

Extension points exported contracts — how you extend this code

UrlWithoutSlash (Interface)
(no doc) [1 implementers]
src/lib/mod.rs
Connect (Interface)
(no doc) [1 implementers]
src/lib/client.rs
InteractorPrompt (Interface)
(no doc) [1 implementers]
src/lib/cli_interactor.rs
RepoActions (Interface)
(no doc) [1 implementers]
src/lib/git/mod.rs

Core symbols most depended-on inside this repo

clone
called by 631
test_harness/src/repo.rs
is_empty
called by 339
src/lib/list.rs
git_ok
called by 157
test_harness/src/repo.rs
dir
called by 117
test_harness/src/repo.rs
events
called by 110
test_harness/src/grasp.rs
grasp
called by 108
test_harness/src/harness.rs
git
called by 101
test_harness/src/repo.rs
ngit
called by 75
test_harness/src/repo.rs

Shape

Function 1,390
Method 267
Class 128
Enum 27
Interface 4

Languages

Rust100%

Modules by API surface

src/lib/git/mod.rs148 symbols
src/lib/repo_ref.rs89 symbols
src/lib/client.rs74 symbols
src/lib/git/nostr_url.rs67 symbols
src/bin/git_remote_nostr/push.rs67 symbols
src/lib/git_events.rs52 symbols
src/lib/list.rs43 symbols
src/bin/ngit/sub_commands/sync.rs42 symbols
test_harness/src/scenarios.rs40 symbols
src/lib/cli_interactor.rs35 symbols
tests/git_push_merge.rs34 symbols
src/lib/mbox_parser.rs33 symbols

For agents

$ claude mcp add ngit-cli \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact