@mrpatronz/nexusflow 0.1.0

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 (212) hide show
  1. package/GETTING_STARTED.md +109 -0
  2. package/README.md +310 -0
  3. package/dist/analyzers/detect-apis.d.ts +19 -0
  4. package/dist/analyzers/detect-apis.d.ts.map +1 -0
  5. package/dist/analyzers/detect-apis.js +121 -0
  6. package/dist/analyzers/detect-apis.js.map +1 -0
  7. package/dist/analyzers/detect-deps.d.ts +30 -0
  8. package/dist/analyzers/detect-deps.d.ts.map +1 -0
  9. package/dist/analyzers/detect-deps.js +121 -0
  10. package/dist/analyzers/detect-deps.js.map +1 -0
  11. package/dist/analyzers/detect-existing.d.ts +15 -0
  12. package/dist/analyzers/detect-existing.d.ts.map +1 -0
  13. package/dist/analyzers/detect-existing.js +65 -0
  14. package/dist/analyzers/detect-existing.js.map +1 -0
  15. package/dist/analyzers/detect-ports.d.ts +20 -0
  16. package/dist/analyzers/detect-ports.d.ts.map +1 -0
  17. package/dist/analyzers/detect-ports.js +103 -0
  18. package/dist/analyzers/detect-ports.js.map +1 -0
  19. package/dist/analyzers/index.d.ts +29 -0
  20. package/dist/analyzers/index.d.ts.map +1 -0
  21. package/dist/analyzers/index.js +74 -0
  22. package/dist/analyzers/index.js.map +1 -0
  23. package/dist/analyzers/readme-summarizer.d.ts +13 -0
  24. package/dist/analyzers/readme-summarizer.d.ts.map +1 -0
  25. package/dist/analyzers/readme-summarizer.js +59 -0
  26. package/dist/analyzers/readme-summarizer.js.map +1 -0
  27. package/dist/analyzers/tech-stack.d.ts +15 -0
  28. package/dist/analyzers/tech-stack.d.ts.map +1 -0
  29. package/dist/analyzers/tech-stack.js +284 -0
  30. package/dist/analyzers/tech-stack.js.map +1 -0
  31. package/dist/commands/create.d.ts +17 -0
  32. package/dist/commands/create.d.ts.map +1 -0
  33. package/dist/commands/create.js +111 -0
  34. package/dist/commands/create.js.map +1 -0
  35. package/dist/commands/init.d.ts +10 -0
  36. package/dist/commands/init.d.ts.map +1 -0
  37. package/dist/commands/init.js +50 -0
  38. package/dist/commands/init.js.map +1 -0
  39. package/dist/commands/list.d.ts +9 -0
  40. package/dist/commands/list.d.ts.map +1 -0
  41. package/dist/commands/list.js +32 -0
  42. package/dist/commands/list.js.map +1 -0
  43. package/dist/commands/logs.d.ts +12 -0
  44. package/dist/commands/logs.d.ts.map +1 -0
  45. package/dist/commands/logs.js +54 -0
  46. package/dist/commands/logs.js.map +1 -0
  47. package/dist/commands/open.d.ts +9 -0
  48. package/dist/commands/open.d.ts.map +1 -0
  49. package/dist/commands/open.js +49 -0
  50. package/dist/commands/open.js.map +1 -0
  51. package/dist/commands/start.d.ts +13 -0
  52. package/dist/commands/start.d.ts.map +1 -0
  53. package/dist/commands/start.js +97 -0
  54. package/dist/commands/start.js.map +1 -0
  55. package/dist/commands/status.d.ts +11 -0
  56. package/dist/commands/status.d.ts.map +1 -0
  57. package/dist/commands/status.js +47 -0
  58. package/dist/commands/status.js.map +1 -0
  59. package/dist/commands/stop.d.ts +11 -0
  60. package/dist/commands/stop.d.ts.map +1 -0
  61. package/dist/commands/stop.js +47 -0
  62. package/dist/commands/stop.js.map +1 -0
  63. package/dist/commands/ui.d.ts +13 -0
  64. package/dist/commands/ui.d.ts.map +1 -0
  65. package/dist/commands/ui.js +44 -0
  66. package/dist/commands/ui.js.map +1 -0
  67. package/dist/core/config.d.ts +32 -0
  68. package/dist/core/config.d.ts.map +1 -0
  69. package/dist/core/config.js +68 -0
  70. package/dist/core/config.js.map +1 -0
  71. package/dist/core/scanner.d.ts +18 -0
  72. package/dist/core/scanner.d.ts.map +1 -0
  73. package/dist/core/scanner.js +73 -0
  74. package/dist/core/scanner.js.map +1 -0
  75. package/dist/core/workspace.d.ts +53 -0
  76. package/dist/core/workspace.d.ts.map +1 -0
  77. package/dist/core/workspace.js +114 -0
  78. package/dist/core/workspace.js.map +1 -0
  79. package/dist/core/worktree.d.ts +27 -0
  80. package/dist/core/worktree.d.ts.map +1 -0
  81. package/dist/core/worktree.js +35 -0
  82. package/dist/core/worktree.js.map +1 -0
  83. package/dist/generators/base.d.ts +15 -0
  84. package/dist/generators/base.d.ts.map +1 -0
  85. package/dist/generators/base.js +175 -0
  86. package/dist/generators/base.js.map +1 -0
  87. package/dist/generators/claude.d.ts +17 -0
  88. package/dist/generators/claude.d.ts.map +1 -0
  89. package/dist/generators/claude.js +29 -0
  90. package/dist/generators/claude.js.map +1 -0
  91. package/dist/generators/codex.d.ts +16 -0
  92. package/dist/generators/codex.d.ts.map +1 -0
  93. package/dist/generators/codex.js +41 -0
  94. package/dist/generators/codex.js.map +1 -0
  95. package/dist/generators/copilot.d.ts +16 -0
  96. package/dist/generators/copilot.d.ts.map +1 -0
  97. package/dist/generators/copilot.js +49 -0
  98. package/dist/generators/copilot.js.map +1 -0
  99. package/dist/generators/cursor.d.ts +17 -0
  100. package/dist/generators/cursor.d.ts.map +1 -0
  101. package/dist/generators/cursor.js +37 -0
  102. package/dist/generators/cursor.js.map +1 -0
  103. package/dist/generators/index.d.ts +18 -0
  104. package/dist/generators/index.d.ts.map +1 -0
  105. package/dist/generators/index.js +95 -0
  106. package/dist/generators/index.js.map +1 -0
  107. package/dist/gui/assets/index-Cq9V485S.js +21 -0
  108. package/dist/gui/assets/index-Dh1b5gSZ.css +2 -0
  109. package/dist/gui/favicon.svg +1 -0
  110. package/dist/gui/icons.svg +24 -0
  111. package/dist/gui/index.html +18 -0
  112. package/dist/index.d.ts +11 -0
  113. package/dist/index.d.ts.map +1 -0
  114. package/dist/index.js +169 -0
  115. package/dist/index.js.map +1 -0
  116. package/dist/orchestration/detect.d.ts +29 -0
  117. package/dist/orchestration/detect.d.ts.map +1 -0
  118. package/dist/orchestration/detect.js +292 -0
  119. package/dist/orchestration/detect.js.map +1 -0
  120. package/dist/orchestration/index.d.ts +7 -0
  121. package/dist/orchestration/index.d.ts.map +1 -0
  122. package/dist/orchestration/index.js +7 -0
  123. package/dist/orchestration/index.js.map +1 -0
  124. package/dist/orchestration/runner.d.ts +40 -0
  125. package/dist/orchestration/runner.d.ts.map +1 -0
  126. package/dist/orchestration/runner.js +242 -0
  127. package/dist/orchestration/runner.js.map +1 -0
  128. package/dist/server.d.ts +16 -0
  129. package/dist/server.d.ts.map +1 -0
  130. package/dist/server.js +419 -0
  131. package/dist/server.js.map +1 -0
  132. package/dist/types.d.ts +210 -0
  133. package/dist/types.d.ts.map +1 -0
  134. package/dist/types.js +6 -0
  135. package/dist/types.js.map +1 -0
  136. package/dist/utils/detect-ai.d.ts +21 -0
  137. package/dist/utils/detect-ai.d.ts.map +1 -0
  138. package/dist/utils/detect-ai.js +76 -0
  139. package/dist/utils/detect-ai.js.map +1 -0
  140. package/dist/utils/detect-editors.d.ts +19 -0
  141. package/dist/utils/detect-editors.d.ts.map +1 -0
  142. package/dist/utils/detect-editors.js +49 -0
  143. package/dist/utils/detect-editors.js.map +1 -0
  144. package/dist/utils/git.d.ts +27 -0
  145. package/dist/utils/git.d.ts.map +1 -0
  146. package/dist/utils/git.js +57 -0
  147. package/dist/utils/git.js.map +1 -0
  148. package/dist/utils/prompts.d.ts +27 -0
  149. package/dist/utils/prompts.d.ts.map +1 -0
  150. package/dist/utils/prompts.js +119 -0
  151. package/dist/utils/prompts.js.map +1 -0
  152. package/dist/utils/session-finder.d.ts +29 -0
  153. package/dist/utils/session-finder.d.ts.map +1 -0
  154. package/dist/utils/session-finder.js +462 -0
  155. package/dist/utils/session-finder.js.map +1 -0
  156. package/gui/README.md +73 -0
  157. package/gui/eslint.config.js +22 -0
  158. package/gui/index.html +17 -0
  159. package/gui/package-lock.json +3054 -0
  160. package/gui/package.json +33 -0
  161. package/gui/public/favicon.svg +1 -0
  162. package/gui/public/icons.svg +24 -0
  163. package/gui/src/App.css +1 -0
  164. package/gui/src/App.tsx +1949 -0
  165. package/gui/src/assets/hero.png +0 -0
  166. package/gui/src/assets/react.svg +1 -0
  167. package/gui/src/assets/vite.svg +1 -0
  168. package/gui/src/index.css +1 -0
  169. package/gui/src/main.tsx +10 -0
  170. package/gui/tsconfig.app.json +25 -0
  171. package/gui/tsconfig.json +7 -0
  172. package/gui/tsconfig.node.json +24 -0
  173. package/gui/vite.config.ts +12 -0
  174. package/package.json +48 -0
  175. package/src/analyzers/detect-apis.ts +138 -0
  176. package/src/analyzers/detect-deps.ts +138 -0
  177. package/src/analyzers/detect-existing.ts +74 -0
  178. package/src/analyzers/detect-ports.ts +110 -0
  179. package/src/analyzers/index.ts +85 -0
  180. package/src/analyzers/readme-summarizer.ts +68 -0
  181. package/src/analyzers/tech-stack.ts +255 -0
  182. package/src/commands/create.ts +142 -0
  183. package/src/commands/init.ts +58 -0
  184. package/src/commands/list.ts +46 -0
  185. package/src/commands/logs.ts +63 -0
  186. package/src/commands/open.ts +54 -0
  187. package/src/commands/start.ts +117 -0
  188. package/src/commands/status.ts +54 -0
  189. package/src/commands/stop.ts +55 -0
  190. package/src/commands/ui.ts +47 -0
  191. package/src/core/config.ts +79 -0
  192. package/src/core/scanner.ts +91 -0
  193. package/src/core/workspace.ts +149 -0
  194. package/src/core/worktree.ts +50 -0
  195. package/src/generators/base.ts +187 -0
  196. package/src/generators/claude.ts +34 -0
  197. package/src/generators/codex.ts +48 -0
  198. package/src/generators/copilot.ts +56 -0
  199. package/src/generators/cursor.ts +44 -0
  200. package/src/generators/index.ts +122 -0
  201. package/src/index.ts +178 -0
  202. package/src/orchestration/detect.ts +313 -0
  203. package/src/orchestration/index.ts +7 -0
  204. package/src/orchestration/runner.ts +279 -0
  205. package/src/server.ts +466 -0
  206. package/src/types.ts +294 -0
  207. package/src/utils/detect-ai.ts +81 -0
  208. package/src/utils/detect-editors.ts +54 -0
  209. package/src/utils/git.ts +61 -0
  210. package/src/utils/prompts.ts +135 -0
  211. package/src/utils/session-finder.ts +483 -0
  212. package/tsconfig.json +19 -0
@@ -0,0 +1,109 @@
1
+ # NexusFlow — Getting Started Guide
2
+
3
+ Welcome to **NexusFlow**! This guide will walk you through the system, explain its core workflows, and show you how to leverage multi-repository workspaces and agentic orchestration to accelerate feature development.
4
+
5
+ ---
6
+
7
+ ## 💡 What is NexusFlow?
8
+
9
+ When developing complex features in modern systems, you often need to touch multiple repositories simultaneously (e.g., modifying a shared package, updating a backend REST API, and updating a frontend application).
10
+
11
+ Traditional AI assistant setups only give the assistant context of a single repository. NexusFlow solves this by:
12
+ 1. **Grouping Repositories**: Creating a dedicated workspace using **git worktrees** on a unified feature branch name.
13
+ 2. **Generating AI Context**: Writing specialized configurations (`CLAUDE.md`, `AGENTS.md`, Copilot guidelines, and Cursor rules) that outline the workspace architecture.
14
+ 3. **Smart Codebase Analysis**: Scanning tech stacks, ports, and API endpoints so the AI instantly understands the codebase boundaries.
15
+ 4. **Service Orchestration**: Running, stopping, and logging all projects simultaneously from a single place.
16
+
17
+ ---
18
+
19
+ ## 🚀 Step-by-Step Workflow
20
+
21
+ Here is how to get started with your first feature workspace.
22
+
23
+ ```mermaid
24
+ flowchart TD
25
+ A["1. Run Web GUI or CLI"] --> B["2. Fill Feature Details & Pick Repos"]
26
+ B --> C["3. Workspace Created\n(Git Worktrees + Context generated)"]
27
+ C --> D["4. AI Agent Initializes\n(Fills nexusflow-overview.md + questions)"]
28
+ D --> E["5. Confirm Assumptions & Spin up services"]
29
+ ```
30
+
31
+ ### 1. Initialize NexusFlow
32
+ First, initialize the default configuration on your machine:
33
+ ```bash
34
+ nexusflow init
35
+ ```
36
+ This sets up `~/.nexusflow/config.json` with default settings:
37
+ * **Development Directory**: Where your git repositories are located (defaults to `~/dev`).
38
+ * **Workspaces Directory**: Where your worktrees will be created (defaults to `~/dev/workspaces`).
39
+
40
+ ---
41
+
42
+ ### 2. Launch the Web Dashboard
43
+ NexusFlow comes with a rich, interactive Web Dashboard. Launch it by running:
44
+ ```bash
45
+ nexusflow ui
46
+ ```
47
+ This starts the local backend server on port `3000` and automatically opens the browser.
48
+
49
+ ---
50
+
51
+ ### 3. Create a Feature Workspace
52
+ On the dashboard (or via the `nexusflow create` CLI command):
53
+ 1. **Branch name**: Enter your branch name (e.g. `feature/user-profiles`). Slashes are supported!
54
+ 2. **Description**: Describe the feature you are building. The AI assistant will read this to compile the plan.
55
+ 3. **Pick Repositories**: Choose which repositories you need to modify or reference.
56
+ 4. **Assistant Selection**: Select which AI coding assistants you plan to use (Claude Code, Antigravity, Cursor, etc.).
57
+ 5. **Click Build Workspace**: NexusFlow will fetch origin updates, create local branches, spin up git worktrees under `workspaces/feature/user-profiles`, run tech analyses, and write context configurations.
58
+
59
+ ---
60
+
61
+ ### 4. The Agentic Initialization (Universal Context)
62
+ Once the workspace is built, open it in your preferred AI assistant.
63
+
64
+ Whichever AI harness you use, **the agent's very first instructions** are to:
65
+ 1. Scan the workspace projects.
66
+ 2. Create a universal reference file: **`nexusflow-overview.md`**.
67
+ 3. Write down its assumptions of what each project does, how they interact, and their responsibilities.
68
+ 4. List any **Clarifying Questions** it needs you to answer before coding.
69
+
70
+ **Your Action**: Review the generated `nexusflow-overview.md`, answer the assistant's questions directly in the chat or file, and confirm its assumptions. This ensures you and the agent are aligned before a single line of code is modified.
71
+
72
+ ---
73
+
74
+ ### 5. Orchestrate Local Services
75
+ You don't need to open five terminal windows to start your backend, frontend, databases, or libraries.
76
+
77
+ **On the Web Dashboard:**
78
+ * Expand your active workspace to see all detected services (e.g. node scripts, dotnet servers, python hosts).
79
+ * Click **Start All** to spin them up.
80
+ * View aggregate console streams inside the tabbed retro-terminal output screen.
81
+
82
+ **Via the CLI:**
83
+ * Navigate to your workspace directory and run:
84
+ ```bash
85
+ nexusflow start
86
+ ```
87
+ * Check logs or stop services with:
88
+ ```bash
89
+ nexusflow logs
90
+ nexusflow stop
91
+ ```
92
+
93
+ ---
94
+
95
+ ## 🛠️ CLI Reference
96
+
97
+ Here is a summary of the command-line interface:
98
+
99
+ | Command | Usage | Description |
100
+ | :--- | :--- | :--- |
101
+ | **`nexusflow ui`** | `nexusflow ui [-p <port>]` | Starts the backend Hono API server and opens the GUI Dashboard. |
102
+ | **`nexusflow create`** | `nexusflow create` | Launches the interactive step-by-step terminal wizard to build a workspace. |
103
+ | **`nexusflow list`** | `nexusflow list` / `nexusflow ls` | Lists all active feature workspaces discovered on your machine. |
104
+ | **`nexusflow open`** | `nexusflow open` | Prompts you to pick an active workspace and opens it in your editor. |
105
+ | **`nexusflow start`** | `nexusflow start [path]` | Starts background processes for all projects in the workspace. |
106
+ | **`nexusflow stop`** | `nexusflow stop [path]` | Kills all running processes for the workspace. |
107
+ | **`nexusflow logs`** | `nexusflow logs [path] [-n <lines>]` | Tails output log files for all service processes in the workspace. |
108
+ | **`nexusflow status`** | `nexusflow status [path]` | Displays running/stopped statuses and PIDs for each service. |
109
+ | **`nexusflow init`** | `nexusflow init` | Creates or edits the global config file. |
package/README.md ADDED
@@ -0,0 +1,310 @@
1
+ <p align="center">
2
+ <h1 align="center">🔗 NexusFlow</h1>
3
+ <p align="center">
4
+ <strong>Multi-repo workspace manager for AI-assisted development</strong>
5
+ </p>
6
+ <p align="center">
7
+ Group repositories · Generate AI context · Resume LLM sessions · Orchestrate services
8
+ </p>
9
+ </p>
10
+
11
+ ---
12
+
13
+ NexusFlow combines multiple Git repositories into a single feature workspace and generates the context files that your AI coding assistant needs to understand all of them at once. It uses **git worktrees** so every repo stays on a clean feature branch without disturbing your main working copy.
14
+
15
+ > **New to NexusFlow?** Jump to the [Getting Started Guide](GETTING_STARTED.md) for a hands-on walkthrough.
16
+
17
+ ## ✨ Features
18
+
19
+ - **Multi-repo workspaces** — group any set of local Git repos under one feature branch using worktrees
20
+ - **AI context generation** — automatically writes `CLAUDE.md`, `AGENTS.md`, `.github/copilot-instructions.md`, and `.cursor/rules/nexusflow.mdc`
21
+ - **Smart codebase analysis** — detects tech stacks, ports, API endpoints, dependencies, and existing AI configs across all projects
22
+ - **Session history & resumption** — browse past conversation transcripts from Antigravity, Claude Code, OpenAI Codex, and GitHub Copilot, then resume where you left off
23
+ - **Service orchestration** — start, stop, and tail logs for all services in a workspace with a single command
24
+ - **Interactive Web Dashboard** — rich dark-themed GUI for managing workspaces, viewing sessions, and streaming logs
25
+ - **CLI-first** — every action available from the terminal via the `nexusflow` command
26
+
27
+ ## 📦 Installation
28
+
29
+ ### Prerequisites
30
+
31
+ | Requirement | Version |
32
+ |:---|:---|
33
+ | [Node.js](https://nodejs.org) | 18 or later |
34
+ | [Git](https://git-scm.com) | 2.20 or later (worktree support) |
35
+ | npm | Bundled with Node.js |
36
+
37
+ ### Install from npm
38
+
39
+ ```bash
40
+ npm install -g nexusflow
41
+ ```
42
+
43
+ ### Install from source
44
+
45
+ ```bash
46
+ git clone https://github.com/antan87/NexusFlow.git
47
+ cd NexusFlow
48
+
49
+ # Install backend dependencies
50
+ npm install
51
+
52
+ # Install GUI dependencies
53
+ cd gui && npm install && cd ..
54
+
55
+ # Build everything
56
+ npm run build
57
+
58
+ # Link the CLI globally
59
+ npm link
60
+ ```
61
+
62
+ After linking, the `nexusflow` command is available system-wide.
63
+
64
+ ## 🚀 Quick Start
65
+
66
+ ```bash
67
+ # 1 — Initialize config (optional, defaults work out of the box)
68
+ nexusflow init
69
+
70
+ # 2 — Create a feature workspace
71
+ nexusflow create
72
+
73
+ # 3 — Or launch the Web Dashboard
74
+ nexusflow ui
75
+ ```
76
+
77
+ The `create` wizard walks you through:
78
+
79
+ 1. **Name your feature branch** — e.g. `feature/user-auth`
80
+ 2. **Describe what you're building** — plain text or a path to a `.md` file
81
+ 3. **Pick your repos** — NexusFlow scans `~/dev` for git repositories
82
+ 4. **Choose AI assistant(s)** — auto-detects what's installed
83
+ 5. **Done!** — workspace created with git worktrees + AI context files
84
+
85
+ ## 📂 What Gets Generated
86
+
87
+ ```
88
+ ~/dev/workspaces/feature/user-auth/
89
+ ├── CLAUDE.md # Context for Claude / Antigravity
90
+ ├── AGENTS.md # Context for OpenAI Codex
91
+ ├── .github/
92
+ │ └── copilot-instructions.md # Context for GitHub Copilot
93
+ ├── .cursor/
94
+ │ └── rules/nexusflow.mdc # Context for Cursor
95
+ ├── nexusflow.json # Feature config (branch, repos, etc.)
96
+ ├── nexusflow-overview.md # AI-generated workspace analysis
97
+ ├── my-api/ # ← Git worktree on feature branch
98
+ └── my-frontend/ # ← Git worktree on feature branch
99
+ ```
100
+
101
+ Open this folder in your editor → your AI assistant picks up the context → it understands *all* your repos.
102
+
103
+ ## 🖥️ Commands
104
+
105
+ | Command | Description |
106
+ |:---|:---|
107
+ | `nexusflow create` | Interactive wizard to create a new feature workspace |
108
+ | `nexusflow list` | List all existing workspaces (alias: `ls`) |
109
+ | `nexusflow open` | Re-open a workspace in your editor |
110
+ | `nexusflow init` | Configure NexusFlow settings |
111
+ | `nexusflow start` | Start all services in a workspace (auto-detected) |
112
+ | `nexusflow stop` | Stop all running services |
113
+ | `nexusflow status` | Show running/stopped status and PIDs |
114
+ | `nexusflow logs` | Tail aggregated logs from all services |
115
+ | `nexusflow ui` | Launch the interactive Web Dashboard (port 3000) |
116
+
117
+ ## 🤖 Supported AI Assistants
118
+
119
+ NexusFlow auto-detects which assistants are available on your machine and generates the right context files for each:
120
+
121
+ | Assistant | Config File | How It's Detected |
122
+ |:---|:---|:---|
123
+ | **Claude Code / Antigravity** | `CLAUDE.md` | `claude` or `antigravity` in PATH |
124
+ | **OpenAI Codex** | `AGENTS.md` | `codex` in PATH |
125
+ | **GitHub Copilot** | `.github/copilot-instructions.md` | Always available |
126
+ | **Cursor** | `.cursor/rules/nexusflow.mdc` | `cursor` in PATH |
127
+
128
+ ## 🕐 Session History & Resumption
129
+
130
+ NexusFlow can discover and display your past AI coding sessions across all supported assistants. This lets you:
131
+
132
+ - **Browse** conversation transcripts from previous sessions
133
+ - **Search** through your interaction history
134
+ - **Resume** a session by copying the resume command to your clipboard
135
+
136
+ Session data is read directly from each assistant's local storage:
137
+
138
+ | Assistant | Session Location |
139
+ |:---|:---|
140
+ | Antigravity | `~/.gemini/antigravity-cli/brain/` |
141
+ | Claude Code | `~/.claude/projects/` |
142
+ | OpenAI Codex | `~/.codex/sessions/` |
143
+ | GitHub Copilot | `~/.copilot/` |
144
+
145
+ Access sessions via the Web Dashboard's **Sessions** tab or through the API:
146
+
147
+ ```
148
+ GET /api/workspace/:id/sessions
149
+ GET /api/session/:assistant/:sessionId/transcript
150
+ ```
151
+
152
+ ## 🌐 Web Dashboard
153
+
154
+ Launch with `nexusflow ui` to get a full-featured dark-themed GUI:
155
+
156
+ - **Workspaces tab** — create, browse, and manage feature workspaces
157
+ - **Sessions tab** — view past AI conversation transcripts and resume sessions
158
+ - **Logs panel** — real-time aggregated service log output
159
+ - **Config panel** — edit NexusFlow settings from the browser
160
+
161
+ The dashboard runs a local [Hono](https://hono.dev) server on port 3000 and serves a [React](https://react.dev) + [Vite](https://vite.dev) frontend.
162
+
163
+ ## ⚙️ Configuration
164
+
165
+ NexusFlow stores its config at `~/.nexusflow/config.json`:
166
+
167
+ ```json
168
+ {
169
+ "version": "0.1.0",
170
+ "devDir": "~/dev",
171
+ "workspacesDir": "~/dev/workspaces",
172
+ "scanDepth": 2,
173
+ "defaultAssistant": null
174
+ }
175
+ ```
176
+
177
+ | Key | Default | Description |
178
+ |:---|:---|:---|
179
+ | `devDir` | `~/dev` | Root directory to scan for git repos |
180
+ | `workspacesDir` | `~/dev/workspaces` | Where feature workspaces are created |
181
+ | `scanDepth` | `2` | How many levels deep to scan for repos |
182
+ | `defaultAssistant` | `null` | Pre-select an assistant during workspace creation |
183
+
184
+ Run `nexusflow init` to interactively set these values.
185
+
186
+ ## 🏗️ Architecture
187
+
188
+ ```
189
+ NexusFlow/
190
+ ├── src/
191
+ │ ├── index.ts # CLI entry point (Commander.js)
192
+ │ ├── server.ts # Hono API server (REST endpoints)
193
+ │ ├── types.ts # Shared TypeScript interfaces
194
+ │ ├── commands/ # CLI command handlers
195
+ │ │ ├── create.ts # nexusflow create
196
+ │ │ ├── init.ts # nexusflow init
197
+ │ │ ├── list.ts # nexusflow list
198
+ │ │ ├── open.ts # nexusflow open
199
+ │ │ ├── start.ts # nexusflow start
200
+ │ │ ├── stop.ts # nexusflow stop
201
+ │ │ ├── status.ts # nexusflow status
202
+ │ │ ├── logs.ts # nexusflow logs
203
+ │ │ └── ui.ts # nexusflow ui
204
+ │ ├── core/ # Core workspace logic
205
+ │ │ ├── config.ts # Config management (~/.nexusflow/)
206
+ │ │ ├── scanner.ts # Git repo scanner
207
+ │ │ ├── worktree.ts # Git worktree operations
208
+ │ │ └── workspace.ts # Workspace CRUD
209
+ │ ├── analyzers/ # Codebase analysis
210
+ │ │ ├── tech-stack.ts # Language/framework detection
211
+ │ │ ├── detect-ports.ts # Port & server detection
212
+ │ │ ├── detect-apis.ts # API endpoint scanning
213
+ │ │ ├── detect-deps.ts # Dependency analysis
214
+ │ │ ├── detect-existing.ts# Existing AI config detection
215
+ │ │ └── readme-summarizer.ts# README content extraction
216
+ │ ├── generators/ # AI context file generators
217
+ │ │ ├── base.ts # Shared context builder
218
+ │ │ ├── claude.ts # CLAUDE.md generator
219
+ │ │ ├── codex.ts # AGENTS.md generator
220
+ │ │ ├── copilot.ts # copilot-instructions.md generator
221
+ │ │ └── cursor.ts # nexusflow.mdc generator
222
+ │ ├── orchestration/ # Service start/stop/log management
223
+ │ └── utils/ # Helper utilities
224
+ │ ├── git.ts # Git operations
225
+ │ ├── detect-ai.ts # AI assistant detection
226
+ │ ├── detect-editors.ts # Editor detection
227
+ │ ├── session-finder.ts # AI session history discovery
228
+ │ └── prompts.ts # Interactive prompts
229
+ ├── gui/ # React + Vite Web Dashboard
230
+ │ └── src/
231
+ │ └── App.tsx # Main dashboard component
232
+ ├── package.json
233
+ └── tsconfig.json
234
+ ```
235
+
236
+ ## 🤝 Contributing
237
+
238
+ Contributions are welcome! Here's how to get set up:
239
+
240
+ ### Development Setup
241
+
242
+ ```bash
243
+ # Clone the repo
244
+ git clone https://github.com/antan87/NexusFlow.git
245
+ cd NexusFlow
246
+
247
+ # Install all dependencies
248
+ npm install
249
+ cd gui && npm install && cd ..
250
+
251
+ # Start the TypeScript compiler in watch mode
252
+ npm run dev
253
+
254
+ # In another terminal, start the GUI dev server
255
+ cd gui && npm run dev
256
+ ```
257
+
258
+ ### Build
259
+
260
+ ```bash
261
+ # Full build (TypeScript + GUI)
262
+ npm run build
263
+
264
+ # Clean build artifacts
265
+ npm run clean
266
+ ```
267
+
268
+ ### Test
269
+
270
+ ```bash
271
+ # Run tests
272
+ npm test
273
+
274
+ # Watch mode
275
+ npm run test:watch
276
+ ```
277
+
278
+ ### Code Style
279
+
280
+ - **TypeScript** — strict mode, ES modules
281
+ - **Imports** — use `.js` extensions for local imports (`import { x } from './config.js'`)
282
+ - **Node built-ins** — use the `node:` prefix (`import path from 'node:path'`)
283
+ - **JSDoc** — add doc comments to all exported functions
284
+ - **Error handling** — wrap external calls (git, filesystem) in try/catch
285
+
286
+ ### Adding a New AI Assistant
287
+
288
+ 1. Add the assistant identifier to the `AIAssistant` type in [types.ts](src/types.ts)
289
+ 2. Add detection logic in [detect-ai.ts](src/utils/detect-ai.ts)
290
+ 3. Create a new generator in `src/generators/` (follow the pattern in [claude.ts](src/generators/claude.ts))
291
+ 4. Register it in the [generator index](src/generators/index.ts)
292
+ 5. Add session discovery logic in [session-finder.ts](src/utils/session-finder.ts)
293
+
294
+ ### Adding a New Analyzer
295
+
296
+ 1. Create a new file in `src/analyzers/` following the existing patterns
297
+ 2. Export the analyzer function and register it in [analyzers/index.ts](src/analyzers/index.ts)
298
+ 3. The analyzer output is fed into the context generators and the `WORKSPACE.md` file
299
+
300
+ ### Pull Request Guidelines
301
+
302
+ - Fork the repo and create a feature branch
303
+ - Write clear commit messages
304
+ - Add tests for new functionality
305
+ - Make sure `npm run build` passes before submitting
306
+ - Update documentation if you change user-facing behavior
307
+
308
+ ## 📄 License
309
+
310
+ MIT — see [LICENSE](LICENSE) for details.
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @module analyzers/detect-apis
3
+ * Detects API endpoints in a repository by scanning for OpenAPI/Swagger files,
4
+ * route patterns in common frameworks, and gRPC proto files.
5
+ */
6
+ import type { ApiEndpoint } from '../types.js';
7
+ /**
8
+ * Detects API endpoints in a repository.
9
+ *
10
+ * Strategies (in order):
11
+ * 1. Look for OpenAPI/Swagger spec files (JSON/YAML)
12
+ * 2. Scan source files for Express/Fastify/ASP.NET route patterns
13
+ * 3. Look for gRPC .proto files
14
+ *
15
+ * @param repoPath - Absolute path to the repository root.
16
+ * @returns Array of detected {@link ApiEndpoint} objects.
17
+ */
18
+ export declare function detectApis(repoPath: string): Promise<ApiEndpoint[]>;
19
+ //# sourceMappingURL=detect-apis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect-apis.d.ts","sourceRoot":"","sources":["../../src/analyzers/detect-apis.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;GAUG;AACH,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAczE"}
@@ -0,0 +1,121 @@
1
+ /**
2
+ * @module analyzers/detect-apis
3
+ * Detects API endpoints in a repository by scanning for OpenAPI/Swagger files,
4
+ * route patterns in common frameworks, and gRPC proto files.
5
+ */
6
+ import * as fs from 'node:fs/promises';
7
+ import * as path from 'node:path';
8
+ /**
9
+ * Detects API endpoints in a repository.
10
+ *
11
+ * Strategies (in order):
12
+ * 1. Look for OpenAPI/Swagger spec files (JSON/YAML)
13
+ * 2. Scan source files for Express/Fastify/ASP.NET route patterns
14
+ * 3. Look for gRPC .proto files
15
+ *
16
+ * @param repoPath - Absolute path to the repository root.
17
+ * @returns Array of detected {@link ApiEndpoint} objects.
18
+ */
19
+ export async function detectApis(repoPath) {
20
+ const endpoints = [];
21
+ // 1. OpenAPI/Swagger files
22
+ const openApiEndpoints = await scanOpenApiFiles(repoPath);
23
+ endpoints.push(...openApiEndpoints);
24
+ // 2. Route patterns in source files (only if no OpenAPI found)
25
+ if (endpoints.length === 0) {
26
+ const routeEndpoints = await scanRoutePatterns(repoPath);
27
+ endpoints.push(...routeEndpoints);
28
+ }
29
+ return endpoints;
30
+ }
31
+ /** Looks for OpenAPI/Swagger spec files and extracts paths. */
32
+ async function scanOpenApiFiles(repoPath) {
33
+ const candidates = [
34
+ 'swagger.json', 'swagger.yaml', 'swagger.yml',
35
+ 'openapi.json', 'openapi.yaml', 'openapi.yml',
36
+ 'api-spec.json', 'api-spec.yaml', 'api-spec.yml',
37
+ ];
38
+ const endpoints = [];
39
+ for (const filename of candidates) {
40
+ const filePath = path.join(repoPath, filename);
41
+ try {
42
+ const content = await fs.readFile(filePath, 'utf-8');
43
+ if (filename.endsWith('.json')) {
44
+ const spec = JSON.parse(content);
45
+ const paths = spec.paths;
46
+ if (paths) {
47
+ for (const [routePath, methods] of Object.entries(paths)) {
48
+ for (const method of Object.keys(methods)) {
49
+ if (['get', 'post', 'put', 'patch', 'delete', 'head', 'options'].includes(method)) {
50
+ endpoints.push({
51
+ method: method.toUpperCase(),
52
+ path: routePath,
53
+ source: filename,
54
+ });
55
+ }
56
+ }
57
+ }
58
+ }
59
+ }
60
+ }
61
+ catch {
62
+ // File doesn't exist or can't be parsed — skip
63
+ }
64
+ }
65
+ return endpoints;
66
+ }
67
+ /** Scans source files for common route patterns. Limited to top-level files. */
68
+ async function scanRoutePatterns(repoPath) {
69
+ const endpoints = [];
70
+ // Look in common source directories
71
+ const sourceDirs = ['src', 'app', 'routes', 'controllers', 'Controllers', '.'];
72
+ const routeRegex = /\.(get|post|put|patch|delete)\s*\(\s*['"`]([^'"`]+)['"`]/gi;
73
+ const aspnetRegex = /\[Http(Get|Post|Put|Patch|Delete)\s*\(\s*"([^"]+)"\s*\)\]/gi;
74
+ for (const dir of sourceDirs) {
75
+ const dirPath = path.join(repoPath, dir);
76
+ let entries;
77
+ try {
78
+ entries = await fs.readdir(dirPath);
79
+ }
80
+ catch {
81
+ continue;
82
+ }
83
+ for (const entry of entries) {
84
+ const ext = path.extname(entry).toLowerCase();
85
+ if (!['.ts', '.js', '.cs', '.py'].includes(ext))
86
+ continue;
87
+ const filePath = path.join(dirPath, entry);
88
+ try {
89
+ const stat = await fs.stat(filePath);
90
+ if (!stat.isFile() || stat.size > 100_000)
91
+ continue; // Skip large files
92
+ const content = await fs.readFile(filePath, 'utf-8');
93
+ const relPath = path.relative(repoPath, filePath);
94
+ // Express/Fastify/Hono style routes
95
+ let match;
96
+ routeRegex.lastIndex = 0;
97
+ while ((match = routeRegex.exec(content)) !== null) {
98
+ endpoints.push({
99
+ method: match[1].toUpperCase(),
100
+ path: match[2],
101
+ source: relPath,
102
+ });
103
+ }
104
+ // ASP.NET style routes
105
+ aspnetRegex.lastIndex = 0;
106
+ while ((match = aspnetRegex.exec(content)) !== null) {
107
+ endpoints.push({
108
+ method: match[1].toUpperCase(),
109
+ path: match[2],
110
+ source: relPath,
111
+ });
112
+ }
113
+ }
114
+ catch {
115
+ continue;
116
+ }
117
+ }
118
+ }
119
+ return endpoints;
120
+ }
121
+ //# sourceMappingURL=detect-apis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect-apis.js","sourceRoot":"","sources":["../../src/analyzers/detect-apis.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAIlC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,QAAgB;IAC/C,MAAM,SAAS,GAAkB,EAAE,CAAC;IAEpC,2BAA2B;IAC3B,MAAM,gBAAgB,GAAG,MAAM,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC1D,SAAS,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,CAAC;IAEpC,+DAA+D;IAC/D,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,MAAM,cAAc,GAAG,MAAM,iBAAiB,CAAC,QAAQ,CAAC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AAI,CAAC,MAAM,EAAE,IAAI,IAAI,CAAC,IAAI,GAAG,OAAO;oBAAE,SAAS,CAAC,mBAAmB;gBAExE,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;gBACrD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;gBAElD,oCAAoC;gBACpC,IAAI,KAA6B,CAAC;gBAClC,UAAU,CAAC,SAAS,GAAG,CAAC,CAAC;gBACzB,OAAO,CAAC,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;oBACnD,SAAS,CAAC,IAAI,CAAC;wBACb,MAAM,EAAE,KAAK,CAAC,CAAC,CAAE,CAAC,WAAW,EAAE;wBAC/B,IAAI,EAAE,KAAK,CAAC,CAAC,CAAE;wBACf,MAAM,EAAE,OAAO;qBAChB,CAAC,CAAC;gBACL,CAAC;gBAED,uBAAuB;gBACvB,WAAW,CAAC,SAAS,GAAG,CAAC,CAAC;gBAC1B,OAAO,CAAC,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;oBACpD,SAAS,CAAC,IAAI,CAAC;wBACb,MAAM,EAAE,KAAK,CAAC,CAAC,CAAE,CAAC,WAAW,EAAE;wBAC/B,IAAI,EAAE,KAAK,CAAC,CAAC,CAAE;wBACf,MAAM,EAAE,OAAO;qBAChB,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,SAAS;YACX,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @module analyzers/detect-deps
3
+ * Detects dependencies declared in a repository by reading manifest files.
4
+ * This is used to find potential inter-repo connections (e.g., one repo
5
+ * consumes an npm package published by another).
6
+ */
7
+ import type { RepoDependency } from '../types.js';
8
+ /**
9
+ * Extracts declared dependencies from a repository's manifest files.
10
+ *
11
+ * Supports:
12
+ * - npm (package.json)
13
+ * - NuGet (*.csproj)
14
+ * - pip (requirements.txt)
15
+ * - Go (go.mod)
16
+ *
17
+ * @param repoPath - Absolute path to the repository root.
18
+ * @returns Array of detected {@link RepoDependency} objects.
19
+ */
20
+ export declare function detectDependencies(repoPath: string): Promise<RepoDependency[]>;
21
+ /**
22
+ * Given analysis of multiple repos, find which repos depend on each other.
23
+ * Returns a map of repo name → list of repo names it depends on.
24
+ *
25
+ * @param repoAnalyses - Map of repo path to its detected dependencies.
26
+ * @param repoNames - Map of repo path to its name.
27
+ * @returns Map of repo name → list of repo names it depends on.
28
+ */
29
+ export declare function findInterRepoDependencies(repoAnalyses: Map<string, RepoDependency[]>, repoNames: Map<string, string>): Map<string, string[]>;
30
+ //# sourceMappingURL=detect-deps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect-deps.d.ts","sourceRoot":"","sources":["../../src/analyzers/detect-deps.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CA6EpF;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,EAC3C,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAuBvB"}