memorysync-cli 1.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,66 @@
1
+ # ==============================================================================
2
+ # MemorySync — Git Ignore Rules (Transparency-First Philosophy)
3
+ # ==============================================================================
4
+
5
+ # -------------------------
6
+ # Category 1: Secrets & Credentials (NEVER COMMIT)
7
+ # -------------------------
8
+ .env
9
+ .env.*
10
+ !memorysync-benchmark/longmemeval/.env.example
11
+ *.pem
12
+ *.key
13
+ *.crt
14
+ secrets/
15
+
16
+ # -------------------------
17
+ # Category 2: User / Customer / Private Data (NEVER COMMIT)
18
+ # -------------------------
19
+ uploads/
20
+ backups/
21
+ /storage/
22
+ chroma/
23
+ chroma_data/
24
+ *.db
25
+ *.sqlite
26
+ *.sqlite3
27
+ *.dump
28
+ *.bak
29
+
30
+ # -------------------------
31
+ # Category 3: Massive Dependency / Build / Cache Artifacts (BLOAT)
32
+ # -------------------------
33
+ node_modules/
34
+ venv/
35
+ .venv/
36
+ __pycache__/
37
+ .pytest_cache/
38
+ .next/
39
+ dist/
40
+ build/
41
+ htmlcov/
42
+ .coverage
43
+ *.cover
44
+ out/
45
+ /dashboard/tsconfig.tsbuildinfo
46
+
47
+ # Responsive audit output (regenerated by npm run audit:responsive)
48
+ dashboard/responsive-audit-report.json
49
+
50
+ # -------------------------
51
+ # Category 4: Local worktrees and deploy clones (NEVER COMMIT)
52
+ # -------------------------
53
+ # Each of these holds its own .git directory. Staging one would record a
54
+ # gitlink with no matching .gitmodules entry, which reads as a broken
55
+ # submodule for everyone who clones afterwards, and it would drag several
56
+ # thousand unrelated files in with it.
57
+ #
58
+ # They are also why `git add .` stalls here rather than finishing: the walk
59
+ # has to touch roughly two thousand extra files, and because this repo lives
60
+ # under OneDrive, each one can trigger a hydration download before git is
61
+ # allowed to read it.
62
+ /.kiro/worktrees/
63
+ /.production-deploy/
64
+ /.baseline-int/
65
+ /.baseline-plan/
66
+ /.baseline-s3/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 MemorySync
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,158 @@
1
+ Metadata-Version: 2.5
2
+ Name: memorysync-cli
3
+ Version: 1.0.2
4
+ Summary: MemorySync from your terminal. Zero dependencies.
5
+ Project-URL: Documentation, https://docs.memorysync.io/cli
6
+ Project-URL: Homepage, https://memorysync.io/cli
7
+ Author: MemorySync
8
+ License: MIT
9
+ License-File: LICENSE
10
+ Keywords: agent-memory,ai-agents,cli,llm,long-term-memory,memory,memorysync,terminal
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Software Development :: Libraries
22
+ Classifier: Topic :: Utilities
23
+ Requires-Python: >=3.9
24
+ Description-Content-Type: text/markdown
25
+
26
+ # memorysync-cli (Python)
27
+
28
+ MemorySync from your terminal. Zero dependencies.
29
+
30
+ The same CLI as the npm package `memorysync-cli`, implemented in Python. Same 21
31
+ commands, same flags, same output formats, same exit codes. The two are
32
+ interchangeable, so you only need one.
33
+
34
+ ```bash
35
+ pipx install memorysync-cli
36
+ ```
37
+
38
+ `pipx` is recommended because this is an application rather than a library. `pip
39
+ install` works too, but outside a virtual environment it fails on
40
+ externally-managed Pythons — Homebrew and most Linux distributions — with
41
+ `externally-managed-environment` ([PEP 668](https://peps.python.org/pep-0668/)).
42
+
43
+ Requires Python 3.9 or newer.
44
+
45
+ ## Getting started
46
+
47
+ ```bash
48
+ memorysync init # store a key, pick a default user
49
+ memorysync add "Prefers pnpm" --user alice
50
+ memorysync search "package manager" --user alice
51
+ memorysync quota # how much of the plan is left
52
+ ```
53
+
54
+ Both `memorysync` and `msync` are installed; `msync` is just shorter.
55
+
56
+ ## Parity is enforced, not promised
57
+
58
+ Both CLIs read one generated command tree, so `help --json` is byte-identical
59
+ between them. The test suite runs both and compares stdout for every offline
60
+ command, including all four completion scripts, and compares exit codes for each
61
+ failure mode. A command added to one and not the other fails the build.
62
+
63
+ That matters because the alternative does not hold. Mem0 ships a Node and a Python
64
+ CLI and documents them as identical; their Python CLI answers `help --json` with
65
+ twelve commands while their Node CLI answers with a name, a version and a
66
+ description and no commands at all, and the two sit on different versions.
67
+
68
+ ## Zero dependencies
69
+
70
+ `argparse`, `urllib.request` and `json` cover everything. Mem0's Python CLI depends
71
+ on httpx, rich and typer.
72
+
73
+ Every dependency is code on a customer's machine that they cannot audit on our
74
+ behalf, which matters more for a closed-source tool because nobody else is reading
75
+ our lockfile. A table and eight colours do not justify it.
76
+
77
+ ## Agent mode
78
+
79
+ Pass `--json` (or `--agent`) before the command for one JSON envelope, no colour,
80
+ no spinners, errors as JSON with a non-zero exit:
81
+
82
+ ```bash
83
+ memorysync --json search "preferences" --user alice
84
+ ```
85
+
86
+ `data` is always a list, for every command. An agent parses one shape rather than
87
+ remembering which commands return an object.
88
+
89
+ ```bash
90
+ memorysync help --json # the whole command tree, for self-discovery
91
+ ```
92
+
93
+ ## Exit codes
94
+
95
+ A script can branch on the cause rather than parsing prose.
96
+
97
+ | Code | Meaning |
98
+ |------|---------|
99
+ | 0 | Success |
100
+ | 1 | Unclassified failure |
101
+ | 2 | Usage: unknown command, bad flag, bad value |
102
+ | 3 | Auth: missing, expired or revoked credentials |
103
+ | 4 | Quota: a plan limit is reached |
104
+ | 5 | Network: unreachable or timed out |
105
+ | 6 | Not found |
106
+ | 130 | Interrupted |
107
+
108
+ Code 4 earns its place. Over a plan limit the API returns success with an empty
109
+ result rather than an error, deliberately, so an assistant never narrates billing
110
+ state to an end user. From a terminal that silence is unhelpful, so the CLI reads
111
+ usage and turns it into a distinct code — otherwise an exhausted plan is
112
+ indistinguishable from an empty database.
113
+
114
+ ## Where your key is stored
115
+
116
+ Never in the config file. In order: `MEMORYSYNC_API_KEY`, then the OS keychain,
117
+ then an owner-only encrypted file.
118
+
119
+ | Platform | Storage |
120
+ |---|---|
121
+ | macOS | Keychain, via `security` |
122
+ | Linux | Keyring, via `secret-tool`, when libsecret is present |
123
+ | Windows | Owner-only encrypted file |
124
+
125
+ Windows has no scriptable Credential Manager path that avoids a dependency, so it
126
+ uses the file tier. That is the same on the Node CLI. The file is `0600` and its
127
+ contents are tied to the machine and user, which stops a casual `cat` or a backup
128
+ scraper; anyone who can already run code as you can read it. The keychain is
129
+ better, which is why it is tried first.
130
+
131
+ ## Deleting
132
+
133
+ `delete` is two-step by default: without `--yes` it previews and changes nothing.
134
+
135
+ `delete --all` clears that one end user's memories and nothing else. No form of any
136
+ command can delete an account, a project or an API key.
137
+
138
+ To clear every memory for an end user through the API directly, use a wide filter
139
+ on `DELETE /memory/forget`, for example `{"before": "<now>"}`. Not
140
+ `/memory/user/purge`: despite its path it is not end-user scoped and erases the
141
+ account behind the credential.
142
+
143
+ ## Environment variables
144
+
145
+ | Variable | Purpose |
146
+ |---|---|
147
+ | `MEMORYSYNC_API_KEY` | Key, highest priority |
148
+ | `MEMORYSYNC_BASE_URL` | API base URL |
149
+ | `MEMORYSYNC_USER` | Default end user |
150
+ | `MEMORYSYNC_PROJECT` | Default project |
151
+ | `MEMORYSYNC_PROFILE` | Named profile |
152
+ | `MEMORYSYNC_OUTPUT` | Default output format |
153
+ | `MEMORYSYNC_CONFIG_DIR` | Where config and credentials live |
154
+ | `NO_COLOR` | Disable colour |
155
+
156
+ ## Documentation
157
+
158
+ <https://docs.memorysync.io/cli>
@@ -0,0 +1,133 @@
1
+ # memorysync-cli (Python)
2
+
3
+ MemorySync from your terminal. Zero dependencies.
4
+
5
+ The same CLI as the npm package `memorysync-cli`, implemented in Python. Same 21
6
+ commands, same flags, same output formats, same exit codes. The two are
7
+ interchangeable, so you only need one.
8
+
9
+ ```bash
10
+ pipx install memorysync-cli
11
+ ```
12
+
13
+ `pipx` is recommended because this is an application rather than a library. `pip
14
+ install` works too, but outside a virtual environment it fails on
15
+ externally-managed Pythons — Homebrew and most Linux distributions — with
16
+ `externally-managed-environment` ([PEP 668](https://peps.python.org/pep-0668/)).
17
+
18
+ Requires Python 3.9 or newer.
19
+
20
+ ## Getting started
21
+
22
+ ```bash
23
+ memorysync init # store a key, pick a default user
24
+ memorysync add "Prefers pnpm" --user alice
25
+ memorysync search "package manager" --user alice
26
+ memorysync quota # how much of the plan is left
27
+ ```
28
+
29
+ Both `memorysync` and `msync` are installed; `msync` is just shorter.
30
+
31
+ ## Parity is enforced, not promised
32
+
33
+ Both CLIs read one generated command tree, so `help --json` is byte-identical
34
+ between them. The test suite runs both and compares stdout for every offline
35
+ command, including all four completion scripts, and compares exit codes for each
36
+ failure mode. A command added to one and not the other fails the build.
37
+
38
+ That matters because the alternative does not hold. Mem0 ships a Node and a Python
39
+ CLI and documents them as identical; their Python CLI answers `help --json` with
40
+ twelve commands while their Node CLI answers with a name, a version and a
41
+ description and no commands at all, and the two sit on different versions.
42
+
43
+ ## Zero dependencies
44
+
45
+ `argparse`, `urllib.request` and `json` cover everything. Mem0's Python CLI depends
46
+ on httpx, rich and typer.
47
+
48
+ Every dependency is code on a customer's machine that they cannot audit on our
49
+ behalf, which matters more for a closed-source tool because nobody else is reading
50
+ our lockfile. A table and eight colours do not justify it.
51
+
52
+ ## Agent mode
53
+
54
+ Pass `--json` (or `--agent`) before the command for one JSON envelope, no colour,
55
+ no spinners, errors as JSON with a non-zero exit:
56
+
57
+ ```bash
58
+ memorysync --json search "preferences" --user alice
59
+ ```
60
+
61
+ `data` is always a list, for every command. An agent parses one shape rather than
62
+ remembering which commands return an object.
63
+
64
+ ```bash
65
+ memorysync help --json # the whole command tree, for self-discovery
66
+ ```
67
+
68
+ ## Exit codes
69
+
70
+ A script can branch on the cause rather than parsing prose.
71
+
72
+ | Code | Meaning |
73
+ |------|---------|
74
+ | 0 | Success |
75
+ | 1 | Unclassified failure |
76
+ | 2 | Usage: unknown command, bad flag, bad value |
77
+ | 3 | Auth: missing, expired or revoked credentials |
78
+ | 4 | Quota: a plan limit is reached |
79
+ | 5 | Network: unreachable or timed out |
80
+ | 6 | Not found |
81
+ | 130 | Interrupted |
82
+
83
+ Code 4 earns its place. Over a plan limit the API returns success with an empty
84
+ result rather than an error, deliberately, so an assistant never narrates billing
85
+ state to an end user. From a terminal that silence is unhelpful, so the CLI reads
86
+ usage and turns it into a distinct code — otherwise an exhausted plan is
87
+ indistinguishable from an empty database.
88
+
89
+ ## Where your key is stored
90
+
91
+ Never in the config file. In order: `MEMORYSYNC_API_KEY`, then the OS keychain,
92
+ then an owner-only encrypted file.
93
+
94
+ | Platform | Storage |
95
+ |---|---|
96
+ | macOS | Keychain, via `security` |
97
+ | Linux | Keyring, via `secret-tool`, when libsecret is present |
98
+ | Windows | Owner-only encrypted file |
99
+
100
+ Windows has no scriptable Credential Manager path that avoids a dependency, so it
101
+ uses the file tier. That is the same on the Node CLI. The file is `0600` and its
102
+ contents are tied to the machine and user, which stops a casual `cat` or a backup
103
+ scraper; anyone who can already run code as you can read it. The keychain is
104
+ better, which is why it is tried first.
105
+
106
+ ## Deleting
107
+
108
+ `delete` is two-step by default: without `--yes` it previews and changes nothing.
109
+
110
+ `delete --all` clears that one end user's memories and nothing else. No form of any
111
+ command can delete an account, a project or an API key.
112
+
113
+ To clear every memory for an end user through the API directly, use a wide filter
114
+ on `DELETE /memory/forget`, for example `{"before": "<now>"}`. Not
115
+ `/memory/user/purge`: despite its path it is not end-user scoped and erases the
116
+ account behind the credential.
117
+
118
+ ## Environment variables
119
+
120
+ | Variable | Purpose |
121
+ |---|---|
122
+ | `MEMORYSYNC_API_KEY` | Key, highest priority |
123
+ | `MEMORYSYNC_BASE_URL` | API base URL |
124
+ | `MEMORYSYNC_USER` | Default end user |
125
+ | `MEMORYSYNC_PROJECT` | Default project |
126
+ | `MEMORYSYNC_PROFILE` | Named profile |
127
+ | `MEMORYSYNC_OUTPUT` | Default output format |
128
+ | `MEMORYSYNC_CONFIG_DIR` | Where config and credentials live |
129
+ | `NO_COLOR` | Disable colour |
130
+
131
+ ## Documentation
132
+
133
+ <https://docs.memorysync.io/cli>
@@ -0,0 +1,79 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "memorysync-cli"
7
+ # Taken from _version.py rather than written here. The Node CLI shipped 1.0.1
8
+ # reporting 1.0.0 because the number lived in two places and one was bumped, and
9
+ # the Python SDK shipped 1.7.1 reporting 1.7.0 for the same reason. One source.
10
+ dynamic = ["version"]
11
+ description = "MemorySync from your terminal. Zero dependencies."
12
+ readme = "README.md"
13
+ license = { text = "MIT" }
14
+ # 3.9, matching the memorysync SDK. Mem0's CLI requires 3.10+, so this reaches
15
+ # one more Python version than the only competitor shipping a Python CLI.
16
+ requires-python = ">=3.9"
17
+ authors = [{ name = "MemorySync" }]
18
+ keywords = [
19
+ "memorysync",
20
+ "memory",
21
+ "cli",
22
+ "agent-memory",
23
+ "long-term-memory",
24
+ "ai-agents",
25
+ "llm",
26
+ "terminal",
27
+ ]
28
+ classifiers = [
29
+ "Development Status :: 5 - Production/Stable",
30
+ "Environment :: Console",
31
+ "Intended Audience :: Developers",
32
+ "License :: OSI Approved :: MIT License",
33
+ "Programming Language :: Python :: 3",
34
+ "Programming Language :: Python :: 3.9",
35
+ "Programming Language :: Python :: 3.10",
36
+ "Programming Language :: Python :: 3.11",
37
+ "Programming Language :: Python :: 3.12",
38
+ "Programming Language :: Python :: 3.13",
39
+ "Topic :: Software Development :: Libraries",
40
+ "Topic :: Utilities",
41
+ ]
42
+
43
+ # Deliberately empty.
44
+ #
45
+ # Mem0's Python CLI depends on httpx, rich and typer; their Node CLI on
46
+ # commander, chalk, cli-table3, ora and boxen. Every one of those is code we would
47
+ # be putting on a customer's machine that they cannot audit on our behalf, which
48
+ # matters more for a closed-source tool because nobody else is reading our
49
+ # lockfile. argparse, urllib.request and json cover all of it.
50
+ dependencies = []
51
+
52
+ [project.urls]
53
+ Documentation = "https://docs.memorysync.io/cli"
54
+ Homepage = "https://memorysync.io/cli"
55
+
56
+ [project.scripts]
57
+ # Both names, matching the Node CLI. The two implementations are interchangeable,
58
+ # so whichever is on PATH behaves identically and nobody needs both.
59
+ memorysync = "memorysync_cli.main:run"
60
+ msync = "memorysync_cli.main:run"
61
+
62
+ [tool.hatch.version]
63
+ path = "src/memorysync_cli/_version.py"
64
+
65
+ [tool.hatch.build.targets.wheel]
66
+ packages = ["src/memorysync_cli"]
67
+
68
+ [tool.hatch.build.targets.wheel.force-include]
69
+ # registry.json is generated from the Node CLI and must be in the wheel: it is
70
+ # the command surface, read at runtime, not a build-time convenience.
71
+ "src/memorysync_cli/registry.json" = "memorysync_cli/registry.json"
72
+
73
+ [tool.hatch.build.targets.sdist]
74
+ include = [
75
+ "src/memorysync_cli",
76
+ "README.md",
77
+ "LICENSE",
78
+ "pyproject.toml",
79
+ ]
@@ -0,0 +1,13 @@
1
+ """MemorySync command-line interface.
2
+
3
+ A Python implementation of the same CLI as the npm package ``memorysync-cli``,
4
+ with the same commands, flags, output formats and exit codes. The two are
5
+ interchangeable: whichever is on PATH behaves identically, so you only need one.
6
+
7
+ Both read their command surface from one generated declaration, so ``help --json``
8
+ is byte-identical between them rather than kept aligned by review.
9
+ """
10
+
11
+ from ._version import __version__
12
+
13
+ __all__ = ["__version__"]
@@ -0,0 +1,9 @@
1
+ """Allow ``python -m memorysync_cli`` alongside the installed console scripts.
2
+
3
+ Useful during development and in environments where a wheel's scripts directory is
4
+ not on PATH, which is common inside CI containers.
5
+ """
6
+
7
+ from .main import run
8
+
9
+ run()
@@ -0,0 +1 @@
1
+ __version__ = "1.0.2"