Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ archives:
checksum:
name_template: "checksums.txt"

release:
extra_files:
# Attach the installer so each release carries a tag-pinned copy
# (the canonical, always-latest copy is raw.githubusercontent.com/.../main/install.sh).
- glob: ./install.sh

changelog:
sort: asc
filters:
Expand Down
5 changes: 3 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ go test ./... # unit tests (all tests NOT tagged //go:build
go test -tags e2e ./internal/server/... # e2e tests (separate CI job; required check)
go test ./internal/store/ -run TestName # single package / single test
make templ # regenerate templ → *_templ.go after editing dashboard .templ files
./setup.sh # link repo skills/* into .claude/skills, .codex/skills, .gemini/skills
./setup.sh # link repo skills/* into .claude/skills, .codex/skills, .gemini/skills (DEV-ONLY — not the user installer)
./install.sh # END-USER installer/upgrader: latest release binary + Claude Code plugin (curl-able from raw.githubusercontent.com)
```

CI (`.github/workflows/ci.yml`) runs exactly `go test ./...` and the e2e job — no separate lint step. There is no Makefile build target; `make` only wraps templ generation.
CI (`.github/workflows/ci.yml`) runs `go test ./...`, the e2e job, and an `install-script` job (bash -n + shellcheck + live install/upgrade smoke of install.sh) — no separate Go lint step. There is no Makefile build target; `make` only wraps templ generation.

## Skills Are Mandatory

Expand Down
35 changes: 32 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Three things differ from upstream. If you have used upstream engram before, thes
| Area | Upstream (`Gentleman-Programming`) | This fork (`relytcloud`) |
| --- | --- | --- |
| **Storage** | Local SQLite only | Local SQLite **+ optional per-project MemoryLake backend** (`engram memorylake …`) |
| **Install** | `brew install gentleman-programming/tap/engram` | **GitHub Release archives** (no Homebrew tap) — download or build from source |
| **Install** | `brew install gentleman-programming/tap/engram` | `curl -fsSL https://raw.githubusercontent.com/relytcloud/engram/main/install.sh \| bash` (binary + plugin; no Homebrew tap) |
| **Claude Code / Codex marketplace** | `claude plugin marketplace add Gentleman-Programming/engram` | `claude plugin marketplace add relytcloud/engram` — wired into `engram setup claude-code` |

Details: [Install](#install) · [Connect Your Agent](#connect-your-agent) · [Storage Backends](#storage-backends).
Expand Down Expand Up @@ -76,19 +76,48 @@ Full ownership map and flows → [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) ·

## Install

**One command** (macOS / Linux, amd64 / arm64) — installs the latest binary AND wires the Claude Code plugin:

```bash
curl -fsSL https://raw.githubusercontent.com/relytcloud/engram/main/install.sh | bash
```

What it does: discovers the **latest release automatically**, verifies the sha256 checksum, installs to `~/.local/bin/engram`, then runs `engram setup claude-code` (plugin marketplace + plugin + MCP config). **Upgrading = re-run the same command** — it refreshes both the binary and the plugin assets.

Options go after `bash -s --`:

```bash
curl -fsSL https://raw.githubusercontent.com/relytcloud/engram/main/install.sh \
| bash -s -- --dir /usr/local/bin --no-plugin
```

| Flag | Meaning |
|---|---|
| `--version X.Y.Z` | pin a release instead of the latest |
| `--dir <path>` | install directory (default `~/.local/bin`) |
| `--no-plugin` | binary only, skip Claude Code wiring |
| `--force` | reinstall even if already at the target version |
| `--dry-run` | show what would happen, change nothing |
| `--protocol slim` | enable the compact memory protocol during setup |

### Manual install

Engram ships prebuilt, statically-linked binaries on the **[Releases page](https://github.com/relytcloud/engram/releases)** for **macOS / Linux / Windows × amd64 / arm64**. No Homebrew, no Node, no Python, no Docker — **one binary, one SQLite file**.

Pick your `os_arch` from the release assets (`uname -sm` tells you which):

```bash
VER=0.2.0 # latest tag on the Releases page
# resolve the latest tag automatically (or set VER=X.Y.Z from the Releases page)
VER=$(curl -fsSLI -o /dev/null -w '%{url_effective}' \
https://github.com/relytcloud/engram/releases/latest | sed 's|.*/tag/v||')

# macOS Apple Silicon shown; swap darwin_arm64 for darwin_amd64 / linux_amd64 / linux_arm64
curl -fsSL -o engram.tar.gz \
"https://github.com/relytcloud/engram/releases/download/v${VER}/engram_${VER}_darwin_arm64.tar.gz"
tar -xzf engram.tar.gz engram
mkdir -p ~/.local/bin
install -m 0755 engram ~/.local/bin/engram # make sure ~/.local/bin is on your PATH
engram version # → 0.2.0
engram version
```

> macOS binaries are ad-hoc signed (not notarized). If Gatekeeper blocks the first run:
Expand Down
12 changes: 12 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,23 @@ GitHub Release archives. (Homebrew was intentionally dropped; do not re-add a

## Installing a released binary

Preferred — the installer script (auto-discovers the latest release, verifies
sha256, installs the binary AND wires the Claude Code plugin):

```bash
curl -fsSL https://raw.githubusercontent.com/relytcloud/engram/main/install.sh | bash
# pin a specific release instead:
curl -fsSL https://raw.githubusercontent.com/relytcloud/engram/main/install.sh | bash -s -- --version X.Y.Z
```

Manual (pinned-version) alternative:

```bash
# Example: linux/amd64
curl -fsSL -o engram.tar.gz \
https://github.com/relytcloud/engram/releases/download/vX.Y.Z/engram_X.Y.Z_linux_amd64.tar.gz
tar -xzf engram.tar.gz engram
mkdir -p ~/.local/bin
install -m 0755 engram ~/.local/bin/engram # ensure ~/.local/bin is on PATH
engram --version
```
Expand Down
63 changes: 52 additions & 11 deletions docs/INSTALL.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,40 @@ Engram 是给 AI 编码 agent 用的**持久记忆**服务:单个 Go 二进制,

---

## 一、安装二进制
## 零、一键安装(推荐)

有两种方式:**下载预编译包(推荐)** 或 **从源码编译**。
一条命令完成「二进制安装 + Claude Code 插件接入」,自动发现并使用**最新版本**:

```bash
curl -fsSL https://raw.githubusercontent.com/relytcloud/engram/main/install.sh | bash
```

它会:自动解析最新 release 版本 → 下载对应平台包并**校验 sha256** → 安装到 `~/.local/bin/engram` → 运行 `engram setup claude-code`(注册插件市场 + 装插件 + 写 MCP 配置)→ 升级时自动刷新插件资产。**升级 = 重跑同一条命令**。

传参数用 `bash -s --`:

```bash
curl -fsSL https://raw.githubusercontent.com/relytcloud/engram/main/install.sh \
| bash -s -- --dir /usr/local/bin --no-plugin
```

| 参数 | 含义 |
|---|---|
| `--version X.Y.Z` | 锁定指定版本(默认自动用最新) |
| `--dir <路径>` | 安装目录(默认 `~/.local/bin`) |
| `--no-plugin` | 只装二进制,跳过 Claude Code 插件 |
| `--force` | 版本相同也强制重装 |
| `--dry-run` | 只打印将做什么,不改任何东西 |
| `--protocol slim` | 安装时启用紧凑记忆协议 |

> 脚本仅支持 macOS / Linux(amd64/arm64);Windows 请看下方手动步骤。
> 非交互管道下,allowlist 授权提问会被自动跳过(脚本会提示如何补做)。

---

## 一、手动安装二进制

不想用一键脚本时,有两种方式:**下载预编译包** 或 **从源码编译**。

### 方式 A:下载预编译 release 包(推荐)

Expand Down Expand Up @@ -69,10 +100,15 @@ install -m 0755 engram ~/.local/bin/engram

```bash
curl -fsSL -O "https://github.com/relytcloud/engram/releases/download/v${VER}/checksums.txt"
shasum -a 256 -c checksums.txt --ignore-missing # macOS
# sha256sum -c checksums.txt --ignore-missing # Linux
# 注意:macOS 的 BSD shasum 不支持 --ignore-missing,用 awk 精确比对(两平台通用):
PKG="engram_${VER}_darwin_arm64.tar.gz" # 换成你下载的包名
expected=$(awk -v f="$PKG" '$2 == f {print $1}' checksums.txt)
actual=$(shasum -a 256 "$PKG" | awk '{print $1}') # Linux 用 sha256sum
[ "$expected" = "$actual" ] && echo OK || echo "校验失败,不要安装"
```

> 一键脚本(上文「零」节)默认自动做这一步。

### 方式 B:从源码编译

需要 Go 1.25+。产物与 release 包一致(纯 Go,无需 CGO)。
Expand Down Expand Up @@ -126,7 +162,7 @@ engram setup claude-code
它会自动做三件事:

1. `claude plugin marketplace add relytcloud/engram`(注册插件市场,幂等);
2. `claude plugin install engram@engram`(安装插件:hooks + skills);
2. `claude plugin install engram`(安装插件:hooks + skills;代码当前用的是不带限定的插件名);
3. 写入用户级 MCP 配置 `~/.claude/mcp/engram.json`,内容形如:

```json
Expand Down Expand Up @@ -169,17 +205,22 @@ rm -f ~/.claude/mcp/engram.json # 删 MCP 配置

### 老用户升级(v0.4.0 重要)

v0.4.0 同时更新了**二进制**和**插件资产**(hooks 协议文本、skills),两者都要升级才能获得完整效果:
v0.4.0 同时更新了**二进制**和**插件资产**(hooks 协议文本、skills),两者都要升级才能获得完整效果。**最简单:重跑一键安装脚本**,二进制和插件一次到位:

```bash
curl -fsSL https://raw.githubusercontent.com/relytcloud/engram/main/install.sh | bash
```

手动路径(等价):

```bash
# 1) 更新二进制(重复安装步骤下载 v0.4.0 包,覆盖旧二进制即可)

# 2) 更新插件(hooks + skills)。最简单:重跑一键接入(幂等,会重装插件并修正 MCP 配置)
# 2) 更新插件(hooks + skills)。重跑一键接入(幂等,会重装插件并修正 MCP 配置)
engram setup claude-code

# 或者手动刷新插件市场再更新:
# claude plugin marketplace update engram
# claude plugin update engram@engram
# 再刷新插件资产(plugin install 对已装插件是 no-op,不会拉新 hooks/skills):
claude plugin marketplace update engram
claude plugin update engram@engram

# 3) 重启 Claude Code 加载新插件
```
Expand Down
52 changes: 23 additions & 29 deletions docs/INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Installation

- [Homebrew (macOS / Linux)](#homebrew-macos--linux)
- [Quick install (macOS / Linux)](#quick-install-macos--linux)
- [Windows](#windows)
- [Install from source (macOS / Linux)](#install-from-source-macos--linux)
- [Download binary (all platforms)](#download-binary-all-platforms)
Expand All @@ -12,49 +12,43 @@

---

## Homebrew (macOS / Linux)
## Quick install (macOS / Linux)

```bash
brew install gentleman-programming/tap/engram
```

Upgrade to latest:
One command installs the latest binary AND wires the Claude Code plugin
(this fork ships no Homebrew tap — the tap in older docs belongs to upstream):

```bash
brew update && brew upgrade engram
curl -fsSL https://raw.githubusercontent.com/relytcloud/engram/main/install.sh | bash
```

> **Migrating from Cask?** If you installed engram before v1.0.1, it was distributed as a Cask. Uninstall first, then reinstall:
> ```bash
> brew uninstall --cask engram 2>/dev/null; brew install gentleman-programming/tap/engram
> ```

> **Keep `engram serve` running across `brew upgrade`?** On macOS, `brew upgrade engram` replaces the binary and kills any running `engram serve` process — autosync stops silently until you relaunch it. To make autosync survive upgrades and reboots, use the launchd template in [Running as a Service → Using launchd (macOS)](../DOCS.md#using-launchd-macos). Run `engram cloud status` afterwards: the `Local daemon:` line should report `running`.
The script auto-discovers the latest release, verifies the sha256 checksum,
installs to `~/.local/bin/engram`, and runs `engram setup claude-code`.
Upgrade = re-run the same command. Options go after `bash -s --`:
`--version X.Y.Z`, `--dir <path>`, `--no-plugin`, `--force`, `--dry-run`,
`--protocol slim`. The script supports macOS/Linux (amd64/arm64) only —
Windows users see below.

---

## Windows

**Option A: Install via `go install` (recommended for technical users)**

If you have Go installed, this is the cleanest and most trustworthy path — the binary is compiled on your machine from source, so no antivirus will flag it:
**Option A: Build from source (recommended for technical users)**

```powershell
go install github.com/Gentleman-Programming/engram/cmd/engram@latest
# Binary goes to %GOPATH%\bin\engram.exe (typically %USERPROFILE%\go\bin\)
```
If you have Go installed, this is the cleanest and most trustworthy path — the binary is compiled on your machine from source, so no antivirus will flag it.

Ensure `%GOPATH%\bin` (or `%USERPROFILE%\go\bin`) is on your `PATH`.

**Option B: Build from source**
> Do NOT use `go install github.com/...@latest` for this fork: the Go module
> path still points at the upstream repo, so `go install` would fetch
> upstream code, not this fork. Clone and build instead:

```powershell
git clone https://github.com/Gentleman-Programming/engram.git
git clone https://github.com/relytcloud/engram.git
cd engram
go install ./cmd/engram
# Binary goes to %GOPATH%\bin\engram.exe (typically %USERPROFILE%\go\bin\)
```

Ensure `%GOPATH%\bin` (or `%USERPROFILE%\go\bin`) is on your `PATH`.

> **Want a real version string instead of `dev`?**
>
> `go install` always stamps the binary as `dev`. To get a meaningful version, pick one of these — not both. Running them both leaves two binaries on disk and `engram version` keeps reporting `dev` because PATH still resolves to the `go install` build.
Expand All @@ -78,7 +72,7 @@ go install ./cmd/engram

**Option C: Download the prebuilt binary**

1. Go to [GitHub Releases](https://github.com/Gentleman-Programming/engram/releases)
1. Go to [GitHub Releases](https://github.com/relytcloud/engram/releases)
2. Download `engram_<version>_windows_amd64.zip` (or `arm64` for ARM devices)
3. Extract `engram.exe` to a folder in your `PATH` (e.g. `C:\Users\<you>\bin\`)

Expand Down Expand Up @@ -120,7 +114,7 @@ Expand-Archive engram_*_windows_amd64.zip -DestinationPath "$env:USERPROFILE\bin
## Install from source (macOS / Linux)

```bash
git clone https://github.com/Gentleman-Programming/engram.git
git clone https://github.com/relytcloud/engram.git
cd engram
go install ./cmd/engram
# Binary goes to $GOPATH/bin (typically ~/go/bin/)
Expand Down Expand Up @@ -149,7 +143,7 @@ go install ./cmd/engram

## Download binary (all platforms)

Grab the latest release for your platform from [GitHub Releases](https://github.com/Gentleman-Programming/engram/releases).
Grab the latest release for your platform from [GitHub Releases](https://github.com/relytcloud/engram/releases).

| Platform | File |
|----------|------|
Expand All @@ -164,7 +158,7 @@ Grab the latest release for your platform from [GitHub Releases](https://github.

## Requirements

- **Go 1.24+** to build from source (not needed if installing via Homebrew or downloading a binary)
- **Go 1.25+** to build from source (not needed if using the quick-install script or downloading a binary)
- That's it. No runtime dependencies.

The binary includes SQLite (via [modernc.org/sqlite](https://pkg.go.dev/modernc.org/sqlite) — pure Go, no CGO). Works natively on **macOS**, **Linux**, and **Windows** (x86_64 and ARM64).
Expand Down
Loading