@octen.ai/cli 0.1.8 → 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.
package/README.md CHANGED
@@ -151,6 +151,8 @@ octen configure-skills --claude-code --set-key --api-key <key>
151
151
 
152
152
  Supported clients: Claude Code, Cursor, Codex, OpenClaw, Hermes.
153
153
 
154
+ Claude Desktop reads the same `~/.claude/skills` as Claude Code, so `--claude-code` already installs skills the desktop app will use. `--claude-desktop` is accepted as an explicit alias for that shared target.
155
+
154
156
  `--set-key` also writes OCTEN_API_KEY into the client's env config (Claude Code `~/.claude/settings.json`, Codex `config.toml`, OpenClaw `.env`); Cursor/Hermes print a shell-profile hint. The key comes from `--api-key` or the `OCTEN_API_KEY` environment variable.
155
157
 
156
158
  Only clients detected as installed are configured; `--all` skips the rest, and an explicitly-named client that isn't detected is skipped unless you pass `--force`.
@@ -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
@@ -15,6 +16,7 @@ export function registerConfigureSkills(program, internal = {}) {
15
16
  .description("Install Octen Agent Skills into AI clients")
16
17
  .option("--all", "install into all supported clients")
17
18
  .option("--claude-code", "install into Claude Code")
19
+ .option("--claude-desktop", "install for Claude Desktop (shares Claude Code's ~/.claude/skills)")
18
20
  .option("--cursor", "install into Cursor")
19
21
  .option("--codex", "install into Codex")
20
22
  .option("--openclaw", "install into OpenClaw")
@@ -42,16 +44,9 @@ export function registerConfigureSkills(program, internal = {}) {
42
44
  // package root, so ../../skills resolves to the package-root skills/ dir in both.
43
45
  const bundledDir = fileURLToPath(new URL("../../skills", import.meta.url));
44
46
  const cacheDir = join(home, ".cache/octen-cli/skills");
45
- // Determine selected clients
46
- const clientFlagMap = {
47
- "claude-code": "claudeCode",
48
- cursor: "cursor",
49
- codex: "codex",
50
- openclaw: "openclaw",
51
- hermes: "hermes",
52
- };
53
47
  const anySelected = opts.all ||
54
48
  opts.claudeCode ||
49
+ opts.claudeDesktop ||
55
50
  opts.cursor ||
56
51
  opts.codex ||
57
52
  opts.openclaw ||
@@ -91,12 +86,20 @@ export function registerConfigureSkills(program, internal = {}) {
91
86
  }
92
87
  else {
93
88
  // Explicit per-client flags: warn + skip not-installed unless --force.
94
- const requested = SKILL_CLIENTS.filter((c) => {
95
- const flagName = clientFlagMap[c.id];
96
- return flagName
97
- ? Boolean(opts[flagName])
98
- : false;
99
- });
89
+ // --claude-desktop maps to claude-code: Claude Desktop reads the same
90
+ // ~/.claude/skills, so it's configured once there (deduped).
91
+ const wantedIds = new Set();
92
+ if (opts.claudeCode || opts.claudeDesktop)
93
+ wantedIds.add("claude-code");
94
+ if (opts.cursor)
95
+ wantedIds.add("cursor");
96
+ if (opts.codex)
97
+ wantedIds.add("codex");
98
+ if (opts.openclaw)
99
+ wantedIds.add("openclaw");
100
+ if (opts.hermes)
101
+ wantedIds.add("hermes");
102
+ const requested = SKILL_CLIENTS.filter((c) => wantedIds.has(c.id));
100
103
  selected = requested.filter((c) => {
101
104
  if (opts.force || isInstalled(c.id))
102
105
  return true;
@@ -132,7 +135,7 @@ export function registerConfigureSkills(program, internal = {}) {
132
135
  try {
133
136
  const installed = installSkills(srcDir, targetDir, ref, only);
134
137
  const skillList = installed.length > 0 ? installed.join(", ") : "(none)";
135
- process.stdout.write(`${client.label}: installed [${skillList}] → ${targetDir} (source: ${source})\n`);
138
+ process.stdout.write(`${client.label}: installed [${skillList}] → ${quotePath(targetDir)} (source: ${source})\n`);
136
139
  }
137
140
  catch (err) {
138
141
  const msg = err instanceof Error ? err.message : String(err);
@@ -143,6 +146,9 @@ export function registerConfigureSkills(program, internal = {}) {
143
146
  if (anyFailed) {
144
147
  process.exitCode = 1;
145
148
  }
149
+ if (opts.claudeDesktop) {
150
+ process.stdout.write("note: Claude Desktop reads ~/.claude/skills (shared with Claude Code) — installed skills apply to both.\n");
151
+ }
146
152
  if (opts.setKey) {
147
153
  const g = command.optsWithGlobals();
148
154
  const key = g.apiKey || process.env.OCTEN_API_KEY;
@@ -152,7 +158,7 @@ export function registerConfigureSkills(program, internal = {}) {
152
158
  for (const client of selected) {
153
159
  const result = setClientEnvKey(client.id, key, scope, home, cwd);
154
160
  if (result.written) {
155
- 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`);
156
162
  }
157
163
  else {
158
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`);
@@ -32,7 +32,12 @@ export function isClientInstalled(id, opts) {
32
32
  const home = opts?.home ?? os.homedir();
33
33
  switch (id) {
34
34
  case "claude-code":
35
- return binOnPath("claude") || existsSync(join(home, ".claude.json"));
35
+ // Covers the Claude Code CLI (binary / ~/.claude.json) AND the desktop app,
36
+ // which bundles the Claude Code engine and shares the same ~/.claude config.
37
+ return (binOnPath("claude") ||
38
+ existsSync(join(home, ".claude.json")) ||
39
+ appExists("Claude") ||
40
+ existsSync(join(home, "Library/Application Support/Claude/claude-code")));
36
41
  case "cursor":
37
42
  return binOnPath("cursor") || appExists("Cursor");
38
43
  case "codex":
@@ -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.8",
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",