Skip to content

chore(release): v0.9.13 — .env.example + init command + sync-checker (#372)#383

Merged
rohitg00 merged 2 commits into
mainfrom
feat/env-example-372
May 15, 2026
Merged

chore(release): v0.9.13 — .env.example + init command + sync-checker (#372)#383
rohitg00 merged 2 commits into
mainfrom
feat/env-example-372

Conversation

@rohitg00
Copy link
Copy Markdown
Owner

@rohitg00 rohitg00 commented May 15, 2026

Summary

Closes #372. Ships the config-discovery surface that's been gating new-user onboarding since v0.9.0.

Three new artifacts

File Purpose
.env.example (repo root, bundled in npm tarball via files) Single documented source for every env var read by src/. Every line commented out so the file is a template.
agentmemory init (new CLI command) Copies bundled .env.example to ~/.agentmemory/.env if absent. Refuses to overwrite; prints a diff command pointing at the latest template.
scripts/check-env-example.mjs (CI gate) Fails CI when src/ reads an env var that isn't documented (or vice-versa). Plugged into .github/workflows/ci.yml after npm test. Bootstrap: 60 keys in sync.

Closes / supersedes

Release cut

Same PR bumps 0.9.12 → 0.9.13 across the 9 standard files (version.ts, package.json × 2, plugin.json × 2, types.ts ExportData union, supportedVersions Set, test expected version). v0.9.13 release notes in CHANGELOG.md cover the wave landed since v0.9.12:

Verification

  • npm test — 903 / 903 passing
  • npm run build — clean (.env.example copied into dist/ by build script)
  • node scripts/check-env-example.mjsenv-example: in sync (60 keys documented)
  • agentmemory init smoke — creates ~/.agentmemory/.env on first run, refuses overwrite on second with diff hint

Test plan

  • npm test
  • npm run build
  • Init smoke against a clean HOME
  • Tag v0.9.13 after merge, publish via existing workflow

Summary by CodeRabbit

  • New Features

    • Added an init CLI command to create per-user configuration from a bundled template.
    • Bundled a comprehensive .env example documenting provider, embedding, security, tuning, behavior, CLI/runtime, and integration options.
  • Documentation

    • Published changelog entry for v0.9.13 with added examples, deploy templates, tokenizer and benchmarking notes, and security updates.
  • Chores

    • Bumped package/plugin versions to 0.9.13 and included the .env example in published files.
    • Added a CI/check tool to verify .env example is in sync with code.

Review Change Stack

harness + deploy templates + Gemini GA bumps + 14 advisories closed

Six PRs landed since v0.9.12:

- #372 .env.example discovery (this commit) — repo-root template + `init`
  CLI command + CI sync-checker
- #362 CJK BM25 tokenizer (`@node-rs/jieba` + tiny-segmenter + Hangul)
- #363 `benchmark/load-100k.ts` harness with p50/p90/p99 + per-release
  results dir
- #361 one-click deploy templates for fly.io / Railway / Render / Coolify
  (multi-stage Dockerfile, `iiidev/iii` base, `gosu` privilege drop,
  first-boot HMAC, verified end-to-end on fly.io)
- #364 Python ecosystem via `iii-sdk` example (replaces closed PR #360)
- #370 Gemini GA bumps (LLM default → gemini-2.5-flash, embedding →
  gemini-embedding-001 + L2-norm + 768 dims)

Plus 14 open Dependabot advisories closed in PR #348 via Next.js → 16.2.6
and PostCSS → 8.5.10 overrides.

Bumped:

- src/version.ts: VERSION 0.9.12 → 0.9.13
- package.json: 0.9.12 → 0.9.13, files += ".env.example", build script
  copies .env.example into dist/
- packages/mcp/package.json: 0.9.12 → 0.9.13 (lockstep with main)
- plugin/.claude-plugin/plugin.json, plugin/.codex-plugin/plugin.json:
  0.9.12 → 0.9.13
- src/types.ts: ExportData.version union extended with "0.9.13"
- src/functions/export-import.ts: supportedVersions Set extended
- test/export-import.test.ts: expected version updated

New surface:

- .env.example at repo root — every env var read by src/ documented in
  one place, grouped by surface (LLM, embedding, auth, search tuning,
  behaviour flags, CLI runtime, ports, iii engine pin, Claude Code
  bridge, Obsidian export). Every line commented out by default so the
  file is a template.
- agentmemory init — copies bundled .env.example to ~/.agentmemory/.env
  if absent, refuses to overwrite, prints a diff command. Wired into
  CLI dispatch + help block.
- scripts/check-env-example.mjs — walks src/ for env-read patterns,
  fails CI on drift in either direction. Plugged into ci.yml after
  npm test. Initial bootstrap: 60 keys in sync.

Verified: npm test 903/903, npm run build clean, init smoke pass
(creates ~/.agentmemory/.env on first run, refuses overwrite on second).
@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agentmemory Ready Ready Preview, Comment May 15, 2026 9:09am

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 518b2164-577d-445a-957a-59d774667988

📥 Commits

Reviewing files that changed from the base of the PR and between 8bc9160 and 2de270f.

📒 Files selected for processing (2)
  • scripts/check-env-example.mjs
  • src/cli.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/check-env-example.mjs

📝 Walkthrough

Walkthrough

This release adds a comprehensive .env.example template (bundled into the package), a new agentmemory init command to copy it to ~/.agentmemory/.env, a CI script to validate documented env vars against source usage, and bumps version/compatibility to 0.9.13 across manifests and import logic.

Changes

Release 0.9.13: Configuration Template & CLI Bootstrap

Layer / File(s) Summary
Configuration template and NPM publishing
.env.example, package.json
New .env.example documents LLM/embedding providers, auth, search tuning, behavior flags, runtime knobs, port configuration, iii-engine pinning, and optional integrations. Build script and files whitelist updated to bundle the template into the npm tarball.
CLI init command for config bootstrap
src/cli.ts
agentmemory init copies the bundled .env.example to ~/.agentmemory/.env if the destination is missing, with fallback location detection and warning when the file already exists.
CI sync-checker for env var documentation
scripts/check-env-example.mjs
New script scans src/ for environment variable usage (via process.env, env[], getEnvVar()), compares against .env.example documented keys, and reports missing (undocumented) or orphan (unused) variables with detailed exit-code status.
Version updates and export-import compatibility
src/version.ts, package.json, packages/mcp/package.json, plugin/*, src/functions/export-import.ts, test/export-import.test.ts
All version manifests and exported VERSION constant bumped from 0.9.12 to 0.9.13; mem::import supported export versions extended to accept 0.9.13 exports; test expectations updated.
Release notes and changelog documentation
CHANGELOG.md
Publishes 0.9.13 release entry (dated 2026-05-15) documenting .env.example template, agentmemory init, CI sync-checker, CJK tokenizer, load harness, deploy templates, Python quickstart, Gemini provider defaults changes, security advisories, and external contributors.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • rohitg00/agentmemory#137: Both PRs extend the supportedVersions whitelist in src/functions/export-import.ts to recognize newly released versions in mem::import.
  • rohitg00/agentmemory#261: Both PRs update export-import version compatibility by extending supportedVersions in src/functions/export-import.ts and adjusting corresponding test expectations for a new release version.
  • rohitg00/agentmemory#173: Both PRs update the VERSION constant in src/version.ts as part of standard release versioning.

Poem

🐰 A template blooms in .env ground,
With init commands swiftly found,
CI checks sync truth and care,
From Gemini defaults laid bare,
Version 0.9.13 takes the air! 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the three main artifacts shipped in this release: .env.example template, init command, and sync-checker CI gate.
Linked Issues check ✅ Passed The PR comprehensively addresses all objectives from #372, #47, and #293: .env.example created with all documented env vars, init command copies template to ~/.agentmemory/.env, sync-checker enforces consistency, version bumped across all manifests, and release notes added.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the release objectives: version bumps (7 files), .env.example creation, init CLI implementation, sync-checker script, CHANGELOG update, and test version update.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/env-example-372

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/cli.ts (1)

899-903: ⚡ Quick win

Trim WHAT-level comments in CLI init path.

These comments describe implementation mechanics more than intent; prefer self-descriptive naming and keep only rationale-heavy comments.

As per coding guidelines, "Avoid code comments explaining WHAT — use clear naming instead".

Also applies to: 935-935

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/cli.ts` around lines 899 - 903, The leading block comment before
findEnvExample is a WHAT-level implementation detail; remove or shorten it to a
rationale-focused comment and rely on a clear function name (findEnvExample) to
convey behavior. Edit the comment(s) around findEnvExample and the similar
comment at the other occurrence (near line 935) to keep only why the lookup
exists (e.g., "Prefer packaged .env.example; fall back to repo root when running
from source") and remove step-by-step implementation notes so the code is
self-explanatory.
.env.example (1)

168-168: 💤 Low value

Add trailing newline at end of file.

The file is missing a final newline, which is a POSIX text file convention and prevents unnecessary git diff noise.

📝 Proposed fix
 # OBSIDIAN_AUTO_EXPORT=true                      # Auto-export memories to an Obsidian vault on every consolidation
+
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.env.example at line 168, Add a single trailing newline character at the end
of the .env.example file so the file ends with a newline (POSIX convention) —
update the file's EOF so the last line is terminated with a newline character.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/check-env-example.mjs`:
- Around line 32-46: Update the comment above the walk function to accurately
reflect the file extensions matched by the regex: change "Walk src/ for .ts /
.mts / .mjs files" to include .js (e.g., "Walk src/ for .ts / .mts / .mjs / .js
files") so it matches the /\. (ts|mts|mjs|js)$/.test logic in the walk function;
if instead you intended to exclude .js, remove "js" from the regex in walk so
the comment and pattern remain consistent (also consider adding an explicit
check to skip test/ paths if test exclusion is required).

In `@src/cli.ts`:
- Around line 934-939: The current init flow uses existsSync(target) +
copyFile(...) which can race; remove the pre-check and perform an exclusive copy
instead by calling copyFile(template, target, constants.COPYFILE_EXCL) (import
constants from "node:fs" or "node:fs/promises" as appropriate) so the copy fails
atomically if the target already exists; catch the specific EEXIST/EACCES error
from copyFile in the try/catch and treat it as "do not overwrite" instead of
propagating, leaving mkdir(dir, { recursive: true }) and other logic unchanged
and referencing the existing mkdir, copyFile, template, target symbols.

---

Nitpick comments:
In @.env.example:
- Line 168: Add a single trailing newline character at the end of the
.env.example file so the file ends with a newline (POSIX convention) — update
the file's EOF so the last line is terminated with a newline character.

In `@src/cli.ts`:
- Around line 899-903: The leading block comment before findEnvExample is a
WHAT-level implementation detail; remove or shorten it to a rationale-focused
comment and rely on a clear function name (findEnvExample) to convey behavior.
Edit the comment(s) around findEnvExample and the similar comment at the other
occurrence (near line 935) to keep only why the lookup exists (e.g., "Prefer
packaged .env.example; fall back to repo root when running from source") and
remove step-by-step implementation notes so the code is self-explanatory.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8d719de2-2043-48d2-aa7f-c26ec0e77ae4

📥 Commits

Reviewing files that changed from the base of the PR and between 4b354b7 and 8bc9160.

📒 Files selected for processing (11)
  • .env.example
  • CHANGELOG.md
  • package.json
  • packages/mcp/package.json
  • plugin/.claude-plugin/plugin.json
  • plugin/.codex-plugin/plugin.json
  • scripts/check-env-example.mjs
  • src/cli.ts
  • src/functions/export-import.ts
  • src/version.ts
  • test/export-import.test.ts

Comment thread scripts/check-env-example.mjs Outdated
Comment thread src/cli.ts
Two valid findings from the CodeRabbit pass on PR #383.

1. `runInit` race between existsSync(target) + copyFile(template, target).
   A parallel `agentmemory init` (or any other process touching
   ~/.agentmemory/.env between the two calls) would silently overwrite
   the config the operator just wrote. Switch to a single atomic
   `copyFile(template, target, fsConstants.COPYFILE_EXCL)` and treat
   the EEXIST error as the "already configured" signal — same warning
   + diff hint as before, but the check + copy now happen in one
   syscall so they cannot race. Other failure paths still surface as
   process exit 1.

2. Comment on `scripts/check-env-example.mjs::walk` claimed it matched
   ".ts / .mts / .mjs" but the regex also matched ".js". Rewrote the
   comment to match the regex (".ts / .mts / .mjs / .js"). Same comment
   pass: noted that test/ never enters because the walk is rooted at
   src/, not because of an explicit skip.

Skipped findings:

- WHAT-style comment on `findEnvExample` — kept a one-liner explaining
  the package-vs-source priority since both paths are real; reduced
  the block from 4 lines to 2 instead of removing it entirely.
- "Add trailing newline to .env.example" — file already ends with `\n`
  (verified `tail -c 5` shows `tion\n`).

Verified locally:
- `npm run build` clean.
- `npm test` 903 / 903 pass.
- First `agentmemory init` against a clean HOME creates the file.
- Second init against the same HOME hits EEXIST and prints the
  "leaving it untouched" warning + diff hint without overwriting.
- `node scripts/check-env-example.mjs` — in sync (60 keys).
@rohitg00 rohitg00 merged commit 8b98432 into main May 15, 2026
4 of 5 checks passed
@rohitg00 rohitg00 deleted the feat/env-example-372 branch May 15, 2026 09:11
rohitg00 added a commit that referenced this pull request May 15, 2026
* docs(website): refresh agent-memory.dev for v0.9.15+ DevEx surface

Drift accumulated across the website from v0.9.0 through v0.9.15.
Each section caught up:

CommandCenter:
- "iii CONSOLE · OPTIONAL" → "iii CONSOLE · FIRST-CLASS". User
  pushback: the console gives engine-level visibility (workers,
  functions, queues, traces) and is now installed inline by the
  agentmemory CLI on first run from v0.9.16. Not optional.
- Bullet "49 HTTP TRIGGERS" → "107 HTTP ENDPOINTS" to match
  generated-meta.json restEndpoints count. Dropped the stale "33
  REGISTERED FUNCTIONS" subhead.
- Section lede now mentions both UIs are first-class + inline-
  installed.

Compare:
- MCP TOOLS our column 44 → 51 (matches generated-meta.json).
- New REST ENDPOINTS row (107) — competitors don't ship a REST
  shape per their docs, so dashes for mem0/letta/cognee.
- New NATIVE PLUGINS row listing the 6 first-party agents +
  Cursor/Gemini CLI.

Agents:
- FEATURED expanded from 4 to 6 (added pi + OpenHuman). Codex CLI
  pitch updated to "6 hooks + MCP · native plugin" reflecting the
  hooks addition in PR #383.
- Section title "FOUR FIRST-PARTY" → "SIX FIRST-PARTY".
- Section lede now mentions `agentmemory connect <agent>`
  (shipped in v0.9.15 PR #402).

Hero:
- "START IN 60 SECONDS" CTA → "START IN 30 SECONDS". Cold install
  + engine spawn measured 8-12s on v0.9.15 with the native binary
  path; 60s was the v0.9.0-era Docker-first claim.

generated-meta.json regenerated by the build (auto-derive rule).
Website build clean.

* chore(website): refresh generated-meta timestamp

* feat(website): AS FEATURED IN bar — AlphaSignal, AAIF, Trendshift

Wedges between Hero and Stats. Three text-cells in a 3-col row (1-col
on mobile), each links to the source article. Matches the existing
brutalist mono aesthetic — no logo files, no marquee animation, no
JS. Border + small ↗ glyph on each card; gold border on hover.

Sources chosen for brand authority + independence:
- AlphaSignal (180K technical subscribers) →
  alphasignalai.substack.com/p/how-agentmemory-works-and-how-to
- Agentic AI Foundation (Linux Foundation backed) → aaif.io
- Trendshift "NEW 2026 · Position #19" → trendshift.io/repositories/25123

Static, server-rendered, no client bundle impact.

* feat(website): real logos in AS FEATURED IN bar

Replaced text-only treatment with actual brand marks:

- AlphaSignal — github.com/Alpha-Signal org avatar (verified)
  https://avatars.githubusercontent.com/u/64016073?s=200&v=4
- Agentic AI Foundation — aaif.io's own favicon PNG (verified by
  fetching their site)
- Trendshift — their official badge endpoint
  trendshift.io/api/badge/repositories/25123 — bakes the repo's live
  star + position count into the image, so the cell tracks the
  Trendshift state automatically

Layout split: AlphaSignal + AAIF render logo-left / text-right with
↗ arrow. Trendshift renders centered with the full badge image (it's
already a wide brand mark with the rank + stars baked in, so making
it text-bound looks cramped).

next.config.ts adds the three new image hosts to remotePatterns
(aaif.io, trendshift.io, raw.githubusercontent.com). Existing
unoptimized={true} per image so we don't proxy through Vercel's
optimizer.

Build clean. No new deps.

* feat(website): use real AAIF wordmark logo + center 3-card grid

User pushed the actual Agentic AI Foundation wordmark — 838x203 PNG
on transparent background, black artwork. Dropped the favicon and
self-hosted the wordmark at /featured/aaif-logo.png so the brand
reads cleanly on the dark cell.

Rendered as a badge-style cell (centered, wide-form) like Trendshift,
with a `filter: invert(1) brightness(1.05)` so the black artwork
inverts to white-on-dark and matches the site palette without
shipping a second asset.

Grid template balanced: 1fr / 1.3fr / 1fr — gives AAIF the extra
horizontal room its wordmark needs while keeping AlphaSignal and
Trendshift consistent on either side. Max width bumped to 1000px.

`badgeImg` got `object-fit: contain` and an explicit `max-height` so
the AAIF + Trendshift badges sit at the same vertical baseline.

* fix(website): coderabbit PR #415 — meta drift + a11y + dead CSS

Five findings, all valid against the branch:

1. CommandCenter line 48 hardcoded "107 HTTP ENDPOINTS" but
   website/lib/generated-meta.json reports restEndpoints: 121.
   Bumped to 121. The meta file is the source of truth (auto-derived
   from src/triggers/api.ts at build via scripts/derive-meta.js).

2. Compare.tsx REST ENDPOINTS row same drift: "107" → "121".

3. Compare.tsx NATIVE PLUGINS row claimed "6" in the label but the
   parenthesized list had 8 names (Cursor + Gemini included). Per
   README: those two are MCP-server tier, not native plugin. List
   trimmed to the actual 6 native-plugin agents:
   Claude/Codex/OpenClaw/Hermes/pi/OpenHuman.

4. FeaturedIn.module.css .cell had :hover only — keyboard users
   tabbing through saw no focus indicator (WCAG 2.4.7). Added
   :focus-visible with gold border + outline.

5. .cellBadge declared `grid-template-columns: none` while using
   display: flex. Dead property removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant