@unifiedmemory/cli 1.2.0 โ 1.3.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/.env.example +27 -12
- package/CHANGELOG.md +21 -0
- package/README.md +17 -23
- package/lib/config.js +18 -30
- package/package.json +1 -1
package/.env.example
CHANGED
|
@@ -1,29 +1,44 @@
|
|
|
1
1
|
# UnifiedMemory CLI Configuration
|
|
2
|
-
#
|
|
2
|
+
#
|
|
3
|
+
# ============================================
|
|
4
|
+
# IMPORTANT: This file is OPTIONAL
|
|
5
|
+
# ============================================
|
|
6
|
+
# The CLI includes production defaults for all values below.
|
|
7
|
+
# This file is only needed if you want to override defaults
|
|
8
|
+
# (e.g., for development, testing, or custom deployments).
|
|
9
|
+
#
|
|
10
|
+
# For normal usage, you can delete this file - the CLI will work without it.
|
|
11
|
+
#
|
|
12
|
+
# To use custom values:
|
|
13
|
+
# 1. Copy this file to .env
|
|
14
|
+
# 2. Uncomment and modify the values you want to override
|
|
15
|
+
# 3. Leave other values commented to use the built-in defaults
|
|
3
16
|
|
|
4
17
|
# ============================================
|
|
5
|
-
#
|
|
18
|
+
# Clerk OAuth Configuration
|
|
6
19
|
# ============================================
|
|
7
|
-
#
|
|
8
|
-
|
|
9
|
-
|
|
20
|
+
# Production defaults are included in the CLI
|
|
21
|
+
# Only override these if using a custom Clerk instance
|
|
22
|
+
# CLERK_CLIENT_ID=custom_clerk_client_id
|
|
23
|
+
# CLERK_DOMAIN=custom-app.clerk.accounts.dev
|
|
10
24
|
|
|
11
25
|
# ============================================
|
|
12
|
-
#
|
|
26
|
+
# API Configuration
|
|
13
27
|
# ============================================
|
|
14
|
-
#
|
|
15
|
-
|
|
28
|
+
# Production default is included in the CLI
|
|
29
|
+
# Only override this for local testing or custom deployments
|
|
30
|
+
# API_ENDPOINT=https://custom-api-gateway.zuplo.dev
|
|
16
31
|
|
|
17
32
|
# ============================================
|
|
18
|
-
#
|
|
33
|
+
# OAuth Flow Configuration
|
|
19
34
|
# ============================================
|
|
20
|
-
#
|
|
21
|
-
#
|
|
35
|
+
# Defaults to localhost:3333 for the OAuth callback server
|
|
36
|
+
# Customize only if you need a different port or URL
|
|
22
37
|
# REDIRECT_URI=http://localhost:3333/callback
|
|
23
38
|
# PORT=3333
|
|
24
39
|
|
|
25
40
|
# ============================================
|
|
26
|
-
#
|
|
41
|
+
# Clerk Client Secret (Optional)
|
|
27
42
|
# ============================================
|
|
28
43
|
# Not required for PKCE flow (recommended)
|
|
29
44
|
# Only set this if specifically instructed
|
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **lib/config.js** - Embedded production defaults for zero-configuration installation
|
|
13
|
+
- Added default values for `CLERK_CLIENT_ID`, `CLERK_DOMAIN`, and `API_ENDPOINT`
|
|
14
|
+
- Users no longer need to create `.env` files after `npm install`
|
|
15
|
+
- Environment variables can still override defaults for development/testing
|
|
16
|
+
- Simplified `validateConfig()` to remove "missing environment variables" errors
|
|
17
|
+
- CLI now works immediately after installation with no setup required
|
|
18
|
+
|
|
19
|
+
- **.env.example** - Updated documentation to clarify optional nature
|
|
20
|
+
- Added prominent note that the file is OPTIONAL
|
|
21
|
+
- Explained that production defaults are included in the CLI
|
|
22
|
+
- Commented out all example values to emphasize optional overrides
|
|
23
|
+
- Clarified when overrides might be needed (development, testing, custom deployments)
|
|
24
|
+
|
|
25
|
+
- **README.md** - Improved installation and configuration documentation
|
|
26
|
+
- Added "No configuration required!" note to installation section
|
|
27
|
+
- Renamed "Configuration" to "Advanced Configuration (Optional)"
|
|
28
|
+
- Removed "Missing environment variables" from troubleshooting
|
|
29
|
+
- Emphasized zero-friction installation experience
|
|
30
|
+
|
|
10
31
|
## [1.2.0] - 2026-01-08
|
|
11
32
|
|
|
12
33
|
### Added
|
package/README.md
CHANGED
|
@@ -171,6 +171,8 @@ npm install -g @unifiedmemory/cli
|
|
|
171
171
|
um --version
|
|
172
172
|
```
|
|
173
173
|
|
|
174
|
+
**No configuration required!** The CLI includes production defaults and works immediately after installation.
|
|
175
|
+
|
|
174
176
|
**Option 2: Use with npx (no installation)**
|
|
175
177
|
```bash
|
|
176
178
|
npx @unifiedmemory/cli init
|
|
@@ -213,43 +215,35 @@ Tokens automatically refresh. If you see auth errors:
|
|
|
213
215
|
um login
|
|
214
216
|
```
|
|
215
217
|
|
|
216
|
-
|
|
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
|
|
218
|
+
## Advanced Configuration (Optional)
|
|
221
219
|
|
|
222
|
-
|
|
220
|
+
**For most users, no configuration is needed!** The CLI includes production defaults and works out of the box.
|
|
223
221
|
|
|
224
|
-
|
|
222
|
+
For development, testing, or custom deployments, you can override defaults by creating a `.env` file:
|
|
225
223
|
|
|
226
|
-
**Step 1: Create `.env` file**
|
|
224
|
+
**Step 1: Create `.env` file** (optional)
|
|
227
225
|
```bash
|
|
228
226
|
# In the um-cli installation directory (find with: npm root -g)
|
|
229
227
|
cp .env.example .env
|
|
230
228
|
```
|
|
231
229
|
|
|
232
|
-
**Step 2:
|
|
230
|
+
**Step 2: Override the values you need** (optional)
|
|
233
231
|
```bash
|
|
234
|
-
#
|
|
235
|
-
CLERK_CLIENT_ID=
|
|
236
|
-
CLERK_DOMAIN=
|
|
237
|
-
|
|
238
|
-
# Required: API Configuration
|
|
239
|
-
API_ENDPOINT=https://your-api-gateway.zuplo.dev
|
|
240
|
-
```
|
|
232
|
+
# Optional: Override production defaults
|
|
233
|
+
CLERK_CLIENT_ID=custom_clerk_client_id
|
|
234
|
+
CLERK_DOMAIN=custom-app.clerk.accounts.dev
|
|
235
|
+
API_ENDPOINT=https://custom-api-gateway.zuplo.dev
|
|
241
236
|
|
|
242
|
-
|
|
243
|
-
- **Clerk credentials**: [Clerk Dashboard](https://dashboard.clerk.com)
|
|
244
|
-
- **API endpoint**: Your UnifiedMemory deployment
|
|
245
|
-
|
|
246
|
-
**Optional configuration**:
|
|
247
|
-
```bash
|
|
248
|
-
# Customize OAuth redirect (defaults shown)
|
|
237
|
+
# Optional: Customize OAuth redirect (defaults to localhost:3333)
|
|
249
238
|
REDIRECT_URI=http://localhost:3333/callback
|
|
250
239
|
PORT=3333
|
|
251
240
|
```
|
|
252
241
|
|
|
242
|
+
**When you might need this**:
|
|
243
|
+
- ๐ง **Development**: Testing with a local API backend
|
|
244
|
+
- ๐งช **Testing**: Using a staging or test Clerk instance
|
|
245
|
+
- ๐ข **Custom Deployment**: Running your own UnifiedMemory instance
|
|
246
|
+
|
|
253
247
|
See `.env.example` for the complete template with documentation.
|
|
254
248
|
|
|
255
249
|
## Privacy & Security
|
package/lib/config.js
CHANGED
|
@@ -9,49 +9,37 @@ const __dirname = dirname(__filename);
|
|
|
9
9
|
dotenvConfig({ path: join(__dirname, '..', '.env') });
|
|
10
10
|
|
|
11
11
|
export const config = {
|
|
12
|
-
//
|
|
13
|
-
clerkClientId: process.env.CLERK_CLIENT_ID,
|
|
12
|
+
// Clerk OAuth configuration (production defaults, can be overridden via env vars)
|
|
13
|
+
clerkClientId: process.env.CLERK_CLIENT_ID || 'nULlnomaKB9rRGP2',
|
|
14
14
|
clerkClientSecret: process.env.CLERK_CLIENT_SECRET, // Optional for PKCE flow
|
|
15
|
-
clerkDomain: process.env.CLERK_DOMAIN,
|
|
15
|
+
clerkDomain: process.env.CLERK_DOMAIN || 'clear-caiman-45.clerk.accounts.dev',
|
|
16
16
|
|
|
17
|
-
//
|
|
18
|
-
apiEndpoint: process.env.API_ENDPOINT,
|
|
17
|
+
// API configuration (production default, can be overridden via env var)
|
|
18
|
+
apiEndpoint: process.env.API_ENDPOINT || 'https://rose-asp-main-1c0b114.d2.zuplo.dev',
|
|
19
19
|
|
|
20
|
-
//
|
|
20
|
+
// OAuth flow configuration (localhost defaults for callback server)
|
|
21
21
|
redirectUri: process.env.REDIRECT_URI || 'http://localhost:3333/callback',
|
|
22
22
|
port: parseInt(process.env.PORT || '3333', 10)
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
// Validation function -
|
|
25
|
+
// Validation function - validates configuration values
|
|
26
26
|
export function validateConfig() {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (!config.clerkClientId) {
|
|
30
|
-
missing.push('CLERK_CLIENT_ID');
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (!config.clerkDomain) {
|
|
34
|
-
missing.push('CLERK_DOMAIN');
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (!config.apiEndpoint) {
|
|
38
|
-
missing.push('API_ENDPOINT');
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (missing.length > 0) {
|
|
42
|
-
throw new Error(
|
|
43
|
-
`Missing required environment variables: ${missing.join(', ')}\n\n` +
|
|
44
|
-
`Please create a .env file in the project root with these values.\n` +
|
|
45
|
-
`See .env.example for a template.`
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Validate URL format for apiEndpoint
|
|
27
|
+
// Validate URL format for apiEndpoint (now guaranteed to exist via defaults)
|
|
50
28
|
try {
|
|
51
29
|
new URL(config.apiEndpoint);
|
|
52
30
|
} catch (e) {
|
|
53
31
|
throw new Error(`API_ENDPOINT must be a valid URL (got: ${config.apiEndpoint})`);
|
|
54
32
|
}
|
|
55
33
|
|
|
34
|
+
// Validate clerkDomain is not empty (basic sanity check)
|
|
35
|
+
if (!config.clerkDomain || config.clerkDomain.trim() === '') {
|
|
36
|
+
throw new Error('CLERK_DOMAIN cannot be empty');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Validate clerkClientId is not empty (basic sanity check)
|
|
40
|
+
if (!config.clerkClientId || config.clerkClientId.trim() === '') {
|
|
41
|
+
throw new Error('CLERK_CLIENT_ID cannot be empty');
|
|
42
|
+
}
|
|
43
|
+
|
|
56
44
|
return true;
|
|
57
45
|
}
|