@octen.ai/cli 0.1.9 → 0.1.10

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.
@@ -5,6 +5,7 @@ import { installMcp } from "../mcp/install.js";
5
5
  import { mcpStatus } from "../mcp/detect.js";
6
6
  import { resolveApiKey } from "../config/resolve.js";
7
7
  import { isClientInstalled } from "../util/detectClient.js";
8
+ import { quotePath } from "../util/quotePath.js";
8
9
  // Exported so tests can call with injected dirs
9
10
  export function registerConfigureMcp(program, internal = {}) {
10
11
  program
@@ -110,7 +111,7 @@ export function registerConfigureMcp(program, internal = {}) {
110
111
  process.stdout.write(`${client.label}: configured via claude CLI\n`);
111
112
  }
112
113
  else {
113
- process.stdout.write(`${client.label}: configured → ${result.path}\n`);
114
+ process.stdout.write(`${client.label}: configured → ${quotePath(result.path)}\n`);
114
115
  }
115
116
  }
116
117
  catch (err) {
@@ -8,6 +8,7 @@ import { installSkills, skillStatus } from "../skills/install.js";
8
8
  import { setClientEnvKey } from "../skills/setkey.js";
9
9
  import { OctenValidationError } from "../api/errors.js";
10
10
  import { isClientInstalled } from "../util/detectClient.js";
11
+ import { quotePath } from "../util/quotePath.js";
11
12
  // Exported so tests can call with injected dirs
12
13
  export function registerConfigureSkills(program, internal = {}) {
13
14
  program
@@ -134,7 +135,7 @@ export function registerConfigureSkills(program, internal = {}) {
134
135
  try {
135
136
  const installed = installSkills(srcDir, targetDir, ref, only);
136
137
  const skillList = installed.length > 0 ? installed.join(", ") : "(none)";
137
- process.stdout.write(`${client.label}: installed [${skillList}] → ${targetDir} (source: ${source})\n`);
138
+ process.stdout.write(`${client.label}: installed [${skillList}] → ${quotePath(targetDir)} (source: ${source})\n`);
138
139
  }
139
140
  catch (err) {
140
141
  const msg = err instanceof Error ? err.message : String(err);
@@ -157,7 +158,7 @@ export function registerConfigureSkills(program, internal = {}) {
157
158
  for (const client of selected) {
158
159
  const result = setClientEnvKey(client.id, key, scope, home, cwd);
159
160
  if (result.written) {
160
- process.stdout.write(`set OCTEN_API_KEY in ${client.label} (${result.path})\n`);
161
+ process.stdout.write(`set OCTEN_API_KEY in ${client.label} (${quotePath(result.path)})\n`);
161
162
  }
162
163
  else {
163
164
  process.stdout.write(`${client.label}: ${result.hint}\n`);
@@ -4,6 +4,7 @@ import { MCP_CLIENTS } from "../mcp/clients.js";
4
4
  import { SKILL_CLIENTS } from "../skills/clients.js";
5
5
  import { removeMcp } from "../mcp/install.js";
6
6
  import { removeSkills } from "../skills/install.js";
7
+ import { quotePath } from "../util/quotePath.js";
7
8
  // Maps CLI flag name → client id (shared across both registries)
8
9
  const CLIENT_FLAG_MAP = {
9
10
  claudeCode: "claude-code",
@@ -71,7 +72,7 @@ export function registerReset(program, internal = {}) {
71
72
  try {
72
73
  const result = removeMcp(client, scope, home, cwd, installOpts);
73
74
  if (result.removed) {
74
- process.stdout.write(`removed octen from ${client.label} (${result.path})\n`);
75
+ process.stdout.write(`removed octen from ${client.label} (${quotePath(result.path)})\n`);
75
76
  }
76
77
  else {
77
78
  process.stdout.write(`octen not present in ${client.label}\n`);
@@ -86,13 +87,20 @@ export function registerReset(program, internal = {}) {
86
87
  }
87
88
  // --- Skills surface ---
88
89
  if (doSkills) {
89
- const selectedSkillClients = selectClients(SKILL_CLIENTS);
90
+ // Claude Desktop shares Claude Code's ~/.claude/skills, so for the skills
91
+ // surface treat --claude-desktop as --claude-code (consistent with configure-skills).
92
+ const skillRequestedIds = new Set(requestedIds);
93
+ if (skillRequestedIds.has("claude-desktop"))
94
+ skillRequestedIds.add("claude-code");
95
+ const selectedSkillClients = opts.all || !anyPerClientFlag
96
+ ? SKILL_CLIENTS
97
+ : SKILL_CLIENTS.filter((c) => skillRequestedIds.has(c.id));
90
98
  for (const client of selectedSkillClients) {
91
99
  try {
92
100
  const skillsDir = client.dirFor(scope, home, cwd);
93
101
  const removed = removeSkills(skillsDir);
94
102
  if (removed.length > 0) {
95
- process.stdout.write(`removed [${removed.join(", ")}] from ${client.label} (${skillsDir})\n`);
103
+ process.stdout.write(`removed [${removed.join(", ")}] from ${client.label} (${quotePath(skillsDir)})\n`);
96
104
  }
97
105
  else {
98
106
  process.stdout.write(`no octen skills in ${client.label}\n`);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Make a filesystem path safe to copy-paste into a shell command.
3
+ *
4
+ * macOS config paths often contain spaces (e.g. "Application Support"), and a
5
+ * bare path printed to the console breaks when pasted into `cat <path>`. If the
6
+ * path contains whitespace or shell-special characters, wrap it in single
7
+ * quotes (escaping any embedded single quote); otherwise return it unchanged.
8
+ */
9
+ export declare function quotePath(p: string): string;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Make a filesystem path safe to copy-paste into a shell command.
3
+ *
4
+ * macOS config paths often contain spaces (e.g. "Application Support"), and a
5
+ * bare path printed to the console breaks when pasted into `cat <path>`. If the
6
+ * path contains whitespace or shell-special characters, wrap it in single
7
+ * quotes (escaping any embedded single quote); otherwise return it unchanged.
8
+ */
9
+ export function quotePath(p) {
10
+ if (!/[\s'"$`\\!*?(){}\[\]|&;<>~#]/.test(p))
11
+ return p;
12
+ return `'${p.replace(/'/g, "'\\''")}'`;
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octen.ai/cli",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Command-line tool for Octen — web search, extract, chat, embeddings, and one-command MCP/Skills setup.",
5
5
  "type": "module",
6
6
  "license": "MIT",