@devness/useai-cli 0.3.5 → 0.3.7

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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/dist/index.js +35 -13
  3. package/package.json +11 -12
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 useai.dev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.js CHANGED
@@ -400,6 +400,12 @@ import { dirname, join as join2 } from "path";
400
400
  import { homedir as homedir2 } from "os";
401
401
  import { parse as parseToml, stringify as stringifyToml } from "smol-toml";
402
402
  import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
403
+ var USEAI_INSTRUCTIONS_TEXT = [
404
+ "## UseAI Session Tracking",
405
+ "- At the START of every conversation, call `useai_session_start` with the appropriate task_type.",
406
+ "- For LONG sessions (15+ min), call `useai_heartbeat` periodically.",
407
+ "- At the END of every conversation, call `useai_session_end` with languages used, files_touched_count, and milestones (generic descriptions only \u2014 no project names, file paths, or company names)."
408
+ ].join("\n");
403
409
  var MCP_ENTRY = {
404
410
  command: "npx",
405
411
  args: ["-y", "@devness/useai"]
@@ -671,7 +677,8 @@ function createTool(def) {
671
677
  remove: () => {
672
678
  handler.remove(def.configPath);
673
679
  if (def.instructions) removeInstructions(def.instructions);
674
- }
680
+ },
681
+ getManualHint: () => def.instructions ? null : def.manualHint ?? null
675
682
  };
676
683
  }
677
684
  var appSupport = join2(home, "Library", "Application Support");
@@ -705,19 +712,13 @@ var AI_TOOLS = [
705
712
  detect: () => hasBinary("claude") || existsSync4(join2(home, ".claude.json")),
706
713
  instructions: { method: "append", path: join2(home, ".claude", "CLAUDE.md") }
707
714
  }),
708
- createTool({
709
- id: "claude-desktop",
710
- name: "Claude Desktop",
711
- configFormat: "standard",
712
- configPath: join2(appSupport, "Claude", "claude_desktop_config.json"),
713
- detect: () => existsSync4(join2(appSupport, "Claude")) || existsSync4("/Applications/Claude.app")
714
- }),
715
715
  createTool({
716
716
  id: "cursor",
717
717
  name: "Cursor",
718
718
  configFormat: "standard",
719
719
  configPath: join2(home, ".cursor", "mcp.json"),
720
- detect: () => existsSync4(join2(home, ".cursor"))
720
+ detect: () => existsSync4(join2(home, ".cursor")),
721
+ manualHint: "Open Cursor Settings \u2192 Rules \u2192 User Rules and paste the instructions below."
721
722
  }),
722
723
  createTool({
723
724
  id: "windsurf",
@@ -756,7 +757,8 @@ var AI_TOOLS = [
756
757
  name: "Zed",
757
758
  configFormat: "zed",
758
759
  configPath: join2(appSupport, "Zed", "settings.json"),
759
- detect: () => existsSync4(join2(appSupport, "Zed"))
760
+ detect: () => existsSync4(join2(appSupport, "Zed")),
761
+ manualHint: "Open Rules Library (\u2318\u2325L) \u2192 click + \u2192 paste the instructions below."
760
762
  }),
761
763
  createTool({
762
764
  id: "cline",
@@ -799,14 +801,16 @@ var AI_TOOLS = [
799
801
  name: "Amazon Q CLI",
800
802
  configFormat: "standard",
801
803
  configPath: join2(home, ".aws", "amazonq", "mcp.json"),
802
- detect: () => hasBinary("q") || existsSync4(join2(home, ".aws", "amazonq"))
804
+ detect: () => hasBinary("q") || existsSync4(join2(home, ".aws", "amazonq")),
805
+ manualHint: "Create .amazonq/rules/useai.md in your project root with the instructions below."
803
806
  }),
804
807
  createTool({
805
808
  id: "amazon-q-ide",
806
809
  name: "Amazon Q IDE",
807
810
  configFormat: "standard",
808
811
  configPath: join2(home, ".aws", "amazonq", "default.json"),
809
- detect: () => existsSync4(join2(home, ".amazonq")) || existsSync4(join2(home, ".aws", "amazonq"))
812
+ detect: () => existsSync4(join2(home, ".amazonq")) || existsSync4(join2(home, ".aws", "amazonq")),
813
+ manualHint: "Create .amazonq/rules/useai.md in your project root with the instructions below."
810
814
  }),
811
815
  createTool({
812
816
  id: "codex",
@@ -837,7 +841,8 @@ var AI_TOOLS = [
837
841
  name: "Junie",
838
842
  configFormat: "standard",
839
843
  configPath: join2(home, ".junie", "mcp", "mcp.json"),
840
- detect: () => existsSync4(join2(home, ".junie"))
844
+ detect: () => existsSync4(join2(home, ".junie")),
845
+ manualHint: "Add the instructions below to .junie/guidelines.md in your project root."
841
846
  })
842
847
  ];
843
848
 
@@ -846,6 +851,21 @@ function shortenPath(p) {
846
851
  const home2 = process.env["HOME"] ?? "";
847
852
  return home2 && p.startsWith(home2) ? p.replace(home2, "~") : p;
848
853
  }
854
+ function showManualHints(installedTools) {
855
+ const hints = installedTools.map((t) => ({ name: t.name, hint: t.getManualHint() })).filter((h) => h.hint !== null);
856
+ if (hints.length === 0) return;
857
+ console.log(chalk6.yellow(`
858
+ \u26A0 Manual setup needed for ${hints.length} tool${hints.length === 1 ? "" : "s"}:
859
+ `));
860
+ for (const { name, hint } of hints) {
861
+ console.log(` ${chalk6.bold(name)}: ${hint}`);
862
+ }
863
+ console.log(chalk6.dim("\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"));
864
+ for (const line of USEAI_INSTRUCTIONS_TEXT.split("\n")) {
865
+ console.log(chalk6.dim(" \u2502 ") + line);
866
+ }
867
+ console.log(chalk6.dim(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n"));
868
+ }
849
869
  function showStatus(tools) {
850
870
  console.log(header("AI Tool MCP Status"));
851
871
  const rows = [];
@@ -885,6 +905,7 @@ async function installFlow(tools, autoYes, explicit) {
885
905
  console.log(error(`\u2717 ${tool.name.padEnd(18)} \u2014 ${err.message}`));
886
906
  }
887
907
  }
908
+ showManualHints(tools);
888
909
  console.log();
889
910
  return;
890
911
  }
@@ -950,6 +971,7 @@ async function installFlow(tools, autoYes, explicit) {
950
971
  } catch {
951
972
  }
952
973
  }
974
+ showManualHints([...toInstall, ...alreadyConfigured]);
953
975
  console.log(`
954
976
  Done! UseAI MCP server configured in ${chalk6.bold(String(toInstall.length))} tool${toInstall.length === 1 ? "" : "s"}.
955
977
  `);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devness/useai-cli",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "CLI tool for useai.dev — stats, sync, publish your AI development workflow",
5
5
  "author": "nabeelkausari",
6
6
  "license": "MIT",
@@ -14,14 +14,6 @@
14
14
  "README.md",
15
15
  "LICENSE"
16
16
  ],
17
- "scripts": {
18
- "build": "tsc -p tsconfig.build.json",
19
- "dev": "tsc --watch",
20
- "bundle": "tsup src/index.ts --format esm --target node18 --no-splitting",
21
- "prepublishOnly": "pnpm run bundle",
22
- "typecheck": "tsc --noEmit",
23
- "clean": "rm -rf dist"
24
- },
25
17
  "dependencies": {
26
18
  "@inquirer/prompts": "^8.2.1",
27
19
  "chalk": "^5.4.1",
@@ -31,9 +23,9 @@
31
23
  },
32
24
  "devDependencies": {
33
25
  "@types/node": "^22.13.4",
34
- "@useai/shared": "workspace:*",
35
26
  "tsup": "^8.0.0",
36
- "typescript": "^5.7.3"
27
+ "typescript": "^5.7.3",
28
+ "@useai/shared": "0.2.0"
37
29
  },
38
30
  "repository": {
39
31
  "type": "git",
@@ -42,5 +34,12 @@
42
34
  "homepage": "https://useai.dev",
43
35
  "engines": {
44
36
  "node": ">=18"
37
+ },
38
+ "scripts": {
39
+ "build": "tsc -p tsconfig.build.json",
40
+ "dev": "tsc --watch",
41
+ "bundle": "tsup src/index.ts --format esm --target node18 --no-splitting",
42
+ "typecheck": "tsc --noEmit",
43
+ "clean": "rm -rf dist"
45
44
  }
46
- }
45
+ }