ssh-to-code 1.0.0__tar.gz → 1.0.1__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ssh-to-code
3
- Version: 1.0.0
3
+ Version: 1.0.1
4
4
  Summary: Terminal-based SSH directory browser with VS Code integration
5
5
  Author-email: Rajesh <rajesh-cs18@users.noreply.github.com>
6
6
  License-Expression: MIT
@@ -33,7 +33,7 @@ Dynamic: license-file
33
33
 
34
34
  # SSH Directory Browser
35
35
 
36
- A terminal-based directory browser that lets you SSH into a remote server, navigate through directories interactively, and open selected directories directly in VS Code using the Remote-SSH extension.
36
+ A terminal-based directory browser that lets you SSH into a remote server, navigate through directories interactively, and open selected directories or `.code-workspace` files directly in VS Code using the Remote-SSH extension.
37
37
 
38
38
  ![Terminal UI](https://img.shields.io/badge/Terminal-Based-blue)
39
39
  ![Python](https://img.shields.io/badge/Python-3.7+-green)
@@ -46,6 +46,7 @@ A terminal-based directory browser that lets you SSH into a remote server, navig
46
46
  - 🔐 **Secure SSH Connection** - Support for key-based and password authentication
47
47
  - 📂 **Visual File Browser** - Clear indicators for directories, files, executables, and symlinks
48
48
  - 💻 **VS Code Integration** - Open any remote directory directly in VS Code with one keystroke
49
+ - 🧩 **Workspace File Support** - Open remote `.code-workspace` files directly in VS Code
49
50
  - ⚙️ **Configuration Management** - Save frequently used SSH hosts for quick access
50
51
  - 🎨 **Keyboard Navigation** - Fast and efficient navigation using arrow keys
51
52
 
@@ -57,14 +58,27 @@ A terminal-based directory browser that lets you SSH into a remote server, navig
57
58
 
58
59
  ## Installation
59
60
 
60
- ### 1. Clone the repository
61
+ ### 1. Install from PyPI (recommended)
62
+
63
+ ```bash
64
+ pip install ssh-to-code
65
+ ```
66
+
67
+ ### 2. Verify CLI installation
68
+
69
+ ```bash
70
+ ssh-browse --help
71
+ ```
72
+
73
+ ### 3. (Optional) Install from source for development
61
74
 
62
75
  ```bash
63
76
  git clone <repository-url>
64
77
  cd ssh-to-code
78
+ pip install -e .
65
79
  ```
66
80
 
67
- ### 2. Install Python dependencies
81
+ ### 4. (Source install only) Install dependencies manually
68
82
 
69
83
  ```bash
70
84
  pip install paramiko
@@ -76,13 +90,13 @@ Or use the provided requirements file:
76
90
  pip install -r requirements.txt
77
91
  ```
78
92
 
79
- ### 3. Make the script executable
93
+ ### 5. (Source install only) Make the script executable
80
94
 
81
95
  ```bash
82
96
  chmod +x ssh_dir_browser.py
83
97
  ```
84
98
 
85
- ### 4. (Optional) Add to PATH
99
+ ### 6. (Optional, source install only) Add to PATH
86
100
 
87
101
  For easy access from anywhere:
88
102
 
@@ -101,42 +115,41 @@ sudo ln -s /path/to/ssh-to-code/ssh_dir_browser.py /usr/local/bin/ssh-browse
101
115
  Connect to a remote server and start browsing:
102
116
 
103
117
  ```bash
104
- # Option 1: Use the wrapper script (automatically activates venv)
105
- ./ssh-browse user@hostname
118
+ # Installed from PyPI or pip install -e .
119
+ ssh-browse user@hostname
106
120
 
107
- # Option 2: Activate venv manually
108
- source venv/bin/activate
121
+ # If running directly from source without install:
109
122
  python ssh_dir_browser.py user@hostname
110
123
  ```
111
124
 
112
125
  ### With Custom Port
113
126
 
114
127
  ```bash
115
- ./ssh-browse user@hostname -p 2222
128
+ ssh-browse user@hostname -p 2222
116
129
  ```
117
130
 
118
131
  ### With SSH Key
119
132
 
120
133
  ```bash
121
- ./ssh-browse user@hostname -i ~/.ssh/my_key
134
+ ssh-browse user@hostname -i ~/.ssh/my_key
122
135
  ```
123
136
 
124
137
  ### Start in Specific Directory
125
138
 
126
139
  ```bash
127
- ./ssh-browse user@hostname --start-path /var/www
140
+ ssh-browse user@hostname --start-path /var/www
128
141
  ```
129
142
 
130
143
  ### Password Authentication
131
144
 
132
145
  ```bash
133
- ./ssh-browse user@hostname --password
146
+ ssh-browse user@hostname --password
134
147
  ```
135
148
 
136
149
  ### AWS EC2 Example
137
150
 
138
151
  ```bash
139
- ./ssh-browse ubuntu@ec2-12-34-56-78.compute.amazonaws.com -i ~/Downloads/aws-key.pem
152
+ ssh-browse ubuntu@ec2-12-34-56-78.compute.amazonaws.com -i ~/Downloads/aws-key.pem
140
153
  ```
141
154
 
142
155
  ## Usage
@@ -147,7 +160,7 @@ python ssh_dir_browser.py user@hostname
147
160
  |-----|--------|
148
161
  | `↑` / `↓` | Navigate up/down |
149
162
  | `Enter` | Open directory |
150
- | `o` | Open current directory in VS Code |
163
+ | `o` | Open current directory, or selected `.code-workspace` file, in VS Code |
151
164
  | `n` | Create new folder |
152
165
  | `h` | Go to home directory |
153
166
  | `r` | Refresh directory listing |
@@ -160,14 +173,15 @@ python ssh_dir_browser.py user@hostname
160
173
  3. Select `..` to go to parent directory
161
174
  4. Press `n` to create a new folder in the current directory
162
175
  5. Press `r` to refresh the directory contents
163
- 6. Press `o` when you want to open the current directory in VS Code
176
+ 6. Press `o` to open the current directory in VS Code
177
+ 7. Select a `.code-workspace` file and press `o` to open that workspace in VS Code
164
178
 
165
179
  ### VS Code Integration
166
180
 
167
181
  When you press `o`, the application will:
168
182
  1. Open VS Code
169
183
  2. Connect to the remote server via Remote-SSH
170
- 3. Open the selected directory
184
+ 3. Open the current directory, or the selected `.code-workspace` file
171
185
  4. Exit the browser
172
186
 
173
187
  Make sure you have:
@@ -311,7 +325,7 @@ Install it from VS Code:
311
325
  Install the required dependency:
312
326
 
313
327
  ```bash
314
- pip install paramiko
328
+ pip install ssh-to-code
315
329
  ```
316
330
 
317
331
  ## Advanced Features
@@ -1,6 +1,6 @@
1
1
  # SSH Directory Browser
2
2
 
3
- A terminal-based directory browser that lets you SSH into a remote server, navigate through directories interactively, and open selected directories directly in VS Code using the Remote-SSH extension.
3
+ A terminal-based directory browser that lets you SSH into a remote server, navigate through directories interactively, and open selected directories or `.code-workspace` files directly in VS Code using the Remote-SSH extension.
4
4
 
5
5
  ![Terminal UI](https://img.shields.io/badge/Terminal-Based-blue)
6
6
  ![Python](https://img.shields.io/badge/Python-3.7+-green)
@@ -13,6 +13,7 @@ A terminal-based directory browser that lets you SSH into a remote server, navig
13
13
  - 🔐 **Secure SSH Connection** - Support for key-based and password authentication
14
14
  - 📂 **Visual File Browser** - Clear indicators for directories, files, executables, and symlinks
15
15
  - 💻 **VS Code Integration** - Open any remote directory directly in VS Code with one keystroke
16
+ - 🧩 **Workspace File Support** - Open remote `.code-workspace` files directly in VS Code
16
17
  - ⚙️ **Configuration Management** - Save frequently used SSH hosts for quick access
17
18
  - 🎨 **Keyboard Navigation** - Fast and efficient navigation using arrow keys
18
19
 
@@ -24,14 +25,27 @@ A terminal-based directory browser that lets you SSH into a remote server, navig
24
25
 
25
26
  ## Installation
26
27
 
27
- ### 1. Clone the repository
28
+ ### 1. Install from PyPI (recommended)
29
+
30
+ ```bash
31
+ pip install ssh-to-code
32
+ ```
33
+
34
+ ### 2. Verify CLI installation
35
+
36
+ ```bash
37
+ ssh-browse --help
38
+ ```
39
+
40
+ ### 3. (Optional) Install from source for development
28
41
 
29
42
  ```bash
30
43
  git clone <repository-url>
31
44
  cd ssh-to-code
45
+ pip install -e .
32
46
  ```
33
47
 
34
- ### 2. Install Python dependencies
48
+ ### 4. (Source install only) Install dependencies manually
35
49
 
36
50
  ```bash
37
51
  pip install paramiko
@@ -43,13 +57,13 @@ Or use the provided requirements file:
43
57
  pip install -r requirements.txt
44
58
  ```
45
59
 
46
- ### 3. Make the script executable
60
+ ### 5. (Source install only) Make the script executable
47
61
 
48
62
  ```bash
49
63
  chmod +x ssh_dir_browser.py
50
64
  ```
51
65
 
52
- ### 4. (Optional) Add to PATH
66
+ ### 6. (Optional, source install only) Add to PATH
53
67
 
54
68
  For easy access from anywhere:
55
69
 
@@ -68,42 +82,41 @@ sudo ln -s /path/to/ssh-to-code/ssh_dir_browser.py /usr/local/bin/ssh-browse
68
82
  Connect to a remote server and start browsing:
69
83
 
70
84
  ```bash
71
- # Option 1: Use the wrapper script (automatically activates venv)
72
- ./ssh-browse user@hostname
85
+ # Installed from PyPI or pip install -e .
86
+ ssh-browse user@hostname
73
87
 
74
- # Option 2: Activate venv manually
75
- source venv/bin/activate
88
+ # If running directly from source without install:
76
89
  python ssh_dir_browser.py user@hostname
77
90
  ```
78
91
 
79
92
  ### With Custom Port
80
93
 
81
94
  ```bash
82
- ./ssh-browse user@hostname -p 2222
95
+ ssh-browse user@hostname -p 2222
83
96
  ```
84
97
 
85
98
  ### With SSH Key
86
99
 
87
100
  ```bash
88
- ./ssh-browse user@hostname -i ~/.ssh/my_key
101
+ ssh-browse user@hostname -i ~/.ssh/my_key
89
102
  ```
90
103
 
91
104
  ### Start in Specific Directory
92
105
 
93
106
  ```bash
94
- ./ssh-browse user@hostname --start-path /var/www
107
+ ssh-browse user@hostname --start-path /var/www
95
108
  ```
96
109
 
97
110
  ### Password Authentication
98
111
 
99
112
  ```bash
100
- ./ssh-browse user@hostname --password
113
+ ssh-browse user@hostname --password
101
114
  ```
102
115
 
103
116
  ### AWS EC2 Example
104
117
 
105
118
  ```bash
106
- ./ssh-browse ubuntu@ec2-12-34-56-78.compute.amazonaws.com -i ~/Downloads/aws-key.pem
119
+ ssh-browse ubuntu@ec2-12-34-56-78.compute.amazonaws.com -i ~/Downloads/aws-key.pem
107
120
  ```
108
121
 
109
122
  ## Usage
@@ -114,7 +127,7 @@ python ssh_dir_browser.py user@hostname
114
127
  |-----|--------|
115
128
  | `↑` / `↓` | Navigate up/down |
116
129
  | `Enter` | Open directory |
117
- | `o` | Open current directory in VS Code |
130
+ | `o` | Open current directory, or selected `.code-workspace` file, in VS Code |
118
131
  | `n` | Create new folder |
119
132
  | `h` | Go to home directory |
120
133
  | `r` | Refresh directory listing |
@@ -127,14 +140,15 @@ python ssh_dir_browser.py user@hostname
127
140
  3. Select `..` to go to parent directory
128
141
  4. Press `n` to create a new folder in the current directory
129
142
  5. Press `r` to refresh the directory contents
130
- 6. Press `o` when you want to open the current directory in VS Code
143
+ 6. Press `o` to open the current directory in VS Code
144
+ 7. Select a `.code-workspace` file and press `o` to open that workspace in VS Code
131
145
 
132
146
  ### VS Code Integration
133
147
 
134
148
  When you press `o`, the application will:
135
149
  1. Open VS Code
136
150
  2. Connect to the remote server via Remote-SSH
137
- 3. Open the selected directory
151
+ 3. Open the current directory, or the selected `.code-workspace` file
138
152
  4. Exit the browser
139
153
 
140
154
  Make sure you have:
@@ -278,7 +292,7 @@ Install it from VS Code:
278
292
  Install the required dependency:
279
293
 
280
294
  ```bash
281
- pip install paramiko
295
+ pip install ssh-to-code
282
296
  ```
283
297
 
284
298
  ## Advanced Features
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ssh-to-code"
7
- version = "1.0.0"
7
+ version = "1.0.1"
8
8
  description = "Terminal-based SSH directory browser with VS Code integration"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.7"
@@ -122,20 +122,30 @@ class DirectoryBrowser:
122
122
  host = self.ssh_handler.hostname
123
123
  user = self.ssh_handler.username
124
124
  port = self.ssh_handler.port
125
-
126
- # VS Code Remote-SSH URI format
127
- # vscode://vscode-remote/ssh-remote+user@host:port/path
128
- remote_uri = f"vscode://vscode-remote/ssh-remote+{user}@{host}"
125
+
126
+ # By default open the current directory. If a .code-workspace file is
127
+ # selected, open that workspace file instead.
128
+ target_path = self.current_path
129
+ target_label = "directory"
130
+ if self.items and 0 <= self.selected_index < len(self.items):
131
+ selected_name, selected_type = self.items[self.selected_index]
132
+ if selected_type == "file" and selected_name.endswith('.code-workspace'):
133
+ target_path = os.path.join(self.current_path, selected_name)
134
+ target_label = "workspace"
135
+
136
+ ssh_target = f"{user}@{host}"
129
137
  if port != 22:
130
- remote_uri += f":{port}"
131
- remote_uri += self.current_path
132
-
138
+ ssh_target += f":{port}"
139
+
133
140
  # Open VS Code
134
- subprocess.Popen(['code', '--remote', f'ssh-remote+{user}@{host}', self.current_path],
141
+ subprocess.Popen(['code', '--remote', f'ssh-remote+{ssh_target}', target_path],
135
142
  stdout=subprocess.DEVNULL,
136
143
  stderr=subprocess.DEVNULL)
137
-
138
- return True, f"Opening {self.current_path} in VS Code..."
144
+
145
+ if target_label == "workspace":
146
+ return True, f"Opening workspace {target_path} in VS Code..."
147
+
148
+ return True, f"Opening {target_path} in VS Code..."
139
149
  except Exception as e:
140
150
  return False, f"Error opening VS Code: {str(e)}"
141
151
 
@@ -153,7 +163,7 @@ class DirectoryBrowser:
153
163
  stdscr.addstr(1, 0, path_line[:width-1], curses.A_BOLD)
154
164
 
155
165
  # Help line
156
- help_text = "↑/↓: Navigate | Enter: Open | 'o': VS Code | 'n': New Folder | 'r': Refresh | 'q': Quit"
166
+ help_text = "↑/↓: Navigate | Enter: Open | 'o': VS Code (dir/.code-workspace) | 'n': New Folder | 'r': Refresh | 'q': Quit"
157
167
  stdscr.addstr(2, 0, help_text[:width-1], curses.A_DIM)
158
168
 
159
169
  # Separator
@@ -183,6 +193,9 @@ class DirectoryBrowser:
183
193
  elif item_type == "link":
184
194
  display = f"🔗 {name}@"
185
195
  attr = curses.A_DIM
196
+ elif name.endswith('.code-workspace'):
197
+ display = f"🧩 {name}"
198
+ attr = curses.A_NORMAL
186
199
  else:
187
200
  display = f"📄 {name}"
188
201
  attr = curses.A_NORMAL
@@ -246,7 +259,10 @@ class DirectoryBrowser:
246
259
  self.navigate_to(name)
247
260
  self.status_message = ""
248
261
  else:
249
- self.status_message = f"'{name}' is not a directory"
262
+ if name.endswith('.code-workspace'):
263
+ self.status_message = f"Select 'o' to open workspace: {name}"
264
+ else:
265
+ self.status_message = f"'{name}' is not a directory"
250
266
  elif key == ord('o') or key == ord('O'):
251
267
  # Open in VS Code
252
268
  success, message = self.open_in_vscode()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ssh-to-code
3
- Version: 1.0.0
3
+ Version: 1.0.1
4
4
  Summary: Terminal-based SSH directory browser with VS Code integration
5
5
  Author-email: Rajesh <rajesh-cs18@users.noreply.github.com>
6
6
  License-Expression: MIT
@@ -33,7 +33,7 @@ Dynamic: license-file
33
33
 
34
34
  # SSH Directory Browser
35
35
 
36
- A terminal-based directory browser that lets you SSH into a remote server, navigate through directories interactively, and open selected directories directly in VS Code using the Remote-SSH extension.
36
+ A terminal-based directory browser that lets you SSH into a remote server, navigate through directories interactively, and open selected directories or `.code-workspace` files directly in VS Code using the Remote-SSH extension.
37
37
 
38
38
  ![Terminal UI](https://img.shields.io/badge/Terminal-Based-blue)
39
39
  ![Python](https://img.shields.io/badge/Python-3.7+-green)
@@ -46,6 +46,7 @@ A terminal-based directory browser that lets you SSH into a remote server, navig
46
46
  - 🔐 **Secure SSH Connection** - Support for key-based and password authentication
47
47
  - 📂 **Visual File Browser** - Clear indicators for directories, files, executables, and symlinks
48
48
  - 💻 **VS Code Integration** - Open any remote directory directly in VS Code with one keystroke
49
+ - 🧩 **Workspace File Support** - Open remote `.code-workspace` files directly in VS Code
49
50
  - ⚙️ **Configuration Management** - Save frequently used SSH hosts for quick access
50
51
  - 🎨 **Keyboard Navigation** - Fast and efficient navigation using arrow keys
51
52
 
@@ -57,14 +58,27 @@ A terminal-based directory browser that lets you SSH into a remote server, navig
57
58
 
58
59
  ## Installation
59
60
 
60
- ### 1. Clone the repository
61
+ ### 1. Install from PyPI (recommended)
62
+
63
+ ```bash
64
+ pip install ssh-to-code
65
+ ```
66
+
67
+ ### 2. Verify CLI installation
68
+
69
+ ```bash
70
+ ssh-browse --help
71
+ ```
72
+
73
+ ### 3. (Optional) Install from source for development
61
74
 
62
75
  ```bash
63
76
  git clone <repository-url>
64
77
  cd ssh-to-code
78
+ pip install -e .
65
79
  ```
66
80
 
67
- ### 2. Install Python dependencies
81
+ ### 4. (Source install only) Install dependencies manually
68
82
 
69
83
  ```bash
70
84
  pip install paramiko
@@ -76,13 +90,13 @@ Or use the provided requirements file:
76
90
  pip install -r requirements.txt
77
91
  ```
78
92
 
79
- ### 3. Make the script executable
93
+ ### 5. (Source install only) Make the script executable
80
94
 
81
95
  ```bash
82
96
  chmod +x ssh_dir_browser.py
83
97
  ```
84
98
 
85
- ### 4. (Optional) Add to PATH
99
+ ### 6. (Optional, source install only) Add to PATH
86
100
 
87
101
  For easy access from anywhere:
88
102
 
@@ -101,42 +115,41 @@ sudo ln -s /path/to/ssh-to-code/ssh_dir_browser.py /usr/local/bin/ssh-browse
101
115
  Connect to a remote server and start browsing:
102
116
 
103
117
  ```bash
104
- # Option 1: Use the wrapper script (automatically activates venv)
105
- ./ssh-browse user@hostname
118
+ # Installed from PyPI or pip install -e .
119
+ ssh-browse user@hostname
106
120
 
107
- # Option 2: Activate venv manually
108
- source venv/bin/activate
121
+ # If running directly from source without install:
109
122
  python ssh_dir_browser.py user@hostname
110
123
  ```
111
124
 
112
125
  ### With Custom Port
113
126
 
114
127
  ```bash
115
- ./ssh-browse user@hostname -p 2222
128
+ ssh-browse user@hostname -p 2222
116
129
  ```
117
130
 
118
131
  ### With SSH Key
119
132
 
120
133
  ```bash
121
- ./ssh-browse user@hostname -i ~/.ssh/my_key
134
+ ssh-browse user@hostname -i ~/.ssh/my_key
122
135
  ```
123
136
 
124
137
  ### Start in Specific Directory
125
138
 
126
139
  ```bash
127
- ./ssh-browse user@hostname --start-path /var/www
140
+ ssh-browse user@hostname --start-path /var/www
128
141
  ```
129
142
 
130
143
  ### Password Authentication
131
144
 
132
145
  ```bash
133
- ./ssh-browse user@hostname --password
146
+ ssh-browse user@hostname --password
134
147
  ```
135
148
 
136
149
  ### AWS EC2 Example
137
150
 
138
151
  ```bash
139
- ./ssh-browse ubuntu@ec2-12-34-56-78.compute.amazonaws.com -i ~/Downloads/aws-key.pem
152
+ ssh-browse ubuntu@ec2-12-34-56-78.compute.amazonaws.com -i ~/Downloads/aws-key.pem
140
153
  ```
141
154
 
142
155
  ## Usage
@@ -147,7 +160,7 @@ python ssh_dir_browser.py user@hostname
147
160
  |-----|--------|
148
161
  | `↑` / `↓` | Navigate up/down |
149
162
  | `Enter` | Open directory |
150
- | `o` | Open current directory in VS Code |
163
+ | `o` | Open current directory, or selected `.code-workspace` file, in VS Code |
151
164
  | `n` | Create new folder |
152
165
  | `h` | Go to home directory |
153
166
  | `r` | Refresh directory listing |
@@ -160,14 +173,15 @@ python ssh_dir_browser.py user@hostname
160
173
  3. Select `..` to go to parent directory
161
174
  4. Press `n` to create a new folder in the current directory
162
175
  5. Press `r` to refresh the directory contents
163
- 6. Press `o` when you want to open the current directory in VS Code
176
+ 6. Press `o` to open the current directory in VS Code
177
+ 7. Select a `.code-workspace` file and press `o` to open that workspace in VS Code
164
178
 
165
179
  ### VS Code Integration
166
180
 
167
181
  When you press `o`, the application will:
168
182
  1. Open VS Code
169
183
  2. Connect to the remote server via Remote-SSH
170
- 3. Open the selected directory
184
+ 3. Open the current directory, or the selected `.code-workspace` file
171
185
  4. Exit the browser
172
186
 
173
187
  Make sure you have:
@@ -311,7 +325,7 @@ Install it from VS Code:
311
325
  Install the required dependency:
312
326
 
313
327
  ```bash
314
- pip install paramiko
328
+ pip install ssh-to-code
315
329
  ```
316
330
 
317
331
  ## Advanced Features
File without changes
File without changes
File without changes
File without changes