@unifiedmemory/cli 1.0.0 → 1.1.0

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.
package/README.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # UnifiedMemory CLI (`um`)
2
2
 
3
- One-command setup for AI code assistant integration with UnifiedMemory.
3
+ [![npm version](https://badge.fury.io/js/@unifiedmemory%2Fcli.svg)](https://www.npmjs.com/package/@unifiedmemory/cli)
4
+ [![License: PROPRIETARY](https://img.shields.io/badge/License-PROPRIETARY-red.svg)](./LICENSE)
5
+ [![Node Version](https://img.shields.io/node/v/@unifiedmemory/cli)](https://nodejs.org)
6
+
7
+ Connect your AI code assistant to UnifiedMemory's knowledge vault with one command.
8
+
9
+ ## What is UnifiedMemory?
10
+
11
+ UnifiedMemory is an AI-powered knowledge management system that lets your code assistant remember context across all your projects. The `um` CLI connects your local AI tools (Claude Code, Cursor, Cline, etc.) to your UnifiedMemory vault so they can access and store project knowledge automatically.
4
12
 
5
13
  ## Quick Start
6
14
 
@@ -8,52 +16,59 @@ One-command setup for AI code assistant integration with UnifiedMemory.
8
16
  # Install globally
9
17
  npm install -g @unifiedmemory/cli
10
18
 
11
- # Or run directly with npx
19
+ # Or run directly with npx (no installation required)
12
20
  npx @unifiedmemory/cli init
13
21
 
14
22
  # In your project directory
23
+ cd your-project
15
24
  um init
16
25
  ```
17
26
 
18
- ## How It Works
27
+ That's it! Your AI assistant can now access UnifiedMemory.
19
28
 
20
- UnifiedMemory uses a **local MCP (Model Context Protocol) server** approach:
29
+ ## What Does This Do?
21
30
 
22
- 1. **One-time authentication**: `um login` stores your credentials locally in `~/.um/auth.json`
23
- 2. **Project context**: `um init` creates `.um/config.json` in your project directory
24
- 3. **Local MCP server**: AI assistants spawn `um mcp serve` which:
25
- - Reads authentication from `~/.um/auth.json`
26
- - Auto-detects project context from `.um/config.json` in current directory
27
- - Forwards tool calls to UnifiedMemory API with proper authentication
28
- - Handles token refresh automatically
31
+ When you run `um init` in your project:
29
32
 
30
- This means:
31
- - No tokens stored in AI assistant configuration files
32
- - No re-authentication needed
33
- - Automatic project context detection based on directory
34
- - ✅ Works seamlessly across multiple projects
33
+ 1. **Authenticates you** - Opens your browser to sign in with UnifiedMemory (one-time)
34
+ 2. **Links your project** - Choose an existing project or create a new one in your vault
35
+ 3. **Configures AI tools** - Automatically detects and configures Claude Code, Cursor, Cline, Codex CLI, or Gemini CLI
36
+ 4. **Creates local config** - Adds a `.um/` folder to your project (auto-added to `.gitignore`)
37
+
38
+ After setup, your AI assistant will automatically:
39
+ - ✅ Store important code context in your UnifiedMemory vault
40
+ - ✅ Retrieve relevant knowledge when working on similar problems
41
+ - ✅ Remember decisions and patterns across sessions
42
+ - ✅ Switch context automatically when you change projects
43
+
44
+ ## What Gets Created in Your Project?
45
+
46
+ ```
47
+ your-project/
48
+ ├── .um/
49
+ │ └── config.json # Project configuration (auto-ignored by git)
50
+ ├── .gitignore # Updated to exclude .um/
51
+ └── .mcp.json # MCP server config (Claude Code only)
52
+ ```
35
53
 
36
- ## What does `um init` do?
54
+ **Note**: Authentication tokens are stored securely in `~/.um/auth.json` on your machine, never in your project directory.
37
55
 
38
- 1. **Authenticates** you via OAuth (or uses saved session)
39
- 2. **Prompts** for project selection (create new or link existing)
40
- 3. **Creates** `.um/config.json` with org_id and project_id
41
- 4. **Configures** all detected AI tools to use local MCP server
42
- 5. **Ready to use** - just restart your AI assistant!
56
+ ## Supported AI Code Assistants
43
57
 
44
- ## Features
58
+ | Tool | Status | Configuration |
59
+ |------|--------|--------------|
60
+ | **Claude Code** | ✅ Fully Supported | Project-level `.mcp.json` |
61
+ | **Cursor** | ✅ Fully Supported | Global `~/.cursor/mcp.json` |
62
+ | **Cline** | ✅ Fully Supported | Global `~/.cline/mcp.json` |
63
+ | **Codex CLI** | ✅ Fully Supported | Global `~/.codex/config.toml` |
64
+ | **Gemini CLI** | ✅ Fully Supported | Global `~/.gemini/settings.json` |
45
65
 
46
- - OAuth 2.0 authentication with automatic token refresh
47
- - ✅ Auto-detect and configure AI code assistants
48
- - ✅ Local MCP server with secure token storage
49
- - ✅ Multi-project support with automatic context switching
50
- - ✅ Automatic .gitignore updates
51
- - ✅ Supports Claude Code, Cursor, Cline, Codex CLI, and Gemini CLI
66
+ The CLI automatically detects which tools you have installed and configures them for you.
52
67
 
53
68
  ## Commands
54
69
 
55
70
  ### `um init`
56
- Initialize UnifiedMemory in the current project (recommended).
71
+ Set up UnifiedMemory in your current project (recommended).
57
72
 
58
73
  ```bash
59
74
  um init # Interactive setup
@@ -61,160 +76,220 @@ um init --skip-configure # Skip AI tool configuration
61
76
  ```
62
77
 
63
78
  ### `um login`
64
- Authenticate with UnifiedMemory using OAuth. Opens browser for login.
79
+ Sign in to UnifiedMemory. Opens your browser for authentication.
65
80
 
66
81
  ```bash
67
82
  um login
68
83
  ```
69
84
 
70
- ### `um mcp serve`
71
- Start MCP server (used internally by AI assistants - you don't need to run this manually).
85
+ ### `um status`
86
+ Check your authentication status and see which project is configured.
72
87
 
73
88
  ```bash
74
- um mcp serve
89
+ um status
75
90
  ```
76
91
 
77
- ### `um status`
78
- Show authentication status, current organization, and project configuration.
92
+ **Example output:**
93
+ ```
94
+ 📋 UnifiedMemory Status
79
95
 
80
- ```bash
81
- um status
96
+ Authentication:
97
+ Status: Active
98
+ Email: you@example.com
99
+ Expires: 1/7/2026
100
+
101
+ Organization Context:
102
+ My Organization (my-org)
103
+ Role: admin
104
+
105
+ Project Configuration:
106
+ ✓ Configured: My Project (proj_xxx)
82
107
  ```
83
108
 
84
109
  ### `um org switch`
85
- Switch between organizations or personal account.
110
+ Switch between your organizations or personal account.
86
111
 
87
112
  ```bash
88
113
  um org switch
89
114
  ```
90
115
 
91
- ### `um project`
92
- Manage project configuration (coming soon).
116
+ ### `um note create`
117
+ Manually save a note to your vault (useful for capturing important context).
93
118
 
94
- ### `um configure`
95
- Configure AI code assistants (coming soon).
119
+ ```bash
120
+ um note create
121
+ ```
96
122
 
97
- ## Configuration
123
+ ### `um mcp serve`
124
+ Start the MCP server (used internally by AI assistants - you don't need to run this manually).
98
125
 
99
- ### Environment Variables
126
+ ## How It Works
100
127
 
101
- Create a `.env` file in the CLI directory:
128
+ UnifiedMemory uses the **Model Context Protocol (MCP)** to connect your AI assistant to your knowledge vault:
102
129
 
103
- ```env
104
- CLERK_CLIENT_ID=your_clerk_client_id
105
- CLERK_DOMAIN=clear-caiman-45.clerk.accounts.dev
106
- API_ENDPOINT=https://api.unifiedmemory.ai
107
- ```
130
+ 1. Your AI assistant calls `um mcp serve` in the background
131
+ 2. The local MCP server reads your authentication from `~/.um/auth.json`
132
+ 3. It detects which project you're in by looking for `.um/config.json`
133
+ 4. Tool requests from your AI flow through the server to UnifiedMemory's API
134
+ 5. Knowledge is stored and retrieved automatically based on context
108
135
 
109
- ### Project Configuration
136
+ **Security**:
137
+ - Authentication tokens are stored locally in your home directory, never in project files
138
+ - Tokens automatically refresh when they expire
139
+ - Each project directory has its own configuration
140
+ - The `.um/` folder is automatically added to `.gitignore`
110
141
 
111
- After running `um init`, a `.um/config.json` file is created:
142
+ ## Multi-Project Support
112
143
 
113
- ```json
114
- {
115
- "version": "1.0",
116
- "org_id": "org_xxx",
117
- "project_id": "proj_xxx",
118
- "project_name": "My Project",
119
- "api_url": "https://api.unifiedmemory.ai",
120
- "created_at": "2024-12-17T...",
121
- "mcp_config": {
122
- "inject_headers": true,
123
- "auto_context": true
124
- }
125
- }
126
- ```
144
+ Working on multiple projects? No problem!
127
145
 
128
- This file is automatically added to `.gitignore`.
146
+ ```bash
147
+ cd project-1
148
+ um init # Links to "Project 1" in UnifiedMemory
129
149
 
130
- ### AI Tool Configuration
150
+ cd ../project-2
151
+ um init # Links to "Project 2" in UnifiedMemory
152
+ ```
131
153
 
132
- The CLI automatically detects and configures:
154
+ The CLI automatically detects which project you're in and switches context. Your AI assistant will use the correct vault for each project.
133
155
 
134
- - **Claude Code**: `.mcp.json` (project-level)
135
- - **Cursor**: `~/.cursor/mcp.json`
136
- - **Cline**: `~/.cline/mcp.json`
137
- - **Codex CLI**: `~/.codex/config.toml` (TOML format)
138
- - **Gemini CLI**: `~/.gemini/settings.json`
156
+ ## Switching Organizations
139
157
 
140
- Example MCP configuration (JSON format):
158
+ If you're part of multiple teams:
141
159
 
142
- ```json
143
- {
144
- "mcpServers": {
145
- "vault": {
146
- "command": "um",
147
- "args": ["mcp", "serve"]
148
- }
149
- }
150
- }
160
+ ```bash
161
+ um org switch # Choose between organizations
151
162
  ```
152
163
 
153
- Example MCP configuration (TOML format for Codex):
164
+ All projects you create afterward will belong to the selected organization.
154
165
 
155
- ```toml
156
- [mcp_servers.vault]
157
- command = "um"
158
- args = ["mcp", "serve"]
166
+ ## Installation Options
167
+
168
+ **Option 1: Global Install (recommended)**
169
+ ```bash
170
+ npm install -g @unifiedmemory/cli
171
+ um --version
159
172
  ```
160
173
 
161
- **Note**: No tokens are stored in configuration files. The local MCP server reads authentication from `~/.um/auth.json` and project context from `.um/config.json` automatically.
174
+ **Option 2: Use with npx (no installation)**
175
+ ```bash
176
+ npx @unifiedmemory/cli init
177
+ npx @unifiedmemory/cli status
178
+ ```
179
+
180
+ **Option 3: Use with MCP directly**
181
+
182
+ Your AI assistant will call the MCP server automatically after running `um init`.
162
183
 
163
- ## Supported AI Tools
184
+ ## Requirements
164
185
 
165
- | Tool | MCP Config | Auto-Detect | Config Format |
166
- |------|-----------|-------------|---------------|
167
- | Claude Code | | | JSON (project-level) |
168
- | Cursor | | | JSON |
169
- | Cline | ✅ | ✅ | JSON |
170
- | Codex CLI | ✅ | ✅ | TOML |
171
- | Gemini CLI | ✅ | ✅ | JSON |
186
+ - **Node.js**: Version 18.0.0 or higher
187
+ - **npm**: Latest version recommended
188
+ - **AI Code Assistant**: One of Claude Code, Cursor, Cline, Codex CLI, or Gemini CLI
189
+ - **UnifiedMemory Account**: Sign up at [unifiedmemory.ai](https://unifiedmemory.ai)
172
190
 
173
- ## Development
191
+ ## Troubleshooting
174
192
 
193
+ ### "Not logged in" error
175
194
  ```bash
176
- # Clone the repository
177
- git clone https://github.com/unifiedmemory/um-cli.git
178
- cd um-cli
195
+ um login
196
+ ```
179
197
 
180
- # Install dependencies
181
- npm install
198
+ ### AI assistant not seeing UnifiedMemory tools
199
+ 1. Check status: `um status`
200
+ 2. Verify project is configured
201
+ 3. Restart your AI assistant
202
+ 4. Check the MCP configuration was created (`.mcp.json` or tool-specific config)
182
203
 
183
- # Run locally
184
- node index.js init
204
+ ### Wrong project/organization
205
+ ```bash
206
+ um org switch # Switch organization
207
+ cd your-project && um init # Reconfigure project
208
+ ```
185
209
 
186
- # Build standalone binaries
187
- npm run build
210
+ ### Token expired
211
+ Tokens automatically refresh. If you see auth errors:
212
+ ```bash
213
+ um login
188
214
  ```
189
215
 
190
- ## Architecture
216
+ ### Missing environment variables
217
+ If you see "Missing required environment variables" error:
218
+ 1. Copy `.env.example` to `.env` in the CLI installation directory
219
+ 2. Fill in your Clerk and API credentials
220
+ 3. See Configuration section below for details
221
+
222
+ ## Configuration
223
+
224
+ The CLI requires environment variables for Clerk OAuth and API access. These should never be hardcoded in your project.
191
225
 
226
+ **Step 1: Create `.env` file**
227
+ ```bash
228
+ # In the um-cli installation directory (find with: npm root -g)
229
+ cp .env.example .env
192
230
  ```
193
- AI Tool (Claude/Cursor/Cline/Codex/Gemini)
194
- stdio (JSON-RPC)
195
- um mcp serve (local MCP server)
196
- ├─ Reads ~/.um/auth.json (authentication)
197
- ├─ Reads .um/config.json (project context from cwd)
198
- ├─ Validates/refreshes token if expired
199
- ↓ HTTPS with auth headers
200
- Gateway: https://rose-asp-main-1c0b114.d2.zuplo.dev/mcp
201
- ↓ Forwards with signed headers
202
- Backend: vault-product
231
+
232
+ **Step 2: Add your credentials**
233
+ ```bash
234
+ # Required: Clerk OAuth Configuration
235
+ CLERK_CLIENT_ID=your_clerk_client_id_here
236
+ CLERK_DOMAIN=your-app.clerk.accounts.dev
237
+
238
+ # Required: API Configuration
239
+ API_ENDPOINT=https://your-api-gateway.zuplo.dev
203
240
  ```
204
241
 
205
- **Key Components**:
206
- - **Authentication**: Clerk OAuth 2.0 with PKCE flow + automatic token refresh
207
- - **Session Storage**: `~/.um/auth.json` (tokens with refresh capability)
208
- - **Project Config**: `.um/config.json` (per-directory context)
209
- - **Provider Detection**: Auto-detect 5 AI tools
210
- - **MCP Server**: stdio transport proxying to HTTP gateway
211
- - **Context Auto-Detection**: Project-aware based on working directory
242
+ Get these values from:
243
+ - **Clerk credentials**: [Clerk Dashboard](https://dashboard.clerk.com)
244
+ - **API endpoint**: Your UnifiedMemory deployment
212
245
 
213
- ## License
246
+ **Optional configuration**:
247
+ ```bash
248
+ # Customize OAuth redirect (defaults shown)
249
+ REDIRECT_URI=http://localhost:3333/callback
250
+ PORT=3333
251
+ ```
252
+
253
+ See `.env.example` for the complete template with documentation.
254
+
255
+ ## Privacy & Security
256
+
257
+ UnifiedMemory CLI follows security best practices to protect your credentials and data:
258
+
259
+ ### Secure Token Storage
260
+ - **File permissions**: Tokens stored in `~/.um/auth.json` with `0600` permissions (owner read/write only)
261
+ - **Directory permissions**: `~/.um/` directory has `0700` permissions (owner access only)
262
+ - **No plaintext exposure**: Tokens are never logged to console or stored in project files
263
+ - **Auto-refresh**: Tokens refresh automatically before expiring
214
264
 
215
- MIT
265
+ ### Authentication Security
266
+ - **PKCE flow**: Uses OAuth 2.0 PKCE for secure authentication without client secrets
267
+ - **CSRF protection**: Cryptographically secure random state parameters
268
+ - **Local-first**: All authentication happens on your machine, never shared with third parties
269
+
270
+ ### Project Security
271
+ - **No git commits**: `.um/` directory automatically added to `.gitignore`
272
+ - **Project isolation**: Each project has its own configuration and vault
273
+ - **Environment-based config**: No hardcoded credentials in source code
274
+ - **Minimal permissions**: CLI only requests access it needs
275
+
276
+ ### What We Don't Collect
277
+ - ❌ No tokens in analytics
278
+ - ❌ No credentials in error reports
279
+ - ❌ No project code sent to our servers
280
+ - ✅ Only encrypted knowledge stored in your vault
281
+
282
+ ### Security Updates
283
+ Security issues are taken seriously. To report a vulnerability, please email security@unifiedmemory.ai (do not use public issues).
284
+
285
+ ## Learn More
286
+
287
+ - **Website**: [unifiedmemory.ai](https://unifiedmemory.ai)
288
+ - **Documentation**: [docs.unifiedmemory.ai](https://docs.unifiedmemory.ai)
289
+ - **Support**: [GitHub Issues](https://github.com/Episodic-Solutions/um-cli/issues)
290
+
291
+ ## License
216
292
 
217
- ## Support
293
+ PROPRIETARY - Copyright (c) 2024-2026 Episodic Solutions Limited. All rights reserved.
218
294
 
219
- - GitHub Issues: https://github.com/unifiedmemory/um-cli/issues
220
- - Documentation: https://docs.unifiedmemory.ai
295
+ See [LICENSE](./LICENSE) for details.