upfynai-code 3.0.4 → 3.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 (246) hide show
  1. package/README.md +66 -91
  2. package/bin/cli.js +191 -0
  3. package/{client/dist/assets/AppContent-CwrTP6TW.js → dist/client/assets/AppContent-BofJquUs.js} +4 -4
  4. package/{client/dist/assets/BrowserPanel-0TLEl-IC.js → dist/client/assets/BrowserPanel-CSvD4jOX.js} +2 -2
  5. package/dist/client/assets/CanvasFullScreen-onRfarpc.js +1 -0
  6. package/dist/client/assets/CanvasWorkspace-DvGKdL-k.js +259 -0
  7. package/dist/client/assets/DashboardPanel-DqAHbXDO.js +1 -0
  8. package/dist/client/assets/FileTree-BE0h-9M9.js +1 -0
  9. package/{client/dist/assets/GitPanel-C_xFM-N2.js → dist/client/assets/GitPanel-DdeJ0bp5.js} +2 -2
  10. package/{client/dist/assets/LoginModal-CImJHRjX.js → dist/client/assets/LoginModal-BP0pCTrH.js} +3 -3
  11. package/dist/client/assets/MermaidBlock-D0rfEhrT.js +2 -0
  12. package/dist/client/assets/Onboarding-B2zQy-_6.js +1 -0
  13. package/dist/client/assets/SetupForm-Be7-WBe-.js +1 -0
  14. package/dist/client/assets/WorkflowsPanel-CusLbVJ6.js +1 -0
  15. package/{client/dist/assets/index-HaY-3pK1.js → dist/client/assets/index-BQy15irW.js} +24 -24
  16. package/dist/client/assets/index-CS0fDqEC.js +1 -0
  17. package/dist/client/assets/index-DYLSCCCp.css +1 -0
  18. package/dist/client/assets/vendor-canvas-QWTduIvM.js +23 -0
  19. package/{client/dist/assets/vendor-icons-GyYE35HP.js → dist/client/assets/vendor-icons-kix3Gb31.js} +1 -1
  20. package/{client/dist/assets/vendor-mermaid-DucWyDEe.js → dist/client/assets/vendor-mermaid-CS3J4_Bz.js} +329 -326
  21. package/dist/client/favicon.png +0 -0
  22. package/dist/client/favicon.svg +15 -0
  23. package/{client/dist → dist/client}/index.html +3 -3
  24. package/{client/dist → dist/client}/manifest.json +12 -12
  25. package/package.json +55 -104
  26. package/scripts/postinstall.js +9 -0
  27. package/scripts/prepublish.js +77 -0
  28. package/src/animation.js +228 -0
  29. package/src/auth.js +142 -0
  30. package/src/config.js +40 -0
  31. package/src/connect.js +416 -0
  32. package/src/launch.js +81 -0
  33. package/src/mcp.js +57 -0
  34. package/src/permissions.js +140 -0
  35. package/src/persistent-shell.js +261 -0
  36. package/src/server.js +54 -0
  37. package/client/dist/assets/CanvasFullScreen-D1GWQsGL.js +0 -1
  38. package/client/dist/assets/CanvasWorkspace-D7ORj358.js +0 -163
  39. package/client/dist/assets/DashboardPanel-BV7ybUDe.js +0 -1
  40. package/client/dist/assets/FileTree-5qfhBqdE.js +0 -1
  41. package/client/dist/assets/MermaidBlock-BFM21cwe.js +0 -2
  42. package/client/dist/assets/Onboarding-B3cteLu2.js +0 -1
  43. package/client/dist/assets/SetupForm-P6dsYgHO.js +0 -1
  44. package/client/dist/assets/WorkflowsPanel-CBoN80kc.js +0 -1
  45. package/client/dist/assets/index-46kkVu2i.css +0 -1
  46. package/client/dist/assets/vendor-canvas-DvHJ_Pn2.js +0 -49
  47. package/client/dist/favicon.png +0 -0
  48. package/client/dist/favicon.svg +0 -5
  49. package/commands/upfynai-connect.md +0 -59
  50. package/commands/upfynai-disconnect.md +0 -31
  51. package/commands/upfynai-doctor.md +0 -99
  52. package/commands/upfynai-export.md +0 -49
  53. package/commands/upfynai-local.md +0 -82
  54. package/commands/upfynai-status.md +0 -75
  55. package/commands/upfynai-stop.md +0 -49
  56. package/commands/upfynai-uninstall.md +0 -58
  57. package/commands/upfynai.md +0 -69
  58. package/scripts/build-client.js +0 -17
  59. package/scripts/fix-node-pty.js +0 -67
  60. package/scripts/install-commands.js +0 -78
  61. package/server/agent-loop.js +0 -242
  62. package/server/auto-compact.js +0 -99
  63. package/server/browser.js +0 -131
  64. package/server/claude-sdk.js +0 -797
  65. package/server/cli-ui.js +0 -798
  66. package/server/cli.js +0 -751
  67. package/server/constants/config.js +0 -31
  68. package/server/cursor-cli.js +0 -270
  69. package/server/database/auth.db +0 -0
  70. package/server/database/db.js +0 -1547
  71. package/server/database/init.sql +0 -70
  72. package/server/index.js +0 -3813
  73. package/server/load-env.js +0 -26
  74. package/server/mcp-server.js +0 -621
  75. package/server/middleware/auth.js +0 -184
  76. package/server/middleware/relayHelpers.js +0 -44
  77. package/server/middleware/sandboxRouter.js +0 -174
  78. package/server/openai-codex.js +0 -403
  79. package/server/openrouter.js +0 -137
  80. package/server/projects.js +0 -1807
  81. package/server/provider-factory.js +0 -174
  82. package/server/relay-client.js +0 -390
  83. package/server/routes/agent.js +0 -1234
  84. package/server/routes/auth.js +0 -559
  85. package/server/routes/browser.js +0 -419
  86. package/server/routes/canvas.js +0 -53
  87. package/server/routes/cli-auth.js +0 -263
  88. package/server/routes/codex.js +0 -396
  89. package/server/routes/commands.js +0 -707
  90. package/server/routes/composio.js +0 -176
  91. package/server/routes/cursor.js +0 -770
  92. package/server/routes/dashboard.js +0 -295
  93. package/server/routes/git.js +0 -1208
  94. package/server/routes/keys.js +0 -34
  95. package/server/routes/mcp-utils.js +0 -48
  96. package/server/routes/mcp.js +0 -661
  97. package/server/routes/payments.js +0 -227
  98. package/server/routes/projects.js +0 -754
  99. package/server/routes/sessions.js +0 -146
  100. package/server/routes/settings.js +0 -261
  101. package/server/routes/taskmaster.js +0 -1928
  102. package/server/routes/user.js +0 -106
  103. package/server/routes/vapi-chat.js +0 -624
  104. package/server/routes/voice.js +0 -235
  105. package/server/routes/webhooks.js +0 -166
  106. package/server/routes/workflows.js +0 -312
  107. package/server/sandbox.js +0 -120
  108. package/server/services/browser-ai.js +0 -154
  109. package/server/services/composio.js +0 -204
  110. package/server/services/sessionRegistry.js +0 -139
  111. package/server/services/whisperService.js +0 -84
  112. package/server/services/workflowScheduler.js +0 -211
  113. package/server/tests/relay-flow.test.js +0 -570
  114. package/server/tests/sessions.test.js +0 -259
  115. package/server/utils/commandParser.js +0 -303
  116. package/server/utils/email.js +0 -66
  117. package/server/utils/gitConfig.js +0 -24
  118. package/server/utils/mcp-detector.js +0 -198
  119. package/server/utils/taskmaster-websocket.js +0 -129
  120. package/shared/integrationCatalog.d.ts +0 -12
  121. package/shared/integrationCatalog.js +0 -172
  122. package/shared/modelConstants.js +0 -96
  123. /package/{shared → dist}/agents/claude.js +0 -0
  124. /package/{shared → dist}/agents/codex.js +0 -0
  125. /package/{shared → dist}/agents/cursor.js +0 -0
  126. /package/{shared → dist}/agents/detect.js +0 -0
  127. /package/{shared → dist}/agents/exec.js +0 -0
  128. /package/{shared → dist}/agents/files.js +0 -0
  129. /package/{shared → dist}/agents/git.js +0 -0
  130. /package/{shared → dist}/agents/gitagent.js +0 -0
  131. /package/{shared → dist}/agents/index.js +0 -0
  132. /package/{shared → dist}/agents/shell.js +0 -0
  133. /package/{shared → dist}/agents/utils.js +0 -0
  134. /package/{client/dist → dist/client}/api-docs.html +0 -0
  135. /package/{client/dist → dist/client}/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  136. /package/{client/dist → dist/client}/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  137. /package/{client/dist → dist/client}/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  138. /package/{client/dist → dist/client}/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  139. /package/{client/dist → dist/client}/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  140. /package/{client/dist → dist/client}/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  141. /package/{client/dist → dist/client}/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  142. /package/{client/dist → dist/client}/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  143. /package/{client/dist → dist/client}/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  144. /package/{client/dist → dist/client}/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  145. /package/{client/dist → dist/client}/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  146. /package/{client/dist → dist/client}/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  147. /package/{client/dist → dist/client}/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  148. /package/{client/dist → dist/client}/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  149. /package/{client/dist → dist/client}/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  150. /package/{client/dist → dist/client}/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  151. /package/{client/dist → dist/client}/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  152. /package/{client/dist → dist/client}/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  153. /package/{client/dist → dist/client}/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  154. /package/{client/dist → dist/client}/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  155. /package/{client/dist → dist/client}/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  156. /package/{client/dist → dist/client}/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  157. /package/{client/dist → dist/client}/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  158. /package/{client/dist → dist/client}/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  159. /package/{client/dist → dist/client}/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  160. /package/{client/dist → dist/client}/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  161. /package/{client/dist → dist/client}/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  162. /package/{client/dist → dist/client}/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  163. /package/{client/dist → dist/client}/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  164. /package/{client/dist → dist/client}/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  165. /package/{client/dist → dist/client}/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  166. /package/{client/dist → dist/client}/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  167. /package/{client/dist → dist/client}/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  168. /package/{client/dist → dist/client}/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  169. /package/{client/dist → dist/client}/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  170. /package/{client/dist → dist/client}/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  171. /package/{client/dist → dist/client}/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  172. /package/{client/dist → dist/client}/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  173. /package/{client/dist → dist/client}/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  174. /package/{client/dist → dist/client}/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  175. /package/{client/dist → dist/client}/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  176. /package/{client/dist → dist/client}/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  177. /package/{client/dist → dist/client}/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  178. /package/{client/dist → dist/client}/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  179. /package/{client/dist → dist/client}/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  180. /package/{client/dist → dist/client}/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  181. /package/{client/dist → dist/client}/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  182. /package/{client/dist → dist/client}/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  183. /package/{client/dist → dist/client}/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  184. /package/{client/dist → dist/client}/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  185. /package/{client/dist → dist/client}/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  186. /package/{client/dist → dist/client}/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  187. /package/{client/dist → dist/client}/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  188. /package/{client/dist → dist/client}/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  189. /package/{client/dist → dist/client}/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  190. /package/{client/dist → dist/client}/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  191. /package/{client/dist → dist/client}/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  192. /package/{client/dist → dist/client}/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  193. /package/{client/dist → dist/client}/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  194. /package/{client/dist → dist/client}/assets/MarkdownPreview-CESjI261.js +0 -0
  195. /package/{client/dist → dist/client}/assets/PreviewPanel-CqCa92Tf.js +0 -0
  196. /package/{client/dist → dist/client}/assets/pdf-CE_K4jFx.js +0 -0
  197. /package/{client/dist → dist/client}/assets/vendor-canvas-BZV40eAE.css +0 -0
  198. /package/{client/dist → dist/client}/assets/vendor-codemirror-D2ALgpaX.js +0 -0
  199. /package/{client/dist → dist/client}/assets/vendor-diff-DNQpbhrT.js +0 -0
  200. /package/{client/dist → dist/client}/assets/vendor-i18n-DCFGyhQR.js +0 -0
  201. /package/{client/dist → dist/client}/assets/vendor-markdown-CimbIo6Y.js +0 -0
  202. /package/{client/dist → dist/client}/assets/vendor-react-96lCPsRK.js +0 -0
  203. /package/{client/dist → dist/client}/assets/vendor-syntax-LS_Nt30I.js +0 -0
  204. /package/{client/dist → dist/client}/assets/vendor-xterm-CZq1hqo1.js +0 -0
  205. /package/{client/dist → dist/client}/assets/vendor-xterm-qxJ8_QYu.css +0 -0
  206. /package/{client/dist → dist/client}/clear-cache.html +0 -0
  207. /package/{client/dist → dist/client}/convert-icons.md +0 -0
  208. /package/{client/dist → dist/client}/generate-icons.js +0 -0
  209. /package/{client/dist → dist/client}/icons/claude-ai-icon.svg +0 -0
  210. /package/{client/dist → dist/client}/icons/codex-white.svg +0 -0
  211. /package/{client/dist → dist/client}/icons/codex.svg +0 -0
  212. /package/{client/dist → dist/client}/icons/cursor-white.svg +0 -0
  213. /package/{client/dist → dist/client}/icons/cursor.svg +0 -0
  214. /package/{client/dist → dist/client}/icons/icon-128x128.png +0 -0
  215. /package/{client/dist → dist/client}/icons/icon-128x128.svg +0 -0
  216. /package/{client/dist → dist/client}/icons/icon-144x144.png +0 -0
  217. /package/{client/dist → dist/client}/icons/icon-144x144.svg +0 -0
  218. /package/{client/dist → dist/client}/icons/icon-152x152.png +0 -0
  219. /package/{client/dist → dist/client}/icons/icon-152x152.svg +0 -0
  220. /package/{client/dist → dist/client}/icons/icon-192x192.png +0 -0
  221. /package/{client/dist → dist/client}/icons/icon-192x192.svg +0 -0
  222. /package/{client/dist → dist/client}/icons/icon-384x384.png +0 -0
  223. /package/{client/dist → dist/client}/icons/icon-384x384.svg +0 -0
  224. /package/{client/dist → dist/client}/icons/icon-512x512.png +0 -0
  225. /package/{client/dist → dist/client}/icons/icon-512x512.svg +0 -0
  226. /package/{client/dist → dist/client}/icons/icon-72x72.png +0 -0
  227. /package/{client/dist → dist/client}/icons/icon-72x72.svg +0 -0
  228. /package/{client/dist → dist/client}/icons/icon-96x96.png +0 -0
  229. /package/{client/dist → dist/client}/icons/icon-96x96.svg +0 -0
  230. /package/{client/dist → dist/client}/icons/icon-template.svg +0 -0
  231. /package/{client/dist → dist/client}/logo-128.png +0 -0
  232. /package/{client/dist → dist/client}/logo-256.png +0 -0
  233. /package/{client/dist → dist/client}/logo-32.png +0 -0
  234. /package/{client/dist → dist/client}/logo-512.png +0 -0
  235. /package/{client/dist → dist/client}/logo-64.png +0 -0
  236. /package/{client/dist → dist/client}/logo.svg +0 -0
  237. /package/{client/dist → dist/client}/mcp-docs.html +0 -0
  238. /package/{client/dist → dist/client}/offline.html +0 -0
  239. /package/{client/dist → dist/client}/screenshots/cli-selection.png +0 -0
  240. /package/{client/dist → dist/client}/screenshots/desktop-main.png +0 -0
  241. /package/{client/dist → dist/client}/screenshots/mobile-chat.png +0 -0
  242. /package/{client/dist → dist/client}/screenshots/tools-modal.png +0 -0
  243. /package/{client/dist → dist/client}/sw.js +0 -0
  244. /package/{shared → dist}/gitagent/index.js +0 -0
  245. /package/{shared → dist}/gitagent/parser.js +0 -0
  246. /package/{shared → dist}/gitagent/prompt-builder.js +0 -0
package/README.md CHANGED
@@ -1,131 +1,106 @@
1
- # Upfyn-Code
1
+ # upfyn-code
2
2
 
3
- **Visual AI coding interface for Claude Code, Cursor & Codex.**
3
+ > Unified AI coding interface access AI chat, terminal, file explorer, git, and visual canvas from any browser.
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** connects your local development machine to a browser-based UI through a secure, encrypted connection. Write code with AI assistance, run shell commands, manage files, handle git operations, and plan on a visual canvas — all from any device, anywhere.
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
+ ## Install
10
10
 
11
- ## What is Upfyn-Code?
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)
11
+ ```bash
12
+ npm install -g upfynai-code
13
+ ```
25
14
 
26
- ---
15
+ Or run directly with npx:
27
16
 
28
- ## Two ways to use it
17
+ ```bash
18
+ npx upfynai-code
19
+ ```
29
20
 
30
- ### 1. Local mode (free, self-hosted)
21
+ **Requirements:** Node.js 22 or later. Works on Windows, macOS, and Linux.
31
22
 
32
- Install the package and run everything on your machine. No account needed.
23
+ ## Quick Start
33
24
 
34
25
  ```bash
35
- npm install -g upfynai-code
26
+ # 1. Authenticate with your Upfyn account
27
+ uc login
36
28
 
37
- # Launch Claude Code + web UI
38
- uc
29
+ # 2. Connect your machine to the web interface
30
+ uc connect
39
31
 
40
- # Or start the web server only
32
+ # 3. Open the web UI (opens automatically)
41
33
  uc start
42
34
  ```
43
35
 
44
- The server starts at `http://localhost:3001`. It auto-detects your installed AI agents and creates a local user automatically.
36
+ Once connected, open [cli.upfyn.com](https://cli.upfyn.com) on any device to access your full development environment.
45
37
 
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)
38
+ ## Commands
51
39
 
52
- ### 2. Cloud mode (subscription required)
40
+ | Command | Description |
41
+ |---------|-------------|
42
+ | `uc` | Launch Claude Code with Upfyn web UI in background |
43
+ | `uc start` | Start the web UI server |
44
+ | `uc connect` | Connect your local machine to the cloud interface |
45
+ | `uc login` | Authenticate with your Upfyn account |
46
+ | `uc logout` | Clear saved credentials |
47
+ | `uc status` | Show current configuration |
48
+ | `uc config` | View or set configuration |
49
+ | `uc help` | Show all available commands |
53
50
 
54
- Access your machine from **any browser, anywhere** via [cli.upfyn.com](https://cli.upfyn.com).
51
+ ### Connect Options
55
52
 
56
53
  ```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
54
+ uc connect --key <token>
60
55
  ```
61
56
 
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.
57
+ - `--key <token>` Your connection token (get from the web UI after signing in)
63
58
 
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
59
+ ## Features
68
60
 
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
61
+ ### AI Chat
62
+ Converse with AI coding assistants to write, debug, and refactor code across any language. Supports multiple AI models.
74
63
 
75
- ---
64
+ ### Integrated Terminal
65
+ Run shell commands on your connected machine directly from the browser. Full terminal emulation with command history.
76
66
 
77
- ## CLI Commands
67
+ ### File Explorer
68
+ Browse, create, edit, and manage your entire project tree remotely. Supports drag-and-drop, file search, and bulk operations.
78
69
 
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 |
70
+ ### Git Management
71
+ Visual git interface for commits, branches, diffs, and merges. Stage changes, resolve conflicts, and manage branches without leaving the browser.
89
72
 
90
- ## Slash Commands
73
+ ### Upfyn Canvas
74
+ Visual whiteboard with AI-powered blocks for planning and collaboration. Connect chat, research, code, and documentation blocks into context flows.
91
75
 
92
- When you run `uc`, these slash commands are automatically available inside Claude Code:
76
+ ### MCP Protocol
77
+ Connect external tools and services via the Model Context Protocol. Use Upfyn-Code as an MCP server with Claude Desktop, Cursor, and other compatible tools.
93
78
 
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 |
79
+ ## How It Works
100
80
 
101
- ## BYOK (Bring Your Own Key)
81
+ 1. **Install** the CLI on your development machine
82
+ 2. **Authenticate** with `uc login`
83
+ 3. **Connect** with `uc connect` — creates a secure, encrypted connection
84
+ 4. **Open** [cli.upfyn.com](https://cli.upfyn.com) on any browser (desktop, tablet, or mobile)
102
85
 
103
- Even without a connected machine, you can use AI chat by adding your own API keys in Settings:
86
+ The CLI connects your local filesystem, terminal, and git to the web interface. No ports are exposed and no firewall configuration is needed.
104
87
 
105
- - **Anthropic** — Claude models (Sonnet, Opus, Haiku)
106
- - **OpenAI** — GPT models
107
- - **OpenRouter** — 200+ models from all providers
108
- - **Google AI** — Gemini models
88
+ ## Security
109
89
 
110
- Configure via the web UI (Settings > AI Providers) or CLI:
111
- ```bash
112
- uc config --api-key sk-ant-api03-your-key
113
- ```
114
-
115
- ## Requirements
90
+ - All communication is encrypted end-to-end
91
+ - Source code is **never stored** on servers
92
+ - Secure authentication with automatic session management
93
+ - Each user's environment is fully isolated
116
94
 
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
- ```
95
+ ## Links
124
96
 
125
- ## Documentation
126
-
127
- Full documentation: [cli.upfyn.com/docs](https://cli.upfyn.com/docs)
97
+ - **Website:** [cli.upfyn.com](https://cli.upfyn.com)
98
+ - **Documentation:** [cli.upfyn.com/docs](https://cli.upfyn.com/docs)
99
+ - **GitHub:** [github.com/AnitChaudhry/UpfynAI-Code](https://github.com/AnitChaudhry/UpfynAI-Code)
100
+ - **Issues:** [github.com/AnitChaudhry/UpfynAI-Code/issues](https://github.com/AnitChaudhry/UpfynAI-Code/issues)
128
101
 
129
102
  ## License
130
103
 
131
- GPL-3.0 — Thinqmesh Technologies
104
+ GPL-3.0 — see [LICENSE](https://github.com/AnitChaudhry/UpfynAI-Code/blob/main/LICENSE) for details.
105
+
106
+ Built by [Upfynai-Code](https://cli.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 cli.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();