Skip to content

Turbocharge Claude Code, Cursor, Codex, Gemini & every coding agent: faster, cheaper, with contextual understanding specific to your codebase.

Point installer/docs at NanoNets repo; support local-checkout install

anirudhkumar-nanonets0741132e1f57
diff --git a/DEMO.md b/DEMO.md
index 5a8be812..caf5c157 100644
--- a/DEMO.md
+++ b/DEMO.md
@@ -67,7 +67,7 @@ There are 3 demo PDFs already generated in `examples/demo-docs/` (fictional "Nor
### Step 1 — Install
```bash
# the one-liner your manager asked for (once the repo URL is filled in):
-curl -fsSL https://raw.githubusercontent.com/YOUR_ORG/context-graph-engine/main/install.sh | sh
+curl -fsSL https://raw.githubusercontent.com/NanoNets/context-graph-engine/main/install.sh | sh
# …or, from this checkout, for today:
npm install && npm run build && npm link
@@ -137,15 +137,19 @@ context-graph --db ./northwind-demo.db stats
---
-## 6. One loose end before publishing
+## 6. Repository & install
-`install.sh` and the README's `curl` command still contain a placeholder repo URL:
+Published to **`github.com/NanoNets/context-graph-engine`** (private, branch `main`).
-```
-https://github.com/YOUR_ORG/context-graph-engine.git
+```bash
+git clone [email protected]:NanoNets/context-graph-engine.git
+cd context-graph-engine && ./install.sh # build + link the local checkout
```
-Once this is pushed to GitHub, replace `YOUR_ORG/context-graph-engine` in **`install.sh`** and **`README.md`** (the local branch is `master`; the installer/README reference `main` — align those too). After that the one-line install is live. Not needed for today's demo — the library/CLI/MCP paths all run straight from the repo.
+> ⚠️ The `curl … | sh` one-liner in the README fetches `install.sh` over an
+> anonymous URL, which only works once the repo is **public** (or with a token).
+> While the repo is private, use the clone + `./install.sh` path above. Flip the
+> repo to public when you're ready and the curl one-liner goes live as-is.
---
diff --git a/README.md b/README.md
index 29194825..7e5e1caa 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ Access it three ways: as a **library**, a **CLI**, or an **MCP server** that any
**One line, runs locally, no API keys required:**
```bash
-curl -fsSL https://raw.githubusercontent.com/YOUR_ORG/context-graph-engine/main/install.sh | sh
+curl -fsSL https://raw.githubusercontent.com/NanoNets/context-graph-engine/main/install.sh | sh
```
This puts `context-graph` and `context-graph-mcp` on your PATH. Requires git and Node ≥ 20.
diff --git a/install.sh b/install.sh
index 4d870d2d..f2df3430 100755
--- a/install.sh
+++ b/install.sh
@@ -1,20 +1,20 @@
#!/usr/bin/env sh
# Context Graph Engine — one-line installer.
#
-# curl -fsSL https://raw.githubusercontent.com/YOUR_ORG/context-graph-engine/main/install.sh | sh
+# Two ways to use it:
+# 1. From a checkout: ./install.sh (builds THIS directory — no re-clone)
+# 2. Over the network: curl -fsSL https://raw.githubusercontent.com/NanoNets/context-graph-engine/main/install.sh | sh
#
-# Clones the repo, builds it, and puts the `context-graph` and
+# Either way it builds the project and puts the `context-graph` and
# `context-graph-mcp` commands on your PATH. Requires git, Node >= 20, and npm.
#
# Environment overrides:
-# CGE_REPO git URL to install from (default: the YOUR_ORG repo below)
-# CGE_REF branch/tag/commit to check out (default: main)
-# CGE_HOME where to install (default: ~/.context-graph-engine)
+# CGE_REPO git URL to clone from (default: the NanoNets repo below)
+# CGE_REF branch/tag/commit to fetch (default: main)
+# CGE_HOME where to clone into (default: ~/.context-graph-engine)
set -eu
-# ---- EDIT THIS to point at your published repository -------------------------
-REPO_URL="${CGE_REPO:-https://github.com/YOUR_ORG/context-graph-engine.git}"
-# ------------------------------------------------------------------------------
+REPO_URL="${CGE_REPO:-https://github.com/NanoNets/context-graph-engine.git}"
REF="${CGE_REF:-main}"
INSTALL_DIR="${CGE_HOME:-$HOME/.context-graph-engine}"
@@ -25,7 +25,6 @@ need() {
command -v "$1" >/dev/null 2>&1 || { err "'$1' is required but not installed. $2"; exit 1; }
}
-need git "Install git and re-run."
need node "Install Node.js >= 20 from https://nodejs.org and re-run."
need npm "Install npm (bundled with Node.js) and re-run."
@@ -36,14 +35,29 @@ if [ "$NODE_MAJOR" -lt 20 ]; then
exit 1
fi
-if [ -d "$INSTALL_DIR/.git" ]; then
- info "Updating existing install at $INSTALL_DIR"
- git -C "$INSTALL_DIR" fetch --depth 1 origin "$REF"
- git -C "$INSTALL_DIR" checkout -q "$REF"
- git -C "$INSTALL_DIR" reset --hard -q "origin/$REF" 2>/dev/null || true
+# If this script lives inside a checkout of the project, build that in place
+# rather than cloning (works offline and for private repos). Detected by a
+# sibling package.json naming this package. When piped via `curl | sh` there is
+# no script file on disk, so this check falls through to the clone path.
+SCRIPT_DIR=""
+case "${0:-}" in
+ */*) SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" 2>/dev/null && pwd) || SCRIPT_DIR="" ;;
+esac
+
+if [ -n "$SCRIPT_DIR" ] && grep -q '"context-graph-engine"' "$SCRIPT_DIR/package.json" 2>/dev/null; then
+ INSTALL_DIR="$SCRIPT_DIR"
+ info "Installing from local checkout at $INSTALL_DIR"
else
- info "Cloning $REPO_URL → $INSTALL_DIR"
- git clone --depth 1 --branch "$REF" "$REPO_URL" "$INSTALL_DIR"
+ need git "Install git and re-run."
+ if [ -d "$INSTALL_DIR/.git" ]; then
+ info "Updating existing install at $INSTALL_DIR"
+ git -C "$INSTALL_DIR" fetch --depth 1 origin "$REF"
+ git -C "$INSTALL_DIR" checkout -q "$REF"
+ git -C "$INSTALL_DIR" reset --hard -q "origin/$REF" 2>/dev/null || true
+ else
+ info "Cloning $REPO_URL → $INSTALL_DIR"
+ git clone --depth 1 --branch "$REF" "$REPO_URL" "$INSTALL_DIR"
+ fi
fi
info "Installing dependencies"