upfynai-code 3.0.4 → 3.2.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 (258) hide show
  1. package/README.md +69 -92
  2. package/bin/cli.js +191 -0
  3. package/dist/client/assets/AppContent-M14Au3SB.js +542 -0
  4. package/{client/dist/assets/BrowserPanel-0TLEl-IC.js → dist/client/assets/BrowserPanel-TFKm2NDJ.js} +2 -2
  5. package/dist/client/assets/DashboardPanel-C88HjsCh.js +1 -0
  6. package/dist/client/assets/FileTree-DvO1xnDE.js +1 -0
  7. package/{client/dist/assets/GitPanel-C_xFM-N2.js → dist/client/assets/GitPanel-D-slVlyy.js} +2 -2
  8. package/dist/client/assets/LoginModal-Chi4SYcr.js +21 -0
  9. package/{client/dist/assets/MarkdownPreview-CESjI261.js → dist/client/assets/MarkdownPreview-CuIix2u9.js} +1 -1
  10. package/dist/client/assets/MermaidBlock-Dq9uFv82.js +2 -0
  11. package/dist/client/assets/Onboarding-QYXx24dX.js +1 -0
  12. package/{client/dist/assets/PreviewPanel-CqCa92Tf.js → dist/client/assets/PreviewPanel-Dd8q-jo0.js} +1 -1
  13. package/dist/client/assets/SetupForm-CrspaUva.js +1 -0
  14. package/dist/client/assets/WorkflowsPanel-DIlYAdhB.js +1 -0
  15. package/dist/client/assets/index-CnNNzw9A.css +1 -0
  16. package/{client/dist/assets/index-HaY-3pK1.js → dist/client/assets/index-rUkK9FDP.js} +26 -26
  17. package/{client/dist/assets/vendor-codemirror-D2ALgpaX.js → dist/client/assets/vendor-codemirror-jc6nyJQg.js} +1 -1
  18. package/{client/dist/assets/vendor-diff-DNQpbhrT.js → dist/client/assets/vendor-diff-THJmAcEI.js} +1 -1
  19. package/{client/dist/assets/vendor-icons-GyYE35HP.js → dist/client/assets/vendor-icons-CfjIpdrD.js} +145 -155
  20. package/{client/dist/assets/vendor-markdown-CimbIo6Y.js → dist/client/assets/vendor-markdown-Cdm6NEGf.js} +1 -1
  21. package/dist/client/assets/vendor-mermaid-DTPaBx-U.js +2559 -0
  22. package/{client/dist/assets/vendor-react-96lCPsRK.js → dist/client/assets/vendor-react-wFkb6mSf.js} +1 -1
  23. package/{client/dist/assets/vendor-syntax-LS_Nt30I.js → dist/client/assets/vendor-syntax-C_UZR7tc.js} +1 -1
  24. package/dist/client/favicon.png +0 -0
  25. package/dist/client/icons/icon-128x128.png +0 -0
  26. package/dist/client/icons/icon-144x144.png +0 -0
  27. package/dist/client/icons/icon-152x152.png +0 -0
  28. package/dist/client/icons/icon-192x192.png +0 -0
  29. package/dist/client/icons/icon-384x384.png +0 -0
  30. package/dist/client/icons/icon-512x512.png +0 -0
  31. package/dist/client/icons/icon-72x72.png +0 -0
  32. package/dist/client/icons/icon-96x96.png +0 -0
  33. package/{client/dist → dist/client}/index.html +37 -36
  34. package/dist/client/logo-128.png +0 -0
  35. package/dist/client/logo-256.png +0 -0
  36. package/dist/client/logo-32.png +0 -0
  37. package/dist/client/logo-512.png +0 -0
  38. package/dist/client/logo-64.png +0 -0
  39. package/dist/client/logo.png +0 -0
  40. package/{client/dist → dist/client}/manifest.json +12 -12
  41. package/{client/dist → dist/client}/mcp-docs.html +1 -1
  42. package/{client/dist → dist/client}/sw.js +2 -2
  43. package/package.json +56 -105
  44. package/scripts/postinstall.js +9 -0
  45. package/scripts/prepublish.js +77 -0
  46. package/src/animation.js +228 -0
  47. package/src/auth.js +142 -0
  48. package/src/config.js +40 -0
  49. package/src/connect.js +416 -0
  50. package/src/launch.js +81 -0
  51. package/src/mcp.js +57 -0
  52. package/src/permissions.js +140 -0
  53. package/src/persistent-shell.js +261 -0
  54. package/src/server.js +54 -0
  55. package/client/dist/assets/AppContent-CwrTP6TW.js +0 -545
  56. package/client/dist/assets/CanvasFullScreen-D1GWQsGL.js +0 -1
  57. package/client/dist/assets/CanvasWorkspace-D7ORj358.js +0 -163
  58. package/client/dist/assets/DashboardPanel-BV7ybUDe.js +0 -1
  59. package/client/dist/assets/FileTree-5qfhBqdE.js +0 -1
  60. package/client/dist/assets/LoginModal-CImJHRjX.js +0 -13
  61. package/client/dist/assets/MermaidBlock-BFM21cwe.js +0 -2
  62. package/client/dist/assets/Onboarding-B3cteLu2.js +0 -1
  63. package/client/dist/assets/SetupForm-P6dsYgHO.js +0 -1
  64. package/client/dist/assets/WorkflowsPanel-CBoN80kc.js +0 -1
  65. package/client/dist/assets/index-46kkVu2i.css +0 -1
  66. package/client/dist/assets/pdf-CE_K4jFx.js +0 -12
  67. package/client/dist/assets/vendor-canvas-BZV40eAE.css +0 -1
  68. package/client/dist/assets/vendor-canvas-DvHJ_Pn2.js +0 -49
  69. package/client/dist/assets/vendor-mermaid-DucWyDEe.js +0 -2556
  70. package/client/dist/favicon.png +0 -0
  71. package/client/dist/icons/icon-128x128.png +0 -0
  72. package/client/dist/icons/icon-144x144.png +0 -0
  73. package/client/dist/icons/icon-152x152.png +0 -0
  74. package/client/dist/icons/icon-192x192.png +0 -0
  75. package/client/dist/icons/icon-384x384.png +0 -0
  76. package/client/dist/icons/icon-512x512.png +0 -0
  77. package/client/dist/icons/icon-72x72.png +0 -0
  78. package/client/dist/icons/icon-96x96.png +0 -0
  79. package/client/dist/logo-128.png +0 -0
  80. package/client/dist/logo-256.png +0 -0
  81. package/client/dist/logo-32.png +0 -0
  82. package/client/dist/logo-512.png +0 -0
  83. package/client/dist/logo-64.png +0 -0
  84. package/commands/upfynai-connect.md +0 -59
  85. package/commands/upfynai-disconnect.md +0 -31
  86. package/commands/upfynai-doctor.md +0 -99
  87. package/commands/upfynai-export.md +0 -49
  88. package/commands/upfynai-local.md +0 -82
  89. package/commands/upfynai-status.md +0 -75
  90. package/commands/upfynai-stop.md +0 -49
  91. package/commands/upfynai-uninstall.md +0 -58
  92. package/commands/upfynai.md +0 -69
  93. package/scripts/build-client.js +0 -17
  94. package/scripts/fix-node-pty.js +0 -67
  95. package/scripts/install-commands.js +0 -78
  96. package/server/agent-loop.js +0 -242
  97. package/server/auto-compact.js +0 -99
  98. package/server/browser.js +0 -131
  99. package/server/claude-sdk.js +0 -797
  100. package/server/cli-ui.js +0 -798
  101. package/server/cli.js +0 -751
  102. package/server/constants/config.js +0 -31
  103. package/server/cursor-cli.js +0 -270
  104. package/server/database/auth.db +0 -0
  105. package/server/database/db.js +0 -1547
  106. package/server/database/init.sql +0 -70
  107. package/server/index.js +0 -3813
  108. package/server/load-env.js +0 -26
  109. package/server/mcp-server.js +0 -621
  110. package/server/middleware/auth.js +0 -184
  111. package/server/middleware/relayHelpers.js +0 -44
  112. package/server/middleware/sandboxRouter.js +0 -174
  113. package/server/openai-codex.js +0 -403
  114. package/server/openrouter.js +0 -137
  115. package/server/projects.js +0 -1807
  116. package/server/provider-factory.js +0 -174
  117. package/server/relay-client.js +0 -390
  118. package/server/routes/agent.js +0 -1234
  119. package/server/routes/auth.js +0 -559
  120. package/server/routes/browser.js +0 -419
  121. package/server/routes/canvas.js +0 -53
  122. package/server/routes/cli-auth.js +0 -263
  123. package/server/routes/codex.js +0 -396
  124. package/server/routes/commands.js +0 -707
  125. package/server/routes/composio.js +0 -176
  126. package/server/routes/cursor.js +0 -770
  127. package/server/routes/dashboard.js +0 -295
  128. package/server/routes/git.js +0 -1208
  129. package/server/routes/keys.js +0 -34
  130. package/server/routes/mcp-utils.js +0 -48
  131. package/server/routes/mcp.js +0 -661
  132. package/server/routes/payments.js +0 -227
  133. package/server/routes/projects.js +0 -754
  134. package/server/routes/sessions.js +0 -146
  135. package/server/routes/settings.js +0 -261
  136. package/server/routes/taskmaster.js +0 -1928
  137. package/server/routes/user.js +0 -106
  138. package/server/routes/vapi-chat.js +0 -624
  139. package/server/routes/voice.js +0 -235
  140. package/server/routes/webhooks.js +0 -166
  141. package/server/routes/workflows.js +0 -312
  142. package/server/sandbox.js +0 -120
  143. package/server/services/browser-ai.js +0 -154
  144. package/server/services/composio.js +0 -204
  145. package/server/services/sessionRegistry.js +0 -139
  146. package/server/services/whisperService.js +0 -84
  147. package/server/services/workflowScheduler.js +0 -211
  148. package/server/tests/relay-flow.test.js +0 -570
  149. package/server/tests/sessions.test.js +0 -259
  150. package/server/utils/commandParser.js +0 -303
  151. package/server/utils/email.js +0 -66
  152. package/server/utils/gitConfig.js +0 -24
  153. package/server/utils/mcp-detector.js +0 -198
  154. package/server/utils/taskmaster-websocket.js +0 -129
  155. package/shared/integrationCatalog.d.ts +0 -12
  156. package/shared/integrationCatalog.js +0 -172
  157. package/shared/modelConstants.js +0 -96
  158. /package/{shared → dist}/agents/claude.js +0 -0
  159. /package/{shared → dist}/agents/codex.js +0 -0
  160. /package/{shared → dist}/agents/cursor.js +0 -0
  161. /package/{shared → dist}/agents/detect.js +0 -0
  162. /package/{shared → dist}/agents/exec.js +0 -0
  163. /package/{shared → dist}/agents/files.js +0 -0
  164. /package/{shared → dist}/agents/git.js +0 -0
  165. /package/{shared → dist}/agents/gitagent.js +0 -0
  166. /package/{shared → dist}/agents/index.js +0 -0
  167. /package/{shared → dist}/agents/shell.js +0 -0
  168. /package/{shared → dist}/agents/utils.js +0 -0
  169. /package/{client/dist → dist/client}/api-docs.html +0 -0
  170. /package/{client/dist → dist/client}/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  171. /package/{client/dist → dist/client}/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  172. /package/{client/dist → dist/client}/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  173. /package/{client/dist → dist/client}/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  174. /package/{client/dist → dist/client}/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  175. /package/{client/dist → dist/client}/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  176. /package/{client/dist → dist/client}/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  177. /package/{client/dist → dist/client}/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  178. /package/{client/dist → dist/client}/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  179. /package/{client/dist → dist/client}/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  180. /package/{client/dist → dist/client}/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  181. /package/{client/dist → dist/client}/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  182. /package/{client/dist → dist/client}/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  183. /package/{client/dist → dist/client}/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  184. /package/{client/dist → dist/client}/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  185. /package/{client/dist → dist/client}/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  186. /package/{client/dist → dist/client}/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  187. /package/{client/dist → dist/client}/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  188. /package/{client/dist → dist/client}/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  189. /package/{client/dist → dist/client}/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  190. /package/{client/dist → dist/client}/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  191. /package/{client/dist → dist/client}/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  192. /package/{client/dist → dist/client}/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  193. /package/{client/dist → dist/client}/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  194. /package/{client/dist → dist/client}/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  195. /package/{client/dist → dist/client}/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  196. /package/{client/dist → dist/client}/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  197. /package/{client/dist → dist/client}/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  198. /package/{client/dist → dist/client}/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  199. /package/{client/dist → dist/client}/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  200. /package/{client/dist → dist/client}/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  201. /package/{client/dist → dist/client}/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  202. /package/{client/dist → dist/client}/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  203. /package/{client/dist → dist/client}/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  204. /package/{client/dist → dist/client}/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  205. /package/{client/dist → dist/client}/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  206. /package/{client/dist → dist/client}/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  207. /package/{client/dist → dist/client}/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  208. /package/{client/dist → dist/client}/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  209. /package/{client/dist → dist/client}/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  210. /package/{client/dist → dist/client}/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  211. /package/{client/dist → dist/client}/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  212. /package/{client/dist → dist/client}/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  213. /package/{client/dist → dist/client}/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  214. /package/{client/dist → dist/client}/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  215. /package/{client/dist → dist/client}/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  216. /package/{client/dist → dist/client}/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  217. /package/{client/dist → dist/client}/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  218. /package/{client/dist → dist/client}/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  219. /package/{client/dist → dist/client}/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  220. /package/{client/dist → dist/client}/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  221. /package/{client/dist → dist/client}/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  222. /package/{client/dist → dist/client}/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  223. /package/{client/dist → dist/client}/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  224. /package/{client/dist → dist/client}/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  225. /package/{client/dist → dist/client}/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  226. /package/{client/dist → dist/client}/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  227. /package/{client/dist → dist/client}/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  228. /package/{client/dist → dist/client}/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  229. /package/{client/dist → dist/client}/assets/vendor-i18n-DCFGyhQR.js +0 -0
  230. /package/{client/dist → dist/client}/assets/vendor-xterm-CZq1hqo1.js +0 -0
  231. /package/{client/dist → dist/client}/assets/vendor-xterm-qxJ8_QYu.css +0 -0
  232. /package/{client/dist → dist/client}/clear-cache.html +0 -0
  233. /package/{client/dist → dist/client}/convert-icons.md +0 -0
  234. /package/{client/dist → dist/client}/favicon.svg +0 -0
  235. /package/{client/dist → dist/client}/generate-icons.js +0 -0
  236. /package/{client/dist → dist/client}/icons/claude-ai-icon.svg +0 -0
  237. /package/{client/dist → dist/client}/icons/codex-white.svg +0 -0
  238. /package/{client/dist → dist/client}/icons/codex.svg +0 -0
  239. /package/{client/dist → dist/client}/icons/cursor-white.svg +0 -0
  240. /package/{client/dist → dist/client}/icons/cursor.svg +0 -0
  241. /package/{client/dist → dist/client}/icons/icon-128x128.svg +0 -0
  242. /package/{client/dist → dist/client}/icons/icon-144x144.svg +0 -0
  243. /package/{client/dist → dist/client}/icons/icon-152x152.svg +0 -0
  244. /package/{client/dist → dist/client}/icons/icon-192x192.svg +0 -0
  245. /package/{client/dist → dist/client}/icons/icon-384x384.svg +0 -0
  246. /package/{client/dist → dist/client}/icons/icon-512x512.svg +0 -0
  247. /package/{client/dist → dist/client}/icons/icon-72x72.svg +0 -0
  248. /package/{client/dist → dist/client}/icons/icon-96x96.svg +0 -0
  249. /package/{client/dist → dist/client}/icons/icon-template.svg +0 -0
  250. /package/{client/dist → dist/client}/logo.svg +0 -0
  251. /package/{client/dist → dist/client}/offline.html +0 -0
  252. /package/{client/dist → dist/client}/screenshots/cli-selection.png +0 -0
  253. /package/{client/dist → dist/client}/screenshots/desktop-main.png +0 -0
  254. /package/{client/dist → dist/client}/screenshots/mobile-chat.png +0 -0
  255. /package/{client/dist → dist/client}/screenshots/tools-modal.png +0 -0
  256. /package/{shared → dist}/gitagent/index.js +0 -0
  257. /package/{shared → dist}/gitagent/parser.js +0 -0
  258. /package/{shared → dist}/gitagent/prompt-builder.js +0 -0
package/README.md CHANGED
@@ -1,131 +1,108 @@
1
- # Upfyn-Code
1
+ # upfynai-code
2
2
 
3
- **Visual AI coding interface for Claude Code, Cursor & Codex.**
3
+ > CLI bridge for the Upfyn ecosystem — connect your machine to code.upfyn.com and control it from any browser, phone, or tablet.
4
4
 
5
- Canvas whiteboard, multi-agent chat, integrated terminal, git management, voice assistant, and MCP protocol — all in one browser-based IDE.
5
+ **Upfyn-Code CLI** connects your local development machine to the Upfyn web IDE through a secure WebSocket relay. Write code with AI assistance (Plan/Code/Analyse modes), run shell commands, manage files, and handle git — all from any device.
6
6
 
7
- By [Thinqmesh Technologies](https://thinqmesh.com)
7
+ Your source code **never leaves your machine**. All file operations, terminal commands, and git actions execute locally.
8
8
 
9
- ---
9
+ > **Prefer a GUI?** Download [Upfyn Code Desktop](https://code.upfyn.com/desktop) — same functionality with a native app that auto-connects on login.
10
10
 
11
- ## What is Upfyn-Code?
11
+ ## Install
12
12
 
13
- Upfyn-Code gives you a **visual web interface** for AI coding agents. Instead of working in a plain terminal, you get a full IDE experience with:
14
-
15
- - **Multi-Agent Chat** — Claude Code, Cursor, Codex, and 200+ models via OpenRouter
16
- - **Visual Canvas** — Infinite whiteboard with AI-powered blocks (Chat, Research, Code, Notes, PDF, Dashboard)
17
- - **Integrated Terminal** — Multi-tab shell with full ANSI color support
18
- - **File Explorer** — Browse, edit, and manage project files
19
- - **Git Panel** — Stage, commit, push, view diffs, switch branches
20
- - **Voice Assistant** — Talk to Upfyn hands-free
21
- - **Task Tracker** — AI-powered task breakdown from PRDs
22
- - **MCP Protocol** — Connect to Claude Code, Cursor, or any MCP-compatible tool
23
- - **Dashboard** — Session analytics, usage stats, and getting-started guide
24
- - **BYOK** — Bring Your Own API Key (Anthropic, OpenAI, Google, OpenRouter)
25
-
26
- ---
27
-
28
- ## Two ways to use it
13
+ ```bash
14
+ npm install -g upfynai-code
15
+ ```
29
16
 
30
- ### 1. Local mode (free, self-hosted)
17
+ **Requirements:** Node.js 18 or later. Works on Windows, macOS, and Linux.
31
18
 
32
- Install the package and run everything on your machine. No account needed.
19
+ ## Quick Start
33
20
 
34
21
  ```bash
35
- npm install -g upfynai-code
22
+ # 1. Authenticate with your Upfyn account
23
+ uc login
36
24
 
37
- # Launch Claude Code + web UI
38
- uc
25
+ # 2. Connect your machine to the web interface
26
+ uc connect
39
27
 
40
- # Or start the web server only
28
+ # 3. Or start the local UI server
41
29
  uc start
42
30
  ```
43
31
 
44
- The server starts at `http://localhost:3001`. It auto-detects your installed AI agents and creates a local user automatically.
32
+ Once connected, open [code.upfyn.com](https://code.upfyn.com) on any device to access your full development environment.
45
33
 
46
- **What you get locally:**
47
- - Full web UI with all features (chat, canvas, terminal, git, files, tasks)
48
- - Direct SDK calls to your local Claude Code / Codex / Cursor
49
- - No network round-trip — everything runs on your machine
50
- - Works offline (except AI queries which need API access)
34
+ ## Commands
51
35
 
52
- ### 2. Cloud mode (subscription required)
36
+ | Command | Description |
37
+ |---------|-------------|
38
+ | `uc` | Start local server with web UI |
39
+ | `uc start` | Start the web UI server (same as `uc`) |
40
+ | `uc connect` | Connect your machine to code.upfyn.com |
41
+ | `uc login` | Authenticate with your Upfyn account |
42
+ | `uc logout` | Clear saved credentials |
43
+ | `uc mcp` | Show MCP integration config for Claude/Cursor |
44
+ | `uc config` | View or set configuration |
53
45
 
54
- Access your machine from **any browser, anywhere** via [cli.upfyn.com](https://cli.upfyn.com).
46
+ ## The Ecosystem
55
47
 
56
- ```bash
57
- # 1. Sign up at cli.upfyn.com and get your relay token
58
- # 2. Connect your machine
59
- uc connect --server https://cli.upfyn.com --key upfyn_your_token
60
- ```
48
+ Upfyn-Code is part of a three-part ecosystem:
61
49
 
62
- Once connected, your local machine is bridged to the web UI. AI prompts, terminal commands, file operations, and git — all route through an encrypted relay to your machine.
50
+ 1. **Desktop App** (Tauri + Rust) Native app with full local access, auto-connects to cloud
51
+ 2. **Web App** (code.upfyn.com) — Browser IDE with AI chat, terminal, files, git
52
+ 3. **CLI** (this package) — Lightweight bridge for users who prefer the terminal
63
53
 
64
- **What you need for cloud mode:**
65
- - An active subscription at [cli.upfyn.com/pricing](https://cli.upfyn.com/pricing)
66
- - Your relay token (provided after signup)
67
- - The CLI installed on your machine
54
+ All three connect to the same cloud relay. Use whichever fits your workflow — they're interchangeable.
68
55
 
69
- **Why subscribe?**
70
- - Access your dev environment from any device (phone, tablet, another PC)
71
- - MCP API access — connect Claude Code or Cursor to Upfyn-Code remotely
72
- - Voice assistant with daily call allowance
73
- - Priority support
56
+ ## AI Modes
74
57
 
75
- ---
58
+ The web app supports three AI modes that change how the agent works:
76
59
 
77
- ## CLI Commands
60
+ - **Plan** — Explores codebase and designs an approach before writing code
61
+ - **Code** — Default. Reads, writes, and refactors code directly
62
+ - **Analyse** — Read-only. Explains and reviews code without changes
78
63
 
79
- | Command | Description |
80
- |---------|-------------|
81
- | `uc` | Launch Claude Code with Upfyn web UI |
82
- | `uc start` | Start the local web server only |
83
- | `uc connect --key <token>` | Connect to cli.upfyn.com (subscription required) |
84
- | `uc config --api-key <key>` | Save your Anthropic API key |
85
- | `uc status` | Show configuration and data locations |
86
- | `uc install-commands` | Install `/upfynai-*` slash commands for Claude Code |
87
- | `uc update` | Update to latest version |
88
- | `uc help` | Show all commands |
64
+ ## Features
89
65
 
90
- ## Slash Commands
66
+ ### AI Chat
67
+ Multi-model AI chat with Plan/Code/Analyse modes. Supports Claude, Codex, and BYOK providers.
91
68
 
92
- When you run `uc`, these slash commands are automatically available inside Claude Code:
69
+ ### Integrated Terminal
70
+ Full PTY terminal emulation from the browser. Run any command on your connected machine.
93
71
 
94
- | Command | Description |
95
- |---------|-------------|
96
- | `/upfynai-connect` | Connect CLI session to web UI |
97
- | `/upfynai-disconnect` | Disconnect from web UI |
98
- | `/upfynai-status` | Show connection status |
99
- | `/upfynai-doctor` | Run diagnostics |
72
+ ### File Explorer
73
+ Browse, edit, and manage project files remotely with syntax highlighting.
100
74
 
101
- ## BYOK (Bring Your Own Key)
75
+ ### Git Management
76
+ Visual git interface — commits, branches, diffs, merges, and conflict resolution.
102
77
 
103
- Even without a connected machine, you can use AI chat by adding your own API keys in Settings:
78
+ ### MCP Protocol
79
+ Use Upfyn-Code as an MCP server with Claude Desktop, Cursor, and other compatible tools.
104
80
 
105
- - **Anthropic** Claude models (Sonnet, Opus, Haiku)
106
- - **OpenAI** — GPT models
107
- - **OpenRouter** — 200+ models from all providers
108
- - **Google AI** — Gemini models
81
+ ## How It Works
109
82
 
110
- Configure via the web UI (Settings > AI Providers) or CLI:
111
- ```bash
112
- uc config --api-key sk-ant-api03-your-key
113
- ```
83
+ 1. **Install** the CLI on your development machine
84
+ 2. **Login** with `uc login` — authenticates once, saves credentials
85
+ 3. **Connect** with `uc connect` creates a secure WebSocket relay
86
+ 4. **Open** [code.upfyn.com](https://code.upfyn.com) on any browser (desktop, tablet, or mobile)
114
87
 
115
- ## Requirements
88
+ No ports are exposed and no firewall configuration is needed.
116
89
 
117
- - **Node.js 18+**
118
- - At least one AI agent installed:
119
- ```bash
120
- npm install -g @anthropic-ai/claude-code # Claude Code
121
- npm install -g @openai/codex # OpenAI Codex
122
- # Cursor — install from cursor.com
123
- ```
90
+ ## Security
124
91
 
125
- ## Documentation
92
+ - All communication encrypted via WSS (TLS)
93
+ - Source code **never stored** on servers — relay only
94
+ - Secure JWT authentication with automatic session management
95
+ - IP pinning prevents session hijacking
126
96
 
127
- Full documentation: [cli.upfyn.com/docs](https://cli.upfyn.com/docs)
97
+ ## Links
98
+
99
+ - **Website:** [code.upfyn.com](https://code.upfyn.com)
100
+ - **Desktop App:** [code.upfyn.com/desktop](https://code.upfyn.com/desktop)
101
+ - **Documentation:** [code.upfyn.com/docs](https://code.upfyn.com/docs)
102
+ - **GitHub:** [github.com/AnitChaudhry/UpfynAI-Code](https://github.com/AnitChaudhry/UpfynAI-Code)
128
103
 
129
104
  ## License
130
105
 
131
- GPL-3.0 — Thinqmesh Technologies
106
+ GPL-3.0 — see [LICENSE](https://github.com/AnitChaudhry/UpfynAI-Code/blob/main/LICENSE) for details.
107
+
108
+ Built by [Thinqmesh Technologies](https://code.upfyn.com).
package/bin/cli.js ADDED
@@ -0,0 +1,191 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { Command } from 'commander';
4
+ import { readFileSync } from 'fs';
5
+ import { dirname, join } from 'path';
6
+ import { fileURLToPath } from 'url';
7
+ import { login, logout, status, getToken, validateToken } from '../src/auth.js';
8
+ import { openHosted, startLocal } from '../src/launch.js';
9
+ import { connect } from '../src/connect.js';
10
+ import { mcp } from '../src/mcp.js';
11
+ import { readConfig, writeConfig, clearConfig, DEFAULTS, displayUrl } from '../src/config.js';
12
+ import chalk from 'chalk';
13
+
14
+ const __dirname = dirname(fileURLToPath(import.meta.url));
15
+ const pkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf8'));
16
+
17
+ const program = new Command();
18
+
19
+ program
20
+ .name('uc')
21
+ .description('Upfyn-Code — AI coding environment for your terminal')
22
+ .version(pkg.version)
23
+ .action(async () => {
24
+ // Default: start local server (no login needed)
25
+ await startLocal();
26
+ });
27
+
28
+ // ── Web subcommand group ──────────────────────────────────────────
29
+ const web = program
30
+ .command('web')
31
+ .description('Web UI commands — connect local machine to code.upfyn.com');
32
+
33
+ web
34
+ .command('connect [token]')
35
+ .description('Connect this machine to the web UI (uses saved token from login, or provide one)')
36
+ .option('--server <url>', 'Server URL (default: Upfyn Cloud)')
37
+ .action(async (token, options) => {
38
+ await connect({ key: token || undefined, server: options.server });
39
+ });
40
+
41
+ web
42
+ .command('open')
43
+ .description('Open the hosted web UI in your browser')
44
+ .action(async () => {
45
+ await openHosted();
46
+ });
47
+
48
+ web
49
+ .command('status')
50
+ .description('Show web connection status')
51
+ .action(async () => {
52
+ await status();
53
+ });
54
+
55
+ web
56
+ .command('token')
57
+ .description('Show the saved relay token')
58
+ .action(() => {
59
+ const config = readConfig();
60
+ if (!config.relayKey) {
61
+ console.log(chalk.yellow('\n No relay token saved. Run `uc login` first.\n'));
62
+ return;
63
+ }
64
+ const masked = `${config.relayKey.slice(0, 10)}...${config.relayKey.slice(-6)}`;
65
+ console.log(chalk.bold('\n Relay Token\n'));
66
+ console.log(` Token: ${chalk.cyan(masked)}`);
67
+ console.log(chalk.dim(` Full: ${config.relayKey}`));
68
+ console.log(chalk.dim(` Server: ${displayUrl(config.serverUrl)}\n`));
69
+ });
70
+
71
+ web
72
+ .command('regenerate-token')
73
+ .description('Generate a new relay token (invalidates old one)')
74
+ .action(async () => {
75
+ const token = getToken();
76
+ if (!token) {
77
+ console.log(chalk.yellow('\n Not logged in. Run `uc login` first.\n'));
78
+ process.exit(1);
79
+ }
80
+
81
+ console.log(chalk.dim('\n Validating session...'));
82
+ const user = await validateToken();
83
+ if (!user) {
84
+ console.log(chalk.yellow(' Session expired. Run `uc login` to re-authenticate.\n'));
85
+ process.exit(1);
86
+ }
87
+
88
+ console.log(chalk.dim(' Regenerating relay token...'));
89
+ try {
90
+ const config = readConfig();
91
+ const res = await fetch(`${config.serverUrl}/api/auth/regenerate-token`, {
92
+ method: 'POST',
93
+ headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` },
94
+ });
95
+ if (!res.ok) {
96
+ const data = await res.json().catch(() => ({}));
97
+ console.log(chalk.red(`\n Failed: ${data.error || 'Unknown error'}\n`));
98
+ process.exit(1);
99
+ }
100
+ const data = await res.json();
101
+ writeConfig({ relayKey: data.token });
102
+ console.log(chalk.green(`\n New relay token saved.`));
103
+ console.log(chalk.dim(` Old token is now invalid.`));
104
+ console.log(chalk.cyan(`\n Run ${chalk.bold('uc web connect')} to reconnect.\n`));
105
+ } catch (err) {
106
+ console.log(chalk.red(`\n Connection error. Could not reach server.\n`));
107
+ process.exit(1);
108
+ }
109
+ });
110
+
111
+ // ── Auth commands ─────────────────────────────────────────────────
112
+ program
113
+ .command('login')
114
+ .description('Authenticate with your Upfyn account (for web UI)')
115
+ .option('--server <url>', 'Server URL to authenticate against')
116
+ .action(async (options) => {
117
+ await login(options);
118
+ });
119
+
120
+ program
121
+ .command('logout')
122
+ .description('Clear saved credentials')
123
+ .action(async () => {
124
+ await logout();
125
+ });
126
+
127
+ // ── Connect (alias for web connect, backward compat) ─────────────
128
+ program
129
+ .command('connect')
130
+ .description('Connect local machine to the web UI (alias for: uc web connect)')
131
+ .option('--server <url>', 'Server URL to connect to')
132
+ .option('--key <token>', 'Connection token (optional — uses saved token from login)')
133
+ .action(async (options) => {
134
+ await connect(options);
135
+ });
136
+
137
+ // ── Local server ─────────────────────────────────────────────────
138
+ program
139
+ .command('start')
140
+ .description('Start the local UI server (same as running `uc` with no args)')
141
+ .option('--port <port>', 'Port to listen on', '3001')
142
+ .action(async (options) => {
143
+ if (options.port) {
144
+ writeConfig({ localPort: parseInt(options.port) });
145
+ }
146
+ await startLocal();
147
+ });
148
+
149
+ // ── MCP config ───────────────────────────────────────────────────
150
+ program
151
+ .command('mcp')
152
+ .description('Show MCP integration config for Claude / Cursor')
153
+ .option('--server <url>', 'Server URL')
154
+ .option('--key <token>', 'Relay token')
155
+ .action(async (options) => {
156
+ await mcp(options);
157
+ });
158
+
159
+ // ── Config ───────────────────────────────────────────────────────
160
+ program
161
+ .command('config')
162
+ .description('View or update CLI configuration')
163
+ .option('--server <url>', 'Set the server URL')
164
+ .option('--port <port>', 'Set the local server port')
165
+ .option('--reset', 'Reset config to defaults')
166
+ .action((options) => {
167
+ if (options.reset) {
168
+ clearConfig();
169
+ console.log(chalk.green('\n Config reset to defaults.\n'));
170
+ return;
171
+ }
172
+ if (options.server) {
173
+ const cleaned = options.server.replace(/\/+$/, '');
174
+ writeConfig({ serverUrl: cleaned });
175
+ console.log(chalk.green(`\n Server set to: ${displayUrl(cleaned)}\n`));
176
+ return;
177
+ }
178
+ if (options.port) {
179
+ writeConfig({ localPort: parseInt(options.port) });
180
+ console.log(chalk.green(`\n Local port set to: ${options.port}\n`));
181
+ return;
182
+ }
183
+ // Show current config
184
+ const config = readConfig();
185
+ console.log(chalk.bold('\n Upfyn-Code — Config\n'));
186
+ console.log(` Server: ${chalk.cyan(displayUrl(config.serverUrl))}`);
187
+ console.log(` Local port: ${chalk.cyan(config.localPort)}`);
188
+ console.log(` Logged in: ${config.token ? chalk.green('Yes') : chalk.yellow('No')}\n`);
189
+ });
190
+
191
+ program.parse();