create-snipara 1.3.28 → 1.3.30
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 +17 -1
- package/dist/index.js +22 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -121,6 +121,7 @@ Keep the package roles simple:
|
|
|
121
121
|
|
|
122
122
|
- `create-snipara` = connect the user to Hosted MCP Context + Memory
|
|
123
123
|
- `create-snipara --github` = connect the current GitHub repository through the browser approval flow for repository sync and PR Answer Packs
|
|
124
|
+
- `snipara-openclaw-install` = OpenClaw-only wrapper for Hosted MCP config plus OpenClaw env and hook setup
|
|
124
125
|
- `snipara-business` = prepare business context from local or mounted folders
|
|
125
126
|
- Hosted MCP = the runtime surface the LLM actually uses after setup
|
|
126
127
|
|
|
@@ -287,7 +288,10 @@ npx create-snipara --advanced
|
|
|
287
288
|
# Sandbox-only local execution
|
|
288
289
|
npx create-snipara --runtime-only
|
|
289
290
|
|
|
290
|
-
#
|
|
291
|
+
# Safer non-interactive setup with an existing API key
|
|
292
|
+
SNIPARA_API_KEY=snp-xxx npx create-snipara -y --slug my-project
|
|
293
|
+
|
|
294
|
+
# Compatibility path; prints a warning because CLI args can leak
|
|
291
295
|
npx create-snipara -y --api-key snp-xxx --slug my-project
|
|
292
296
|
|
|
293
297
|
# Open GitHub automation after setup when a GitHub remote is detected
|
|
@@ -307,11 +311,17 @@ npx create-snipara repair --with-runtime
|
|
|
307
311
|
npx create-snipara upgrade --with-runtime
|
|
308
312
|
```
|
|
309
313
|
|
|
314
|
+
When `.mcp.json` contains a live API key, `create-snipara` writes it with
|
|
315
|
+
restrictive permissions (`600`) where the platform supports it. Do not hardcode
|
|
316
|
+
keys in checked-in config files; prefer environment variables, the browser auth
|
|
317
|
+
flow, or the interactive hidden prompt.
|
|
318
|
+
|
|
310
319
|
## Packaging Model
|
|
311
320
|
|
|
312
321
|
The intended split is:
|
|
313
322
|
|
|
314
323
|
- `create-snipara`: Context + Memory onboarding, auth, config, inspect, repair, and upgrade
|
|
324
|
+
- `snipara-openclaw-install`: OpenClaw-only setup wrapper that remains narrower than `create-snipara`
|
|
315
325
|
- `snipara-companion`: default local workflow helper; legacy `rlm-hook` commands remain compatible
|
|
316
326
|
- `snipara-mcp`: local stdio bridge, client-package development, compatibility, and testing
|
|
317
327
|
- `snipara-sandbox`: optional local execution engine
|
|
@@ -333,6 +343,10 @@ that client has a useful local hook surface. Codex, Gemini, VS Code, Continue,
|
|
|
333
343
|
ChatGPT, and custom clients are treated as MCP-first: they get the hosted MCP
|
|
334
344
|
configuration/reference and agent instructions, not invented local hooks.
|
|
335
345
|
|
|
346
|
+
OpenClaw is the specialized exception: use `snipara-openclaw-install` for a
|
|
347
|
+
single OpenClaw-focused setup command, or use `create-snipara` plus
|
|
348
|
+
`snipara-openclaw-hooks` when you want the explicit base setup path.
|
|
349
|
+
|
|
336
350
|
This keeps setup and runtime separated while still giving the user one obvious command to start from.
|
|
337
351
|
|
|
338
352
|
## Generated Local Pack
|
|
@@ -403,6 +417,8 @@ Recommended explanation to users:
|
|
|
403
417
|
Existing manual API keys passed to `create-snipara --api-key` should start with `snp-`;
|
|
404
418
|
legacy `rlm_` keys remain accepted for migration. When `create-snipara` provisions a
|
|
405
419
|
new account through the browser flow, Snipara returns a new `snp-` key from the current hosted API.
|
|
420
|
+
Prefer `SNIPARA_API_KEY` or the interactive prompt over `--api-key`; CLI
|
|
421
|
+
arguments can be visible in shell history and process listings.
|
|
406
422
|
|
|
407
423
|
| Tooling | Snipara API key | LLM API key |
|
|
408
424
|
| --------------------------------------------------- | -------------------------- | ----------- |
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import { homedir } from "os";
|
|
|
13
13
|
// package.json
|
|
14
14
|
var package_default = {
|
|
15
15
|
name: "create-snipara",
|
|
16
|
-
version: "1.3.
|
|
16
|
+
version: "1.3.30",
|
|
17
17
|
description: "Onboard Snipara Hosted MCP Context + Memory with auth, companion workflows, and optional Snipara Sandbox",
|
|
18
18
|
main: "dist/index.js",
|
|
19
19
|
type: "module",
|
|
@@ -468,6 +468,9 @@ async function gatherConfiguration(options) {
|
|
|
468
468
|
if (providedApiKey && !isManualApiKey(providedApiKey)) {
|
|
469
469
|
throw new Error(manualApiKeyValidationMessage());
|
|
470
470
|
}
|
|
471
|
+
if (providedApiKey) {
|
|
472
|
+
warnApiKeyCliExposure();
|
|
473
|
+
}
|
|
471
474
|
if (options.yes) {
|
|
472
475
|
return buildAnswersFromProfile({
|
|
473
476
|
projectSlug: options.slug || detectedSlug || "my-project",
|
|
@@ -891,6 +894,13 @@ function isManualApiKey(value) {
|
|
|
891
894
|
function manualApiKeyValidationMessage() {
|
|
892
895
|
return "API key should start with snp- or legacy rlm_";
|
|
893
896
|
}
|
|
897
|
+
function warnApiKeyCliExposure() {
|
|
898
|
+
console.log(
|
|
899
|
+
chalk.yellow(
|
|
900
|
+
" \u26A0\uFE0F --api-key can be exposed in shell history or process lists. Prefer SNIPARA_API_KEY or the interactive prompt for future runs."
|
|
901
|
+
)
|
|
902
|
+
);
|
|
903
|
+
}
|
|
894
904
|
function isProvisionedApiKey(value) {
|
|
895
905
|
return value.trim().startsWith("snp-");
|
|
896
906
|
}
|
|
@@ -1079,7 +1089,11 @@ async function createMcpConfig(answers) {
|
|
|
1079
1089
|
headers: {}
|
|
1080
1090
|
};
|
|
1081
1091
|
}
|
|
1082
|
-
fs.writeFileSync(mcpConfigPath, JSON.stringify(mcpConfig, null, 2) + "\n");
|
|
1092
|
+
fs.writeFileSync(mcpConfigPath, JSON.stringify(mcpConfig, null, 2) + "\n", { mode: 384 });
|
|
1093
|
+
try {
|
|
1094
|
+
fs.chmodSync(mcpConfigPath, 384);
|
|
1095
|
+
} catch {
|
|
1096
|
+
}
|
|
1083
1097
|
console.log(chalk.green(" \u2713 Created .mcp.json"));
|
|
1084
1098
|
ensureGitignoreEntry(".mcp.json", "# Snipara MCP config (contains API key)");
|
|
1085
1099
|
if (answers.aiClient === "claude-desktop") {
|
|
@@ -1645,7 +1659,7 @@ async function createCompanionConfig(answers) {
|
|
|
1645
1659
|
apiUrl: API_URL
|
|
1646
1660
|
};
|
|
1647
1661
|
const workspaceConfig = {
|
|
1648
|
-
projectId: answers.
|
|
1662
|
+
projectId: answers.projectSlug,
|
|
1649
1663
|
sessionId: typeof existingWorkspaceConfig.sessionId === "string" && existingWorkspaceConfig.sessionId ? existingWorkspaceConfig.sessionId : `sess_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`
|
|
1650
1664
|
};
|
|
1651
1665
|
fs.writeFileSync(globalConfigPath, JSON.stringify(globalConfig, null, 2) + "\n");
|
|
@@ -1732,7 +1746,7 @@ function getClientGuidance(client) {
|
|
|
1732
1746
|
];
|
|
1733
1747
|
}
|
|
1734
1748
|
function getCompanionCommands(answers) {
|
|
1735
|
-
const
|
|
1749
|
+
const projectFlag = answers.projectSlug ? ` --project ${answers.projectSlug}` : "";
|
|
1736
1750
|
const clientFlag = getCompanionInitClientFlag(answers.aiClient);
|
|
1737
1751
|
const businessOnboardingCommands = answers.installCompanion ? [
|
|
1738
1752
|
{
|
|
@@ -1764,7 +1778,7 @@ function getCompanionCommands(answers) {
|
|
|
1764
1778
|
return [
|
|
1765
1779
|
{
|
|
1766
1780
|
title: "Bootstrap local companion",
|
|
1767
|
-
command: `${COMPANION_COMMAND_NAME} init${clientFlag}${
|
|
1781
|
+
command: `${COMPANION_COMMAND_NAME} init${clientFlag}${projectFlag}`,
|
|
1768
1782
|
purpose: "Re-run local companion setup if this workstation needs to refresh browser login or project selection."
|
|
1769
1783
|
},
|
|
1770
1784
|
{
|
|
@@ -2745,6 +2759,9 @@ function loadExistingAnswers(options) {
|
|
|
2745
2759
|
if (providedApiKey && !isManualApiKey(providedApiKey)) {
|
|
2746
2760
|
throw new Error(manualApiKeyValidationMessage());
|
|
2747
2761
|
}
|
|
2762
|
+
if (providedApiKey) {
|
|
2763
|
+
warnApiKeyCliExposure();
|
|
2764
|
+
}
|
|
2748
2765
|
const envApiKey = readApiKeyFromEnvFiles();
|
|
2749
2766
|
const apiKey = providedApiKey || envApiKey || "YOUR_API_KEY_HERE";
|
|
2750
2767
|
const apiKeyType = effectiveProfile === "runtime-only" ? "none" : providedApiKey || envApiKey ? "api" : "none";
|
package/package.json
CHANGED