diff --git a/cli/node/package.json b/cli/node/package.json index c7182376b..08cdf2cf5 100644 --- a/cli/node/package.json +++ b/cli/node/package.json @@ -1,6 +1,6 @@ { "name": "@mem0/cli", - "version": "0.2.4", + "version": "0.2.5", "description": "The official CLI for mem0 — the memory layer for AI agents", "type": "module", "bin": { diff --git a/cli/python/pyproject.toml b/cli/python/pyproject.toml index 66176e676..9f9644a50 100644 --- a/cli/python/pyproject.toml +++ b/cli/python/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "mem0-cli" -version = "0.2.4" +version = "0.2.5" description = "The official CLI for mem0 — the memory layer for AI agents" readme = "README.md" license = "Apache-2.0" diff --git a/cli/python/src/mem0_cli/config.py b/cli/python/src/mem0_cli/config.py index 9abe4bde3..6cd11c6ce 100644 --- a/cli/python/src/mem0_cli/config.py +++ b/cli/python/src/mem0_cli/config.py @@ -31,7 +31,9 @@ class PlatformConfig: # Agent Mode (unclaimed-shadow signup) agent_mode: bool = False # True while the key is an unclaimed agent-mode key created_via: str = "" # "agent_mode" | "email" | "api_key" | "existing_key" - agent_caller: str = "" # canonical agent name when created_via == "agent_mode" (e.g. "claude-code") + agent_caller: str = ( + "" # canonical agent name when created_via == "agent_mode" (e.g. "claude-code") + ) claimed_at: str = "" # ISO timestamp once the agent has been claimed by a human default_user_id: str = "" # `user_` returned by bootstrap; used as auto-default diff --git a/cli/python/tests/test_init_internals.py b/cli/python/tests/test_init_internals.py index 20346c597..141f6018e 100644 --- a/cli/python/tests/test_init_internals.py +++ b/cli/python/tests/test_init_internals.py @@ -91,12 +91,7 @@ def test_shell_rc_does_not_create_new_export(tmp_path) -> None: def test_shell_rc_preserves_surrounding_content(tmp_path) -> None: rc = tmp_path / ".zshrc" - original = ( - "# my zshrc\n" - "alias ll='ls -la'\n" - "export MEM0_API_KEY='old'\n" - "export OTHER=keepme\n" - ) + original = "# my zshrc\nalias ll='ls -la'\nexport MEM0_API_KEY='old'\nexport OTHER=keepme\n" rc.write_text(original, encoding="utf-8") _update_shell_rc(rc, "newkey") after = rc.read_text(encoding="utf-8") diff --git a/docs/changelog/sdk.mdx b/docs/changelog/sdk.mdx index c9db329fe..d43c574a5 100644 --- a/docs/changelog/sdk.mdx +++ b/docs/changelog/sdk.mdx @@ -1323,6 +1323,23 @@ See the [TypeScript SDK migration guide](https://docs.mem0.ai/migration/ts-v2-to + + +**New Features:** +- **Agent Mode (`mem0 init --agent`):** Zero-friction signup for AI agents — mints a working Mem0 API key in <5s with no email, no dashboard, no OTP. Returns an unclaimed shadow account the human can later claim with `mem0 init --email ` (memories preserved, same key keeps working) ([#5123](https://github.com/mem0ai/mem0/pull/5123)) +- **Self-declared agent identity:** Agents pass `--agent-caller ` (e.g. `claude-code`, `cursor`, `codex`) on `mem0 init --agent` so signups attribute to the right tool in analytics. Proof Editor-style — the agent declares itself rather than the CLI sniffing it from env vars ([#5123](https://github.com/mem0ai/mem0/pull/5123)) +- **`mem0 identify `:** New subcommand to self-tag an Agent Mode key after the fact when the agent forgot to pass `--agent-caller` on init. Idempotent — re-running just overwrites ([#5123](https://github.com/mem0ai/mem0/pull/5123)) +- **Plugin sync:** `~/.claude/settings.json::env::MEM0_API_KEY` and `~/.zshrc`/`.bashrc` `export MEM0_API_KEY=` lines stay in sync with `~/.mem0/config.json` automatically. Idempotent — only updates EXISTING entries, never creates new ones ([#5123](https://github.com/mem0ai/mem0/pull/5123)) +- **Claim flow:** `mem0 init --email ` claims an existing Agent Mode shadow via OTP. Upgrade-in-place — the API key never changes, memories transfer to the human's account ([#5123](https://github.com/mem0ai/mem0/pull/5123)) + +**Bug Fixes:** +- **Decision tree network resilience:** `pingKey` now distinguishes network errors from invalid keys — returns false ONLY on HTTP 401/403, returns true on connection failures / timeouts / 5xx. Prevents a VPN flap from silently rotating the user's API key and rewriting plugin-sync targets ([#5123](https://github.com/mem0ai/mem0/pull/5123)) +- **Rate-limit error clarity:** DRF's opaque `"You do not have permission"` 403 from Agent Mode rate limits is now translated to `"Daily Agent Mode signup limit reached for this network (5/day). Try again from a different IP or after midnight UTC."` ([#5123](https://github.com/mem0ai/mem0/pull/5123)) +- **JSON envelope `command` field:** `mem0 init --agent --json` error envelopes now populate the `command` field correctly instead of returning an empty string ([#5123](https://github.com/mem0ai/mem0/pull/5123)) +- **Bootstrap envelope validation:** Defends against partial/malformed backend responses (e.g. `{api_key: null}`) silently persisting null/undefined into typed string fields ([#5123](https://github.com/mem0ai/mem0/pull/5123)) + + + **New Features:**