upfyn-code 1.0.2 → 1.0.4

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.
package/README.md ADDED
@@ -0,0 +1,166 @@
1
+ # upfyn-code
2
+
3
+ > Unified AI coding interface — access AI chat, terminal, file explorer, git, and visual canvas from any browser.
4
+
5
+ **Upfyn-Code** connects your local development machine to a browser-based UI through a secure WebSocket relay. 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
+
7
+ Your source code **never leaves your machine**. All file operations, terminal commands, and git actions execute locally through the relay connection.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npm install -g upfyn-code
13
+ ```
14
+
15
+ Or run directly with npx:
16
+
17
+ ```bash
18
+ npx upfyn-code
19
+ ```
20
+
21
+ **Requirements:** Node.js 18 or later. Works on Windows, macOS, and Linux.
22
+
23
+ ## Quick Start
24
+
25
+ ```bash
26
+ # 1. Authenticate with your Upfyn account
27
+ upfyn-code login
28
+
29
+ # 2. Connect your machine to the web interface
30
+ upfyn-code connect
31
+
32
+ # 3. Open the web UI (opens automatically)
33
+ upfyn-code
34
+ ```
35
+
36
+ Once connected, open [cli.upfyn.com](https://cli.upfyn.com) on any device to access your full development environment.
37
+
38
+ ## Commands
39
+
40
+ | Command | Description |
41
+ |---------|-------------|
42
+ | `upfyn-code` | Open the hosted web interface (default) |
43
+ | `upfyn-code --local` | Start a local server instead of the hosted app |
44
+ | `upfyn-code login` | Authenticate with your Upfyn account |
45
+ | `upfyn-code logout` | Clear saved credentials |
46
+ | `upfyn-code status` | Show current auth status and configuration |
47
+ | `upfyn-code connect` | Connect your local machine to the remote server |
48
+ | `upfyn-code mcp` | Show MCP integration config for Claude / Cursor |
49
+
50
+ ### Connect Options
51
+
52
+ ```bash
53
+ upfyn-code connect --server <url> --key <token>
54
+ ```
55
+
56
+ - `--server <url>` — Server URL to connect to
57
+ - `--key <token>` — Relay token (get from the web UI after signing in)
58
+
59
+ ### MCP Integration
60
+
61
+ ```bash
62
+ upfyn-code mcp --server <url> --key <token>
63
+ ```
64
+
65
+ Outputs the MCP (Model Context Protocol) configuration JSON for use with Claude Desktop, Cursor, or other MCP-compatible tools.
66
+
67
+ **Example output:**
68
+
69
+ ```json
70
+ {
71
+ "mcpServers": {
72
+ "upfyn-code": {
73
+ "url": "https://your-server.com/mcp",
74
+ "headers": {
75
+ "Authorization": "Bearer rt_xxxxx"
76
+ }
77
+ }
78
+ }
79
+ }
80
+ ```
81
+
82
+ ## Features
83
+
84
+ ### AI Chat
85
+ Converse with AI coding assistants to write, debug, and refactor code across any language. Supports multiple AI models.
86
+
87
+ ### Integrated Terminal
88
+ Run shell commands on your connected machine directly from the browser. Full terminal emulation with command history.
89
+
90
+ ### File Explorer
91
+ Browse, create, edit, and manage your entire project tree remotely. Supports drag-and-drop, file search, and bulk operations.
92
+
93
+ ### Git Management
94
+ Visual git interface for commits, branches, diffs, and merges. Stage changes, resolve conflicts, and manage branches without leaving the browser.
95
+
96
+ ### Upfyn Canvas
97
+ Visual whiteboard with AI-powered blocks for planning and collaboration. Connect chat, research, code, and documentation blocks into context flows.
98
+
99
+ ### MCP Protocol
100
+ 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.
101
+
102
+ ## How It Works
103
+
104
+ 1. **Install** the CLI on your development machine
105
+ 2. **Authenticate** with `upfyn-code login`
106
+ 3. **Connect** with `upfyn-code connect` — this creates a secure WebSocket tunnel
107
+ 4. **Open** [cli.upfyn.com](https://cli.upfyn.com) on any browser (desktop, tablet, or mobile)
108
+
109
+ The CLI bridges your local filesystem, terminal, and git to the web interface. No ports are exposed and no firewall configuration is needed — the connection works through a secure relay.
110
+
111
+ ```
112
+ ┌─────────────┐ WebSocket ┌──────────────┐ Browser ┌──────────────┐
113
+ │ Your Local │ ──────────────▶ │ Upfyn Relay │ ◀────────────── │ Web UI at │
114
+ │ Machine │ (encrypted) │ Server │ │ cli.upfyn.com│
115
+ └─────────────┘ └──────────────┘ └──────────────┘
116
+ ```
117
+
118
+ ## Security
119
+
120
+ - All communication is encrypted with TLS
121
+ - Source code is relayed in real-time and **never stored** on servers
122
+ - Authentication uses JWT tokens with httpOnly cookies
123
+ - The relay connection requires both a valid session and a connection token
124
+ - Self-hosting is supported for full data sovereignty
125
+
126
+ ## Self-Hosting
127
+
128
+ Upfyn-Code is open source under the GPL-3.0 license. You can deploy the entire stack on your own infrastructure:
129
+
130
+ ```bash
131
+ git clone https://github.com/AnitChaudhry/UpfynAI-Code.git
132
+ cd UpfynAI-Code
133
+
134
+ # Install dependencies
135
+ npm install
136
+
137
+ # Start the backend
138
+ cd backend && npm start
139
+
140
+ # Start the frontend
141
+ cd frontend && npm run dev
142
+ ```
143
+
144
+ See the [repository](https://github.com/AnitChaudhry/UpfynAI-Code) for full deployment instructions.
145
+
146
+ ## Configuration
147
+
148
+ Credentials and config are stored locally at:
149
+
150
+ | Platform | Path |
151
+ |----------|------|
152
+ | macOS / Linux | `~/.config/upfyn-code/` |
153
+ | Windows | `%APPDATA%\upfyn-code\` |
154
+
155
+ ## Links
156
+
157
+ - **Website:** [cli.upfyn.com](https://cli.upfyn.com)
158
+ - **Documentation:** [cli.upfyn.com/docs](https://cli.upfyn.com/docs)
159
+ - **GitHub:** [github.com/AnitChaudhry/UpfynAI-Code](https://github.com/AnitChaudhry/UpfynAI-Code)
160
+ - **Issues:** [github.com/AnitChaudhry/UpfynAI-Code/issues](https://github.com/AnitChaudhry/UpfynAI-Code/issues)
161
+
162
+ ## License
163
+
164
+ GPL-3.0 — see [LICENSE](https://github.com/AnitChaudhry/UpfynAI-Code/blob/main/LICENSE) for details.
165
+
166
+ Built by [Thinqmesh Technologies](https://cli.upfyn.com).
package/bin/cli.js CHANGED
@@ -11,7 +11,7 @@ const program = new Command();
11
11
  program
12
12
  .name('upfyn-code')
13
13
  .description('Launch Upfyn AI coding environment from your terminal')
14
- .version('1.0.2')
14
+ .version('1.0.4')
15
15
  .option('--local', 'Start a local server instead of opening the hosted app')
16
16
  .action(async (options) => {
17
17
  if (options.local) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "upfyn-code",
3
- "version": "1.0.2",
4
- "description": "Launch Upfyn AI coding environment from your terminal",
3
+ "version": "1.0.4",
4
+ "description": "Unified AI coding interface — access AI chat, terminal, file explorer, git, and visual canvas from any browser. Connect your local machine and code from anywhere.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "upfyn-code": "./bin/cli.js"
@@ -9,21 +9,50 @@
9
9
  "files": [
10
10
  "bin/",
11
11
  "src/",
12
- "dist/"
12
+ "dist/",
13
+ "README.md",
14
+ "LICENSE"
13
15
  ],
14
16
  "scripts": {
15
- "start": "node bin/cli.js",
16
- "build-frontend": "cd ../../frontend && npm run build && cp -r dist ../../packages/cli/dist"
17
+ "start": "node bin/cli.js"
17
18
  },
18
19
  "keywords": [
19
20
  "upfyn",
21
+ "upfyn-code",
20
22
  "ai",
21
23
  "coding",
22
24
  "cli",
23
- "terminal"
25
+ "terminal",
26
+ "remote-development",
27
+ "code-editor",
28
+ "ai-assistant",
29
+ "ai-coding",
30
+ "developer-tools",
31
+ "devtools",
32
+ "browser-ide",
33
+ "remote-access",
34
+ "websocket",
35
+ "git",
36
+ "file-explorer",
37
+ "canvas",
38
+ "whiteboard",
39
+ "mcp",
40
+ "model-context-protocol"
24
41
  ],
25
- "author": "Upfyn",
26
- "license": "MIT",
42
+ "author": {
43
+ "name": "Thinqmesh Technologies",
44
+ "url": "https://cli.upfyn.com"
45
+ },
46
+ "license": "GPL-3.0",
47
+ "homepage": "https://cli.upfyn.com",
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "git+https://github.com/AnitChaudhry/UpfynAI-Code.git",
51
+ "directory": "packages/cli"
52
+ },
53
+ "bugs": {
54
+ "url": "https://github.com/AnitChaudhry/UpfynAI-Code/issues"
55
+ },
27
56
  "dependencies": {
28
57
  "chalk": "^5.3.0",
29
58
  "commander": "^12.1.0",
@@ -35,5 +64,10 @@
35
64
  },
36
65
  "engines": {
37
66
  "node": ">=18.0.0"
38
- }
67
+ },
68
+ "os": [
69
+ "darwin",
70
+ "linux",
71
+ "win32"
72
+ ]
39
73
  }
package/src/auth.js CHANGED
@@ -82,7 +82,7 @@ export async function login() {
82
82
  const name = data.user.first_name || data.user.username;
83
83
  console.log(chalk.green(`\n Logged in as ${chalk.bold(name)}!\n`));
84
84
  } catch (err) {
85
- console.log(chalk.red(`\n Connection error: ${err.message}\n`));
85
+ console.log(chalk.red('\n Connection error. Check your network and try again.\n'));
86
86
  process.exit(1);
87
87
  }
88
88
  }
package/src/connect.js CHANGED
@@ -74,7 +74,7 @@ async function handleRelayCommand(data, ws) {
74
74
  switch (action) {
75
75
  case 'claude-query': {
76
76
  const { command, options } = data;
77
- console.log(chalk.cyan(` [relay] Claude query: ${command?.slice(0, 80)}...`));
77
+ console.log(chalk.cyan(' [relay] Processing Claude query...'));
78
78
 
79
79
  const args = ['--print'];
80
80
  if (options?.projectPath) args.push('--cwd', options.projectPath);
@@ -114,7 +114,7 @@ async function handleRelayCommand(data, ws) {
114
114
 
115
115
  case 'shell-command': {
116
116
  const { command: cmd, cwd } = data;
117
- console.log(chalk.dim(` [relay] Shell: ${cmd?.slice(0, 60)}`));
117
+ console.log(chalk.dim(' [relay] Executing shell command...'));
118
118
  const result = await execCommand(cmd, [], { cwd: cwd || os.homedir(), timeout: 60000 });
119
119
  ws.send(JSON.stringify({ type: 'relay-response', requestId, data: { stdout: result } }));
120
120
  break;
@@ -143,7 +143,7 @@ async function handleRelayCommand(data, ws) {
143
143
 
144
144
  case 'git-operation': {
145
145
  const { gitCommand, cwd: gitCwd } = data;
146
- console.log(chalk.dim(` [relay] Git: ${gitCommand}`));
146
+ console.log(chalk.dim(' [relay] Running git operation...'));
147
147
  const result = await execCommand('git', [gitCommand], { cwd: gitCwd });
148
148
  ws.send(JSON.stringify({ type: 'relay-response', requestId, data: { stdout: result } }));
149
149
  break;
@@ -198,7 +198,7 @@ export async function connect(options = {}) {
198
198
  const data = await res.json();
199
199
  relayKey = data.token;
200
200
  } catch (err) {
201
- console.log(chalk.red(`\n Could not get connection token: ${err.message}\n`));
201
+ console.log(chalk.red('\n Could not get connection token. Check your network and try again.\n'));
202
202
  process.exit(1);
203
203
  }
204
204
  }
@@ -251,7 +251,7 @@ export async function connect(options = {}) {
251
251
  return;
252
252
  }
253
253
  } catch (e) {
254
- console.error(chalk.red(` Error: ${e.message}`));
254
+ // message parse error
255
255
  }
256
256
  });
257
257
 
package/src/launch.js CHANGED
@@ -25,7 +25,7 @@ export async function openHosted() {
25
25
 
26
26
  const name = user.first_name || user.username;
27
27
  console.log(chalk.green(` Welcome back, ${chalk.bold(name)}!`));
28
- console.log(chalk.dim(` Opening ${config.serverUrl} ...\n`));
28
+ console.log(chalk.dim(' Opening Upfyn-Code in your browser...\n'));
29
29
 
30
30
  await open(url);
31
31
  }
package/src/mcp.js CHANGED
@@ -33,7 +33,7 @@ export async function mcp(options = {}) {
33
33
  const data = await res.json();
34
34
  relayKey = data.token;
35
35
  } catch (err) {
36
- console.log(chalk.red(`\n Could not get connection token: ${err.message}\n`));
36
+ console.log(chalk.red('\n Could not get connection token. Check your network and try again.\n'));
37
37
  process.exit(1);
38
38
  }
39
39
  }
@@ -53,7 +53,5 @@ export async function mcp(options = {}) {
53
53
  console.log(chalk.dim(' Add this to your Claude / Cursor MCP settings:\n'));
54
54
  console.log(chalk.white(JSON.stringify(mcpConfig, null, 2)));
55
55
  console.log('');
56
- console.log(chalk.dim(' Or use the MCP URL directly:'));
57
- console.log(chalk.cyan(` ${serverUrl}/mcp`));
58
- console.log(chalk.dim(` Authorization: Bearer ${relayKey}\n`));
56
+ console.log(chalk.dim(' The JSON above contains your MCP URL and authorization header.\n'));
59
57
  }
package/src/server.js CHANGED
@@ -39,8 +39,7 @@ export async function startServer(port, serverUrl, token) {
39
39
  const server = app.listen(port, async () => {
40
40
  const url = `http://localhost:${port}?token=${encodeURIComponent(token)}`;
41
41
  console.log(chalk.green(`\n Local server running at ${chalk.bold(`http://localhost:${port}`)}`));
42
- console.log(chalk.dim(` Proxying API ${serverUrl}`));
43
- console.log(chalk.dim(' Press Ctrl+C to stop.\n'));
42
+ console.log(chalk.dim(' API proxy active. Press Ctrl+C to stop.\n'));
44
43
  await open(url);
45
44
  resolve(server);
46
45
  });