@nemus-cli/nemus 0.2.1

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 (320) hide show
  1. package/CHANGELOG.md +86 -0
  2. package/LICENSE +21 -0
  3. package/README.md +275 -0
  4. package/assets/README.md +53 -0
  5. package/assets/banner.png +0 -0
  6. package/assets/banner.svg +66 -0
  7. package/assets/favicon-32.png +0 -0
  8. package/assets/favicon-64.png +0 -0
  9. package/assets/icon-256.png +0 -0
  10. package/assets/icon.svg +23 -0
  11. package/assets/logo-256.png +0 -0
  12. package/assets/logo-512.png +0 -0
  13. package/assets/logo-wordmark.svg +35 -0
  14. package/assets/logo.svg +32 -0
  15. package/bin/workspace.js +130 -0
  16. package/dist/cli/ai-prompt.js +421 -0
  17. package/dist/cli/dashboard/AgentList.js +61 -0
  18. package/dist/cli/dashboard/DashboardSidebar.js +280 -0
  19. package/dist/cli/dashboard/HelpFooter.js +73 -0
  20. package/dist/cli/dashboard/StatusBadge.js +50 -0
  21. package/dist/cli/dashboard/index.js +11 -0
  22. package/dist/cli/dashboard/types.js +2 -0
  23. package/dist/cli/tui.js +48 -0
  24. package/dist/commands/ai-prompt.js +22 -0
  25. package/dist/commands/analyze-deps.js +138 -0
  26. package/dist/commands/archive.js +113 -0
  27. package/dist/commands/branch/create.js +119 -0
  28. package/dist/commands/branch/index.js +104 -0
  29. package/dist/commands/branch/merge.js +90 -0
  30. package/dist/commands/branch/rebase.js +84 -0
  31. package/dist/commands/branch/switch.js +165 -0
  32. package/dist/commands/cache/index.js +80 -0
  33. package/dist/commands/cache/manager.js +198 -0
  34. package/dist/commands/cleanup.js +153 -0
  35. package/dist/commands/configure-claude.js +55 -0
  36. package/dist/commands/configure.js +231 -0
  37. package/dist/commands/create.js +204 -0
  38. package/dist/commands/dashboard/hook-handler.js +162 -0
  39. package/dist/commands/dashboard/index.js +258 -0
  40. package/dist/commands/dashboard/launcher.js +40 -0
  41. package/dist/commands/dashboard/session-picker.js +106 -0
  42. package/dist/commands/dashboard/sidebar.js +39 -0
  43. package/dist/commands/dashboard/workspace-picker.js +95 -0
  44. package/dist/commands/delete.js +194 -0
  45. package/dist/commands/deprecated-aliases.js +44 -0
  46. package/dist/commands/diff.js +129 -0
  47. package/dist/commands/doctor.js +141 -0
  48. package/dist/commands/generate-docs.js +77 -0
  49. package/dist/commands/ghq-status.js +72 -0
  50. package/dist/commands/go.js +154 -0
  51. package/dist/commands/history.js +124 -0
  52. package/dist/commands/list.js +191 -0
  53. package/dist/commands/mcp/index.js +69 -0
  54. package/dist/commands/migrate.js +296 -0
  55. package/dist/commands/remove-repo.js +217 -0
  56. package/dist/commands/report-bug.js +112 -0
  57. package/dist/commands/run.js +147 -0
  58. package/dist/commands/save-context.js +171 -0
  59. package/dist/commands/sessions.js +129 -0
  60. package/dist/commands/status.js +138 -0
  61. package/dist/commands/suite/create.js +212 -0
  62. package/dist/commands/suite/delete.js +64 -0
  63. package/dist/commands/suite/export.js +126 -0
  64. package/dist/commands/suite/import.js +128 -0
  65. package/dist/commands/suite/index.js +94 -0
  66. package/dist/commands/suite/list.js +49 -0
  67. package/dist/commands/suite/use.js +227 -0
  68. package/dist/commands/sync.js +117 -0
  69. package/dist/commands/update.js +203 -0
  70. package/dist/mcp/install.js +550 -0
  71. package/dist/mcp/server.js +398 -0
  72. package/dist/mcp/tools.js +922 -0
  73. package/dist/pi-extensions/permission-sync.ts.template +41 -0
  74. package/dist/pi-extensions/permissions-gate.ts.template +69 -0
  75. package/dist/pi-extensions/pr-fix-trigger.ts.template +124 -0
  76. package/dist/pi-extensions/review-reminder.ts.template +58 -0
  77. package/dist/pi-extensions/workspace-input-status.ts.template +919 -0
  78. package/dist/program.js +136 -0
  79. package/dist/scripts/workspace-table.py +394 -0
  80. package/dist/types/dashboard.js +11 -0
  81. package/dist/types/index.js +2 -0
  82. package/dist/utils/agent-config.js +263 -0
  83. package/dist/utils/agent-state.js +178 -0
  84. package/dist/utils/banner.js +24 -0
  85. package/dist/utils/branch-operations.js +232 -0
  86. package/dist/utils/bug-report.js +355 -0
  87. package/dist/utils/cache.js +168 -0
  88. package/dist/utils/claude-integration.js +617 -0
  89. package/dist/utils/claude-sessions.js +260 -0
  90. package/dist/utils/cleanup-operations.js +120 -0
  91. package/dist/utils/colors.js +26 -0
  92. package/dist/utils/command-helpers.js +44 -0
  93. package/dist/utils/config.js +150 -0
  94. package/dist/utils/context-file.js +33 -0
  95. package/dist/utils/dashboard-hooks.js +172 -0
  96. package/dist/utils/dependency-analyzer.js +234 -0
  97. package/dist/utils/diff-operations.js +80 -0
  98. package/dist/utils/doc-generator.js +184 -0
  99. package/dist/utils/ghq-integration.js +332 -0
  100. package/dist/utils/git-operations.js +237 -0
  101. package/dist/utils/git-status.js +187 -0
  102. package/dist/utils/github.js +68 -0
  103. package/dist/utils/health-checks.js +345 -0
  104. package/dist/utils/history.js +150 -0
  105. package/dist/utils/hooks.js +100 -0
  106. package/dist/utils/logger.js +40 -0
  107. package/dist/utils/permission-sync.js +681 -0
  108. package/dist/utils/pi-extensions.js +224 -0
  109. package/dist/utils/progress.js +92 -0
  110. package/dist/utils/prompts.js +279 -0
  111. package/dist/utils/repo-resolver.js +260 -0
  112. package/dist/utils/retry.js +65 -0
  113. package/dist/utils/run-operations.js +30 -0
  114. package/dist/utils/suite.js +159 -0
  115. package/dist/utils/sync-operations.js +107 -0
  116. package/dist/utils/tmux-dashboard.js +184 -0
  117. package/dist/utils/validation.js +153 -0
  118. package/dist/utils/version-check.js +121 -0
  119. package/dist/utils/workspace-meta.js +185 -0
  120. package/install-shell-integration.sh +532 -0
  121. package/install.sh +401 -0
  122. package/package.json +90 -0
  123. package/remove-shell-block.awk +44 -0
  124. package/scripts/postinstall.js +85 -0
  125. package/skills/analyze-deps.md +23 -0
  126. package/skills/archive-workspace.md +26 -0
  127. package/skills/branch-create.md +18 -0
  128. package/skills/create-workspace.md +39 -0
  129. package/skills/delete-workspace.md +37 -0
  130. package/skills/list-org-repos.md +26 -0
  131. package/skills/list-suites.md +24 -0
  132. package/skills/list-workspaces.md +27 -0
  133. package/skills/refresh-workspace-docs.md +89 -0
  134. package/skills/remove-repo.md +25 -0
  135. package/skills/run-command.md +23 -0
  136. package/skills/save-context.md +68 -0
  137. package/skills/search-repos.md +31 -0
  138. package/skills/snapshot-list.md +18 -0
  139. package/skills/snapshot-save.md +12 -0
  140. package/skills/switch-branch.md +18 -0
  141. package/skills/update-cache.md +21 -0
  142. package/skills/update-workspace.md +66 -0
  143. package/skills/workspace-cleanup.md +18 -0
  144. package/skills/workspace-diff.md +23 -0
  145. package/skills/workspace-doctor.md +23 -0
  146. package/skills/workspace-info.md +45 -0
  147. package/skills/workspace-manager/SKILL.md +201 -0
  148. package/skills/workspace-manager/references/ai-prompt.md +44 -0
  149. package/skills/workspace-manager/references/analyze-deps.md +45 -0
  150. package/skills/workspace-manager/references/archive-workspace.md +38 -0
  151. package/skills/workspace-manager/references/branch-create.md +31 -0
  152. package/skills/workspace-manager/references/branch-merge.md +22 -0
  153. package/skills/workspace-manager/references/branch-rebase.md +22 -0
  154. package/skills/workspace-manager/references/cache-clear.md +18 -0
  155. package/skills/workspace-manager/references/cache-info.md +22 -0
  156. package/skills/workspace-manager/references/configure-claude.md +31 -0
  157. package/skills/workspace-manager/references/configure.md +35 -0
  158. package/skills/workspace-manager/references/create-workspace.md +45 -0
  159. package/skills/workspace-manager/references/dashboard.md +61 -0
  160. package/skills/workspace-manager/references/delete-workspace.md +33 -0
  161. package/skills/workspace-manager/references/generate-docs.md +36 -0
  162. package/skills/workspace-manager/references/ghq-status.md +28 -0
  163. package/skills/workspace-manager/references/go.md +33 -0
  164. package/skills/workspace-manager/references/history.md +41 -0
  165. package/skills/workspace-manager/references/list-org-repos.md +26 -0
  166. package/skills/workspace-manager/references/list-suites.md +21 -0
  167. package/skills/workspace-manager/references/list-workspaces.md +27 -0
  168. package/skills/workspace-manager/references/mcp.md +49 -0
  169. package/skills/workspace-manager/references/remove-repo.md +26 -0
  170. package/skills/workspace-manager/references/run-command.md +44 -0
  171. package/skills/workspace-manager/references/search-repos.md +24 -0
  172. package/skills/workspace-manager/references/sessions.md +27 -0
  173. package/skills/workspace-manager/references/suite-create.md +22 -0
  174. package/skills/workspace-manager/references/suite-delete.md +21 -0
  175. package/skills/workspace-manager/references/suite-export.md +19 -0
  176. package/skills/workspace-manager/references/suite-import.md +19 -0
  177. package/skills/workspace-manager/references/suite-use.md +27 -0
  178. package/skills/workspace-manager/references/switch-branch.md +25 -0
  179. package/skills/workspace-manager/references/update-cache.md +22 -0
  180. package/skills/workspace-manager/references/update-workspace.md +50 -0
  181. package/skills/workspace-manager/references/workspace-cleanup.md +33 -0
  182. package/skills/workspace-manager/references/workspace-diff.md +27 -0
  183. package/skills/workspace-manager/references/workspace-doctor.md +27 -0
  184. package/skills/workspace-manager/references/workspace-info.md +33 -0
  185. package/skills/workspace-manager/references/workspace-status.md +43 -0
  186. package/skills/workspace-manager/references/workspace-sync.md +26 -0
  187. package/skills/workspace-status.md +26 -0
  188. package/skills/workspace-sync.md +23 -0
  189. package/src/cli/ai-prompt.test.ts +667 -0
  190. package/src/cli/ai-prompt.ts +421 -0
  191. package/src/cli/dashboard/AgentList.tsx +44 -0
  192. package/src/cli/dashboard/DashboardSidebar.tsx +291 -0
  193. package/src/cli/dashboard/HelpFooter.tsx +22 -0
  194. package/src/cli/dashboard/StatusBadge.tsx +23 -0
  195. package/src/cli/dashboard/index.ts +5 -0
  196. package/src/cli/dashboard/types.ts +16 -0
  197. package/src/cli/tui.tsx +51 -0
  198. package/src/cli/workspace-cli.test.ts +30 -0
  199. package/src/commands/ai-prompt.ts +21 -0
  200. package/src/commands/analyze-deps.ts +119 -0
  201. package/src/commands/archive.ts +114 -0
  202. package/src/commands/branch/create.ts +94 -0
  203. package/src/commands/branch/index.ts +74 -0
  204. package/src/commands/branch/merge.ts +61 -0
  205. package/src/commands/branch/rebase.ts +54 -0
  206. package/src/commands/branch/switch.ts +150 -0
  207. package/src/commands/cache/index.ts +51 -0
  208. package/src/commands/cache/manager.ts +168 -0
  209. package/src/commands/cleanup.ts +132 -0
  210. package/src/commands/configure-claude.ts +55 -0
  211. package/src/commands/configure.ts +204 -0
  212. package/src/commands/create.ts +196 -0
  213. package/src/commands/dashboard/hook-handler.ts +138 -0
  214. package/src/commands/dashboard/index.ts +248 -0
  215. package/src/commands/dashboard/launcher.ts +42 -0
  216. package/src/commands/dashboard/session-picker.ts +73 -0
  217. package/src/commands/dashboard/sidebar.js +39 -0
  218. package/src/commands/dashboard/workspace-picker.ts +62 -0
  219. package/src/commands/delete.test.ts +250 -0
  220. package/src/commands/delete.ts +171 -0
  221. package/src/commands/deprecated-aliases.ts +55 -0
  222. package/src/commands/diff.ts +106 -0
  223. package/src/commands/doctor.ts +110 -0
  224. package/src/commands/generate-docs.ts +45 -0
  225. package/src/commands/ghq-status.ts +70 -0
  226. package/src/commands/go.ts +125 -0
  227. package/src/commands/history.ts +136 -0
  228. package/src/commands/list.test.ts +219 -0
  229. package/src/commands/list.ts +176 -0
  230. package/src/commands/mcp/index.ts +39 -0
  231. package/src/commands/migrate.ts +277 -0
  232. package/src/commands/remove-repo.ts +194 -0
  233. package/src/commands/report-bug.ts +88 -0
  234. package/src/commands/run.ts +125 -0
  235. package/src/commands/save-context.test.ts +113 -0
  236. package/src/commands/save-context.ts +141 -0
  237. package/src/commands/sessions.ts +99 -0
  238. package/src/commands/status.ts +111 -0
  239. package/src/commands/suite/create.ts +240 -0
  240. package/src/commands/suite/delete.ts +65 -0
  241. package/src/commands/suite/export.ts +97 -0
  242. package/src/commands/suite/import.ts +100 -0
  243. package/src/commands/suite/index.ts +66 -0
  244. package/src/commands/suite/list.ts +54 -0
  245. package/src/commands/suite/use.ts +232 -0
  246. package/src/commands/sync.ts +97 -0
  247. package/src/commands/update.ts +197 -0
  248. package/src/mcp/install.ts +529 -0
  249. package/src/mcp/server.ts +579 -0
  250. package/src/mcp/tools.test.ts +545 -0
  251. package/src/mcp/tools.ts +1019 -0
  252. package/src/mcp/update-workspace.test.ts +220 -0
  253. package/src/pi-extensions/permission-sync.ts.template +41 -0
  254. package/src/pi-extensions/permissions-gate.ts.template +69 -0
  255. package/src/pi-extensions/pr-fix-trigger.ts.template +124 -0
  256. package/src/pi-extensions/review-reminder.ts.template +58 -0
  257. package/src/pi-extensions/workspace-input-status.ts.template +919 -0
  258. package/src/program.ts +112 -0
  259. package/src/scripts/workspace-table.py +394 -0
  260. package/src/types/dashboard.ts +29 -0
  261. package/src/types/index.ts +109 -0
  262. package/src/types/ink.d.ts +171 -0
  263. package/src/utils/agent-config.test.ts +303 -0
  264. package/src/utils/agent-config.ts +264 -0
  265. package/src/utils/agent-state.test.ts +166 -0
  266. package/src/utils/agent-state.ts +135 -0
  267. package/src/utils/banner.ts +24 -0
  268. package/src/utils/branch-operations.ts +237 -0
  269. package/src/utils/bug-report.test.ts +174 -0
  270. package/src/utils/bug-report.ts +355 -0
  271. package/src/utils/cache.ts +150 -0
  272. package/src/utils/claude-integration.test.ts +381 -0
  273. package/src/utils/claude-integration.ts +649 -0
  274. package/src/utils/claude-sessions.test.ts +262 -0
  275. package/src/utils/claude-sessions.ts +251 -0
  276. package/src/utils/cleanup-operations.ts +94 -0
  277. package/src/utils/colors.ts +25 -0
  278. package/src/utils/command-helpers.ts +46 -0
  279. package/src/utils/config.test.ts +203 -0
  280. package/src/utils/config.ts +133 -0
  281. package/src/utils/context-file.ts +36 -0
  282. package/src/utils/dashboard-hooks.test.ts +168 -0
  283. package/src/utils/dashboard-hooks.ts +163 -0
  284. package/src/utils/dependency-analyzer.ts +243 -0
  285. package/src/utils/diff-operations.ts +59 -0
  286. package/src/utils/doc-generator.ts +187 -0
  287. package/src/utils/ghq-integration.test.ts +195 -0
  288. package/src/utils/ghq-integration.ts +317 -0
  289. package/src/utils/git-operations.test.ts +265 -0
  290. package/src/utils/git-operations.ts +233 -0
  291. package/src/utils/git-status.ts +171 -0
  292. package/src/utils/github.ts +74 -0
  293. package/src/utils/health-checks.ts +359 -0
  294. package/src/utils/history.ts +140 -0
  295. package/src/utils/hooks.ts +92 -0
  296. package/src/utils/logger.ts +37 -0
  297. package/src/utils/permission-sync.test.ts +593 -0
  298. package/src/utils/permission-sync.ts +720 -0
  299. package/src/utils/pi-extensions.test.ts +182 -0
  300. package/src/utils/pi-extensions.ts +226 -0
  301. package/src/utils/progress.ts +73 -0
  302. package/src/utils/prompts.test.ts +169 -0
  303. package/src/utils/prompts.ts +296 -0
  304. package/src/utils/repo-resolver.test.ts +313 -0
  305. package/src/utils/repo-resolver.ts +294 -0
  306. package/src/utils/retry.test.ts +124 -0
  307. package/src/utils/retry.ts +85 -0
  308. package/src/utils/run-operations.ts +38 -0
  309. package/src/utils/suite.test.ts +256 -0
  310. package/src/utils/suite.ts +144 -0
  311. package/src/utils/sync-operations.ts +87 -0
  312. package/src/utils/tmux-dashboard.ts +193 -0
  313. package/src/utils/validation.test.ts +139 -0
  314. package/src/utils/validation.ts +128 -0
  315. package/src/utils/version-check.test.ts +108 -0
  316. package/src/utils/version-check.ts +96 -0
  317. package/src/utils/workspace-meta.ts +173 -0
  318. package/sync-permissions.sh +137 -0
  319. package/tsconfig.json +20 -0
  320. package/uninstall.sh +162 -0
package/install.sh ADDED
@@ -0,0 +1,401 @@
1
+ #!/bin/bash
2
+
3
+ # Nemus - Installation Script
4
+ # This script installs Nemus and optionally installs ghq
5
+
6
+ set -e
7
+
8
+ # Detect if running via npm postinstall
9
+ NPM_INSTALL_MODE=${NPM_INSTALL_MODE:-false}
10
+ if [ -n "$npm_config_global" ] || [ -n "$npm_execpath" ]; then
11
+ NPM_INSTALL_MODE=true
12
+ fi
13
+
14
+ # Colors
15
+ RED='\033[0;31m'
16
+ GREEN='\033[0;32m'
17
+ YELLOW='\033[1;33m'
18
+ BLUE='\033[0;34m'
19
+ CYAN='\033[0;36m'
20
+ NC='\033[0m' # No Color
21
+
22
+ # Detect OS
23
+ OS="$(uname -s)"
24
+ ARCH="$(uname -m)"
25
+
26
+ if [ "$NPM_INSTALL_MODE" = false ]; then
27
+ echo ""
28
+ echo "============================================================"
29
+ echo -e "${CYAN}Nemus - Installation${NC}"
30
+ echo "============================================================"
31
+ echo ""
32
+ fi
33
+
34
+ # Function to print colored messages
35
+ print_success() {
36
+ echo -e "${GREEN}✓${NC} $1"
37
+ }
38
+
39
+ print_error() {
40
+ echo -e "${RED}✗${NC} $1"
41
+ }
42
+
43
+ print_warning() {
44
+ echo -e "${YELLOW}⚠${NC} $1"
45
+ }
46
+
47
+ print_info() {
48
+ echo -e "${BLUE}ℹ${NC} $1"
49
+ }
50
+
51
+ # Check prerequisites
52
+ echo "Checking prerequisites..."
53
+ echo ""
54
+
55
+ # Check Node.js
56
+ if ! command -v node &> /dev/null; then
57
+ print_error "Node.js is not installed"
58
+ echo "Please install Node.js 22+ from: https://nodejs.org/"
59
+ exit 1
60
+ fi
61
+
62
+ # Check Node.js version
63
+ NODE_VERSION=$(node --version | cut -d'v' -f2 | cut -d'.' -f1)
64
+ if [ "$NODE_VERSION" -lt 22 ]; then
65
+ print_error "Node.js 22+ required, but found $(node --version)"
66
+ echo "Please upgrade Node.js: https://nodejs.org/"
67
+ echo ""
68
+ echo "Current version: $(node --version)"
69
+ echo "Required version: v22.0.0 or higher"
70
+ exit 1
71
+ fi
72
+ print_success "Node.js $(node --version) found"
73
+
74
+ # Check npm
75
+ if ! command -v npm &> /dev/null; then
76
+ print_error "npm is not installed"
77
+ echo "Please install npm"
78
+ exit 1
79
+ fi
80
+ print_success "npm $(npm --version) found"
81
+
82
+ # Check git
83
+ if ! command -v git &> /dev/null; then
84
+ print_error "Git is not installed"
85
+ echo "Please install Git"
86
+ exit 1
87
+ fi
88
+ print_success "Git $(git --version | cut -d' ' -f3) found"
89
+
90
+ # Check gh CLI
91
+ if ! command -v gh &> /dev/null; then
92
+ print_warning "GitHub CLI (gh) is not installed"
93
+ echo ""
94
+ echo "Nemus requires GitHub CLI to fetch repositories."
95
+ echo ""
96
+ read -p "Install GitHub CLI now? (y/n) " -n 1 -r
97
+ echo ""
98
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
99
+ if [[ "$OS" == "Darwin" ]]; then
100
+ if command -v brew &> /dev/null; then
101
+ print_info "Installing GitHub CLI via Homebrew..."
102
+ brew install gh
103
+ print_success "GitHub CLI installed"
104
+ else
105
+ print_error "Homebrew not found. Please install from: https://brew.sh/"
106
+ exit 1
107
+ fi
108
+ elif [[ "$OS" == "Linux" ]]; then
109
+ print_info "Installing GitHub CLI..."
110
+ type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
111
+ curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
112
+ && sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
113
+ && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
114
+ && sudo apt update \
115
+ && sudo apt install gh -y
116
+ print_success "GitHub CLI installed"
117
+ else
118
+ print_error "Unsupported OS for automatic installation"
119
+ echo "Please install GitHub CLI manually: https://cli.github.com/"
120
+ exit 1
121
+ fi
122
+ else
123
+ print_warning "Skipping GitHub CLI installation"
124
+ echo "You'll need to install it manually before using Nemus."
125
+ fi
126
+ else
127
+ print_success "GitHub CLI $(gh --version | head -1 | cut -d' ' -f3) found"
128
+ fi
129
+
130
+ echo ""
131
+ echo "============================================================"
132
+ echo "Installing Nemus"
133
+ echo "============================================================"
134
+ echo ""
135
+
136
+ # Get the directory where this script is located
137
+ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
138
+ print_info "Installing from: $SCRIPT_DIR"
139
+
140
+ # Install npm dependencies (skip if already running via npm install)
141
+ if [ "$NPM_INSTALL_MODE" = false ]; then
142
+ print_info "Installing dependencies..."
143
+ cd "$SCRIPT_DIR"
144
+ npm install
145
+
146
+ # Build TypeScript
147
+ print_info "Building TypeScript files..."
148
+ npm run build
149
+
150
+ # Create global link
151
+ print_info "Creating global command..."
152
+ npm link
153
+
154
+ print_success "Nemus installed!"
155
+ else
156
+ print_info "Installing via npm - dependencies already handled"
157
+ cd "$SCRIPT_DIR"
158
+ fi
159
+
160
+ echo ""
161
+ echo "============================================================"
162
+ echo "Optional: Install ghq (Recommended)"
163
+ echo "============================================================"
164
+ echo ""
165
+ echo "ghq provides 10-15x faster workspace creation for repeated repos."
166
+ echo ""
167
+
168
+ # Check if ghq is already installed
169
+ if command -v ghq &> /dev/null; then
170
+ print_success "ghq is already installed ($(ghq --version))"
171
+ GHQ_INSTALLED=true
172
+ else
173
+ read -p "Install ghq for faster workspace creation? (y/n) " -n 1 -r
174
+ echo ""
175
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
176
+ if [[ "$OS" == "Darwin" ]]; then
177
+ if command -v brew &> /dev/null; then
178
+ print_info "Installing ghq via Homebrew..."
179
+ brew install ghq
180
+ print_success "ghq installed"
181
+ GHQ_INSTALLED=true
182
+ else
183
+ print_error "Homebrew not found"
184
+ echo "Install manually: brew install ghq"
185
+ GHQ_INSTALLED=false
186
+ fi
187
+ elif [[ "$OS" == "Linux" ]]; then
188
+ if command -v go &> /dev/null; then
189
+ print_info "Installing ghq via go..."
190
+ go install github.com/x-motemen/ghq@latest
191
+ print_success "ghq installed"
192
+ GHQ_INSTALLED=true
193
+ else
194
+ print_error "Go not found"
195
+ echo "Install Go first, then: go install github.com/x-motemen/ghq@latest"
196
+ GHQ_INSTALLED=false
197
+ fi
198
+ else
199
+ print_warning "Unsupported OS for automatic ghq installation"
200
+ GHQ_INSTALLED=false
201
+ fi
202
+ else
203
+ print_info "Skipping ghq installation"
204
+ echo "You can install it later with: brew install ghq (macOS)"
205
+ GHQ_INSTALLED=false
206
+ fi
207
+ fi
208
+
209
+ echo ""
210
+ echo "============================================================"
211
+ echo "Optional: Shell Integration (Auto-CD)"
212
+ echo "============================================================"
213
+ echo ""
214
+ echo "Shell integration allows automatic CD to workspace after creation."
215
+ echo ""
216
+
217
+ read -p "Install shell integration? (y/n) " -n 1 -r
218
+ echo ""
219
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
220
+ bash "$SCRIPT_DIR/install-shell-integration.sh"
221
+ SHELL_INTEGRATION=true
222
+ else
223
+ print_info "Skipping shell integration"
224
+ echo "You can install it later with: ./install-shell-integration.sh"
225
+ SHELL_INTEGRATION=false
226
+ fi
227
+
228
+ echo ""
229
+ echo "============================================================"
230
+ echo "Workspace Directory Setup"
231
+ echo "============================================================"
232
+ echo ""
233
+
234
+ # Determine workspace directory
235
+ DEFAULT_WORKSPACE_DIR="$HOME/workspaces"
236
+ CURRENT_WORKSPACE_DIR="${WORKSPACE_MANAGER_DIR:-$DEFAULT_WORKSPACE_DIR}"
237
+
238
+ echo "Workspaces will be created in: $CURRENT_WORKSPACE_DIR"
239
+ echo ""
240
+ read -p "Use this directory? (y/n) " -n 1 -r
241
+ echo ""
242
+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
243
+ echo "Enter workspace directory path (e.g., $HOME/Work/workspaces):"
244
+ read -r CUSTOM_WORKSPACE_DIR
245
+ if [ -n "$CUSTOM_WORKSPACE_DIR" ]; then
246
+ CURRENT_WORKSPACE_DIR="$CUSTOM_WORKSPACE_DIR"
247
+
248
+ # Add to shell config
249
+ SHELL_RC=""
250
+ if [ -n "$ZSH_VERSION" ] || [ "$SHELL" = "/bin/zsh" ]; then
251
+ SHELL_RC="$HOME/.zshrc"
252
+ elif [ -n "$BASH_VERSION" ] || [ "$SHELL" = "/bin/bash" ]; then
253
+ SHELL_RC="$HOME/.bashrc"
254
+ fi
255
+
256
+ if [ -n "$SHELL_RC" ]; then
257
+ if ! grep -q "WORKSPACE_MANAGER_DIR" "$SHELL_RC" 2>/dev/null; then
258
+ echo "" >> "$SHELL_RC"
259
+ echo "# Nemus configuration" >> "$SHELL_RC"
260
+ echo "export WORKSPACE_MANAGER_DIR=\"$CURRENT_WORKSPACE_DIR\"" >> "$SHELL_RC"
261
+ print_success "Added WORKSPACE_MANAGER_DIR to $SHELL_RC"
262
+ else
263
+ print_info "WORKSPACE_MANAGER_DIR already set in $SHELL_RC"
264
+ fi
265
+ fi
266
+ fi
267
+ fi
268
+
269
+ # Create workspaces directory
270
+ mkdir -p "$CURRENT_WORKSPACE_DIR"
271
+ print_success "Workspace directory ready at $CURRENT_WORKSPACE_DIR"
272
+ echo ""
273
+
274
+ echo ""
275
+ echo "============================================================"
276
+ echo "Authentication Setup"
277
+ echo "============================================================"
278
+ echo ""
279
+
280
+ # Check gh auth status
281
+ if gh auth status &> /dev/null; then
282
+ print_success "GitHub CLI is authenticated"
283
+ else
284
+ print_warning "GitHub CLI is not authenticated"
285
+ echo ""
286
+ read -p "Authenticate with GitHub now? (y/n) " -n 1 -r
287
+ echo ""
288
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
289
+ gh auth login
290
+ else
291
+ print_info "You can authenticate later with: gh auth login"
292
+ fi
293
+ fi
294
+
295
+ echo ""
296
+ echo "============================================================"
297
+ echo "AI Agent Integration"
298
+ echo "============================================================"
299
+ echo ""
300
+
301
+ MCP_INSTALL_JS="$SCRIPT_DIR/dist/mcp/install.js"
302
+ HAS_CLAUDE=false
303
+ HAS_PI=false
304
+
305
+ if command -v claude &> /dev/null; then
306
+ HAS_CLAUDE=true
307
+ print_success "Claude Code CLI detected"
308
+ fi
309
+
310
+ if command -v pi &> /dev/null; then
311
+ HAS_PI=true
312
+ print_success "Pi CLI detected"
313
+ fi
314
+
315
+ if [ "$HAS_CLAUDE" = true ] || [ "$HAS_PI" = true ]; then
316
+ if [ -f "$MCP_INSTALL_JS" ]; then
317
+ print_info "Registering MCP server, hooks, skills, and extensions..."
318
+ node "$MCP_INSTALL_JS" install 2>/dev/null && \
319
+ print_success "MCP server, hooks, skills, extensions, and .mcp.json backfill installed" || \
320
+ print_warning "Install had issues (run 'nemus mcp install' manually)"
321
+ else
322
+ print_warning "Build not found — run 'npm run build' then 'nemus mcp install'"
323
+ fi
324
+ else
325
+ print_info "No AI agent CLI found — skipping integration"
326
+ echo " Install Claude Code or Pi and run: nemus mcp install"
327
+ # Still backfill .mcp.json for existing workspaces (doesn't require agent CLI)
328
+ BACKFILL_JS="$SCRIPT_DIR/dist/mcp/install.js"
329
+ if [ -f "$BACKFILL_JS" ]; then
330
+ node -e "
331
+ const { generateMcpConfig } = require('$SCRIPT_DIR/dist/utils/claude-integration.js');
332
+ const { listWorkspaces } = require('$SCRIPT_DIR/dist/utils/workspace-meta.js');
333
+ const { getUserConfig } = require('$SCRIPT_DIR/dist/utils/config.js');
334
+ if (!getUserConfig().installMcp) process.exit(0);
335
+ listWorkspaces(false).then(async (ws) => {
336
+ let n = 0;
337
+ for (const w of ws) { if (await generateMcpConfig(w.path)) n++; }
338
+ if (n > 0) console.log(' Updated .mcp.json in ' + n + ' workspace(s)');
339
+ }).catch(() => {});
340
+ " 2>/dev/null || true
341
+ fi
342
+ fi
343
+
344
+ echo ""
345
+ echo "============================================================"
346
+ echo -e "${GREEN}Installation Complete!${NC}"
347
+ echo "============================================================"
348
+ echo ""
349
+
350
+ # Summary
351
+ echo "Summary:"
352
+ echo ""
353
+ print_success "Nemus installed"
354
+ if command -v gh &> /dev/null; then
355
+ print_success "GitHub CLI available"
356
+ else
357
+ print_warning "GitHub CLI not installed"
358
+ fi
359
+ if [ "$GHQ_INSTALLED" = true ]; then
360
+ print_success "ghq installed (10-15x faster workspaces!)"
361
+ else
362
+ print_warning "ghq not installed (install with: brew install ghq)"
363
+ fi
364
+ if [ "$SHELL_INTEGRATION" = true ]; then
365
+ print_success "Shell integration installed"
366
+ else
367
+ print_warning "Shell integration not installed"
368
+ fi
369
+
370
+ echo ""
371
+ echo "Available Commands:"
372
+ echo " ${CYAN}nemus create${NC} Create a new workspace"
373
+ echo " ${CYAN}nemus list${NC} List existing workspaces"
374
+ echo " ${CYAN}nemus update${NC} Add repos to workspace"
375
+ echo " ${CYAN}nemus delete${NC} Delete a workspace"
376
+ echo " ${CYAN}nemus sync${NC} Git pull all repos"
377
+ echo " ${CYAN}nemus switch-branch${NC} Bulk branch switching"
378
+ echo " ${CYAN}nemus save-template${NC} Save workspace as template"
379
+ echo " ${CYAN}nemus from-template${NC} Create from template"
380
+ echo " ${CYAN}nemus cache${NC} Manage cache"
381
+ echo " ${CYAN}nemus configure-claude${NC} Configure Claude integration"
382
+ echo " ${CYAN}nemus ghq-status${NC} Check ghq status"
383
+ echo " ${CYAN}nemus help${NC} Show help"
384
+ echo ""
385
+
386
+ if [ "$SHELL_INTEGRATION" = true ]; then
387
+ echo -e "${YELLOW}Next Steps:${NC}"
388
+ echo " 1. Restart your terminal (or run: source ~/.zshrc)"
389
+ echo " 2. Run: ${CYAN}nemus create${NC}"
390
+ echo " 3. Select repositories and create your first workspace!"
391
+ else
392
+ echo -e "${YELLOW}Next Steps:${NC}"
393
+ echo " 1. Run: ${CYAN}nemus create${NC}"
394
+ echo " 2. Select repositories and create your first workspace!"
395
+ fi
396
+
397
+ echo ""
398
+ echo "Documentation: ${SCRIPT_DIR}/README.md"
399
+ echo ""
400
+ echo "Happy coding! 🚀"
401
+ echo ""
package/package.json ADDED
@@ -0,0 +1,90 @@
1
+ {
2
+ "name": "@nemus-cli/nemus",
3
+ "version": "0.2.1",
4
+ "description": "Nemus — a CLI for managing multi-repository workspaces. Create, sync, and operate across dozens of repos with a single command, and wire them up to your favorite coding agent.",
5
+ "keywords": [
6
+ "workspace",
7
+ "git",
8
+ "github",
9
+ "cli",
10
+ "monorepo",
11
+ "multi-repo",
12
+ "polyrepo",
13
+ "developer-tools",
14
+ "ai-agents",
15
+ "claude",
16
+ "codex"
17
+ ],
18
+ "author": "Nemus contributors",
19
+ "license": "MIT",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/me-public/nemus.git"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/me-public/nemus/issues"
26
+ },
27
+ "homepage": "https://github.com/me-public/nemus#readme",
28
+ "engines": {
29
+ "node": ">=22.0.0",
30
+ "npm": ">=9.0.0"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "files": [
36
+ "dist/**/*",
37
+ "bin/**/*",
38
+ "src/**/*",
39
+ "scripts/**/*",
40
+ "install.sh",
41
+ "install-shell-integration.sh",
42
+ "remove-shell-block.awk",
43
+ "sync-permissions.sh",
44
+ "skills/**/*.md",
45
+ "uninstall.sh",
46
+ "assets/**/*",
47
+ "README.md",
48
+ "LICENSE",
49
+ "CHANGELOG.md",
50
+ "tsconfig.json"
51
+ ],
52
+ "bin": {
53
+ "nemus": "bin/workspace.js",
54
+ "nem": "bin/workspace.js",
55
+ "nemus-mcp": "dist/mcp/server.js"
56
+ },
57
+ "scripts": {
58
+ "test": "vitest run",
59
+ "test:watch": "vitest",
60
+ "build": "tsc && cp src/commands/dashboard/sidebar.js dist/commands/dashboard/sidebar.js && rm -rf dist/pi-extensions && cp -r src/pi-extensions dist/pi-extensions && rm -rf dist/scripts && cp -r src/scripts dist/scripts",
61
+ "clean": "rm -rf dist",
62
+ "typecheck": "tsc --noEmit",
63
+ "prepublishOnly": "npm run clean && npm run build",
64
+ "postinstall": "node scripts/postinstall.js"
65
+ },
66
+ "dependencies": {
67
+ "@modelcontextprotocol/sdk": "^1.26.0",
68
+ "cli-progress": "^3.12.0",
69
+ "commander": "^14.0.3",
70
+ "fuzzy": "^0.1.3",
71
+ "ink": "^5.0.0",
72
+ "ink-select-input": "^6.0.0",
73
+ "ink-spinner": "^5.0.0",
74
+ "inquirer": "^8.0.0",
75
+ "inquirer-autocomplete-prompt": "^2.0.0",
76
+ "markdown-table": "^3.0.3",
77
+ "react": "^18.2.0",
78
+ "zod": "^4.3.6"
79
+ },
80
+ "devDependencies": {
81
+ "@types/cli-progress": "^3.11.0",
82
+ "@types/inquirer": "^9.0.3",
83
+ "@types/inquirer-autocomplete-prompt": "^2.0.0",
84
+ "@types/node": "^22.14.0",
85
+ "@types/react": "^18.2.0",
86
+ "ts-node": "^10.9.1",
87
+ "typescript": "^5.9.3",
88
+ "vitest": "^3.0.0"
89
+ }
90
+ }
@@ -0,0 +1,44 @@
1
+ # remove-shell-block.awk
2
+ # Strips the "Nemus - Shell Integration" block from an RC
3
+ # file, preserving all surrounding user content (including comments placed
4
+ # directly after the block).
5
+ #
6
+ # Usage: awk -f remove-shell-block.awk "$RC_FILE" > "$TMPFILE"
7
+
8
+ /^# Nemus - Shell Integration/ { skip=1; depth=0; saw_func=0; buf="" }
9
+ skip {
10
+ # Inside a function body — track brace depth
11
+ if (depth > 0) {
12
+ n = gsub(/{/, "{")
13
+ m = gsub(/}/, "}")
14
+ depth += n - m
15
+ next
16
+ }
17
+ # Blank or comment lines: before first function just skip;
18
+ # after a function, buffer them (might be user content after block)
19
+ if (/^[[:space:]]*$/ || /^#/) {
20
+ if (saw_func) { buf = buf $0 "\n" }
21
+ next
22
+ }
23
+ if (/\(\)[[:space:]]*{/) {
24
+ # New function definition — discard buffered lines, count braces
25
+ buf = ""
26
+ n = gsub(/{/, "{"); m = gsub(/}/, "}")
27
+ depth = n - m; saw_func = 1
28
+ next
29
+ }
30
+ if (/\(\)/) {
31
+ # Function def without opening brace on same line
32
+ buf = ""
33
+ saw_func = 1
34
+ next
35
+ }
36
+ # Non-function line: block is over — emit any buffered lines
37
+ skip = 0
38
+ if (buf != "") printf "%s", buf
39
+ buf = ""
40
+ print
41
+ next
42
+ }
43
+ END { if (buf != "") printf "%s", buf }
44
+ { print }
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * postinstall.js — runs after `npm install -g @nemus-cli/nemus`
4
+ *
5
+ * Installs the shell integration (nemus/nem shell functions) so that the
6
+ * shell can auto-CD into a workspace after create / list / go commands.
7
+ *
8
+ * Using a dedicated script (not `node -e`) gives us reliable __dirname
9
+ * access so the path to install-shell-integration.sh is always correct
10
+ * regardless of the npm install working directory.
11
+ */
12
+
13
+ 'use strict';
14
+
15
+ const { execSync } = require('child_process');
16
+ const fs = require('fs');
17
+ const path = require('path');
18
+
19
+ // Skip in CI environments
20
+ if (process.env.CI) process.exit(0);
21
+
22
+ const PKG_ROOT = path.join(__dirname, '..');
23
+ const SHELL_SCRIPT = path.join(PKG_ROOT, 'install-shell-integration.sh');
24
+
25
+ const shell = process.env.SHELL || '';
26
+ const shellType = shell.endsWith('/zsh') ? 'zsh'
27
+ : shell.endsWith('/bash') ? 'bash'
28
+ : null;
29
+
30
+ const rcFile = shellType === 'zsh' ? '~/.zshrc'
31
+ : shellType === 'bash' ? '~/.bashrc'
32
+ : null;
33
+
34
+ // ── Install shell integration ────────────────────────────────────────────────
35
+
36
+ if (!shellType) {
37
+ console.log('\nNote: Unknown shell — skipping shell integration.');
38
+ console.log(' Run install-shell-integration.sh manually for auto-CD support.\n');
39
+ process.exit(0);
40
+ }
41
+
42
+ if (!fs.existsSync(SHELL_SCRIPT)) {
43
+ console.log('\nNote: Shell integration script not found — skipping.\n');
44
+ process.exit(0);
45
+ }
46
+
47
+ try {
48
+ execSync(`bash "${SHELL_SCRIPT}" ${shellType}`, { stdio: 'inherit' });
49
+ } catch {
50
+ console.log(`\nNote: Shell integration install failed.`);
51
+ console.log(` You can install it manually: bash "${SHELL_SCRIPT}" ${shellType}\n`);
52
+ process.exit(0);
53
+ }
54
+
55
+ // ── Upgrade hooks, extensions and skills ───────────────────────────────────
56
+ // Idempotent: only acts when a previous `nemus mcp install` has been run.
57
+ // This ensures new features (Pi extensions, Claude Code status-line, etc.)
58
+ // reach existing users automatically on every `npm install -g` upgrade.
59
+
60
+ try {
61
+ const mcpInstall = path.join(PKG_ROOT, 'dist', 'mcp', 'install.js');
62
+ if (fs.existsSync(mcpInstall)) {
63
+ execSync(`node "${mcpInstall}" upgrade`, { stdio: 'inherit' });
64
+ }
65
+ } catch {
66
+ // Non-critical — user can run `nemus mcp upgrade` manually
67
+ }
68
+
69
+ // ── Always print the source reminder ────────────────────────────────────────
70
+ // This is the single most important message for first-time users.
71
+ // Without sourcing the RC file the `nemus`/`nem` shell functions are not
72
+ // active, so auto-CD into a new workspace won't work in this terminal.
73
+
74
+ console.log('');
75
+ console.log(' \x1b[33m⚠️ IMPORTANT — activate the shell functions in this terminal:\x1b[0m');
76
+ console.log('');
77
+ console.log(` \x1b[36msource ${rcFile}\x1b[0m`);
78
+ console.log('');
79
+ console.log(' Or open a new terminal tab. Until then, auto-CD into a new');
80
+ console.log(' workspace won\'t work (the CLI itself still runs fine).');
81
+ console.log('');
82
+ console.log(' Tip: \x1b[36mnemus\x1b[0m works immediately (\x1b[36mgv\x1b[0m is a short alias):');
83
+ console.log(' \x1b[36mnemus configure\x1b[0m \x1b[90m# first-time setup\x1b[0m');
84
+ console.log(' \x1b[36mnemus list\x1b[0m \x1b[90m# list workspaces\x1b[0m');
85
+ console.log('');
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: analyze-deps
3
+ description: Analyze inter-repository dependencies in a workspace
4
+ ---
5
+
6
+ # Analyze Dependencies
7
+
8
+ Analyze inter-repository dependencies in a workspace.
9
+
10
+ ## Running
11
+
12
+ ```bash
13
+ nemus analyze-deps <workspace-name>
14
+ ```
15
+
16
+ Or for the current workspace:
17
+ ```bash
18
+ nemus analyze-deps
19
+ ```
20
+
21
+ ## Presenting Results
22
+
23
+ Report dependency relationships between repos (which repos depend on which via package.json).
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: archive-workspace
3
+ description: Archive or unarchive a workspace
4
+ ---
5
+
6
+ # Archive Workspace
7
+
8
+ Archive or unarchive a workspace.
9
+
10
+ ## Archiving
11
+
12
+ ```bash
13
+ nemus archive <workspace-name>
14
+ ```
15
+
16
+ ## Unarchiving
17
+
18
+ ```bash
19
+ nemus archive --unarchive <workspace-name>
20
+ ```
21
+
22
+ ## Notes
23
+
24
+ - Archived workspaces are hidden from the default `nemus list` view
25
+ - Use `nemus list --archived` to see archived workspaces
26
+ - Archived workspaces are auto-deleted after 30 days
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: branch-create
3
+ description: Create a new branch across all repos in a workspace
4
+ ---
5
+
6
+ # Branch Create
7
+
8
+ Create a new branch across all repos in a workspace.
9
+
10
+ ## Running
11
+
12
+ ```bash
13
+ nemus branch create <workspace-name> <branch-name>
14
+ ```
15
+
16
+ ## Presenting Results
17
+
18
+ Report which repos had the branch created successfully and any that failed.