lazyssh 1.0.0__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.
- lazyssh-1.0.0/LICENSE +21 -0
- lazyssh-1.0.0/MANIFEST.in +19 -0
- lazyssh-1.0.0/PKG-INFO +291 -0
- lazyssh-1.0.0/README.md +238 -0
- lazyssh-1.0.0/lazyssh.png +0 -0
- lazyssh-1.0.0/pyproject.toml +90 -0
- lazyssh-1.0.0/requirements.txt +11 -0
- lazyssh-1.0.0/setup.cfg +4 -0
- lazyssh-1.0.0/setup.py +73 -0
- lazyssh-1.0.0/src/lazyssh/__init__.py +56 -0
- lazyssh-1.0.0/src/lazyssh/__main__.py +458 -0
- lazyssh-1.0.0/src/lazyssh/command_mode.py +621 -0
- lazyssh-1.0.0/src/lazyssh/config.py +14 -0
- lazyssh-1.0.0/src/lazyssh/models.py +66 -0
- lazyssh-1.0.0/src/lazyssh/ssh.py +246 -0
- lazyssh-1.0.0/src/lazyssh/ui.py +137 -0
- lazyssh-1.0.0/src/lazyssh.egg-info/PKG-INFO +291 -0
- lazyssh-1.0.0/src/lazyssh.egg-info/SOURCES.txt +21 -0
- lazyssh-1.0.0/src/lazyssh.egg-info/dependency_links.txt +1 -0
- lazyssh-1.0.0/src/lazyssh.egg-info/entry_points.txt +2 -0
- lazyssh-1.0.0/src/lazyssh.egg-info/requires.txt +20 -0
- lazyssh-1.0.0/src/lazyssh.egg-info/top_level.txt +1 -0
- lazyssh-1.0.0/tests/test_basic.py +72 -0
lazyssh-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Bochner
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
include LICENSE
|
|
2
|
+
include README.md
|
|
3
|
+
include requirements.txt
|
|
4
|
+
include pyproject.toml
|
|
5
|
+
include lazyssh.png
|
|
6
|
+
|
|
7
|
+
recursive-include src *.py
|
|
8
|
+
recursive-include tests *.py
|
|
9
|
+
|
|
10
|
+
exclude .github
|
|
11
|
+
exclude .gitignore
|
|
12
|
+
exclude .pre-commit-config.yaml
|
|
13
|
+
exclude Makefile
|
|
14
|
+
exclude test_env
|
|
15
|
+
exclude docs
|
|
16
|
+
|
|
17
|
+
recursive-exclude .github *
|
|
18
|
+
recursive-exclude docs *
|
|
19
|
+
recursive-exclude test_env *
|
lazyssh-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: lazyssh
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A comprehensive SSH toolkit for managing connections and tunnels
|
|
5
|
+
Home-page: https://github.com/Bochner/lazyssh
|
|
6
|
+
Author: Bochner
|
|
7
|
+
Author-email: Bochner <lazyssh@example.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://github.com/Bochner/lazyssh
|
|
10
|
+
Project-URL: Bug Tracker, https://github.com/Bochner/lazyssh/issues
|
|
11
|
+
Project-URL: Documentation, https://github.com/Bochner/lazyssh
|
|
12
|
+
Project-URL: Source Code, https://github.com/Bochner/lazyssh
|
|
13
|
+
Keywords: ssh,tunnel,proxy,socks,terminal,connection,management
|
|
14
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
15
|
+
Classifier: Intended Audience :: System Administrators
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
24
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
25
|
+
Classifier: Environment :: Console
|
|
26
|
+
Classifier: Topic :: System :: Networking
|
|
27
|
+
Classifier: Topic :: System :: Systems Administration
|
|
28
|
+
Requires-Python: >=3.7
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
Requires-Dist: colorama>=0.4.6
|
|
32
|
+
Requires-Dist: rich>=13.0.0
|
|
33
|
+
Requires-Dist: click>=8.0.0
|
|
34
|
+
Requires-Dist: pexpect>=4.8.0
|
|
35
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
36
|
+
Requires-Dist: prompt_toolkit<3.1.0,>=3.0.39
|
|
37
|
+
Requires-Dist: wcwidth>=0.2.5
|
|
38
|
+
Requires-Dist: art>=5.9
|
|
39
|
+
Provides-Extra: dev
|
|
40
|
+
Requires-Dist: black; extra == "dev"
|
|
41
|
+
Requires-Dist: isort; extra == "dev"
|
|
42
|
+
Requires-Dist: pylint; extra == "dev"
|
|
43
|
+
Requires-Dist: pytest; extra == "dev"
|
|
44
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
45
|
+
Requires-Dist: mypy; extra == "dev"
|
|
46
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
47
|
+
Requires-Dist: build; extra == "dev"
|
|
48
|
+
Requires-Dist: wheel; extra == "dev"
|
|
49
|
+
Requires-Dist: twine; extra == "dev"
|
|
50
|
+
Dynamic: author
|
|
51
|
+
Dynamic: home-page
|
|
52
|
+
Dynamic: requires-python
|
|
53
|
+
|
|
54
|
+
# LazySSH
|
|
55
|
+
|
|
56
|
+
A comprehensive SSH toolkit for managing connections, tunnels, and remote sessions with a modern CLI interface.
|
|
57
|
+
|
|
58
|
+

|
|
59
|
+
|
|
60
|
+
## Features
|
|
61
|
+
|
|
62
|
+
- Dual interface modes:
|
|
63
|
+
- Interactive menu mode
|
|
64
|
+
- Command mode with smart tab completion
|
|
65
|
+
- Multiple SSH connection management
|
|
66
|
+
- Forward and reverse tunnel creation
|
|
67
|
+
- Dynamic port forwarding with SOCKS proxy support
|
|
68
|
+
- Control socket management
|
|
69
|
+
- Terminal session management with Terminator
|
|
70
|
+
- Automatic connection cleanup on exit
|
|
71
|
+
- Real-time status display of connections and tunnels
|
|
72
|
+
- Full visibility of SSH commands being executed
|
|
73
|
+
|
|
74
|
+
## Requirements
|
|
75
|
+
|
|
76
|
+
- Python 3.7+
|
|
77
|
+
- OpenSSH client
|
|
78
|
+
- Terminator terminal emulator
|
|
79
|
+
|
|
80
|
+
## Installation
|
|
81
|
+
|
|
82
|
+
LazySSH can be installed using standard Python packaging tools:
|
|
83
|
+
|
|
84
|
+
### Option 1: Install with pip (Recommended)
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Install globally
|
|
88
|
+
pip install lazyssh
|
|
89
|
+
|
|
90
|
+
# Or install for the current user only
|
|
91
|
+
pip install --user lazyssh
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Option 2: Install from repository
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Clone the repository
|
|
98
|
+
git clone https://github.com/Bochner/lazyssh.git
|
|
99
|
+
cd lazyssh
|
|
100
|
+
|
|
101
|
+
# Install
|
|
102
|
+
pip install .
|
|
103
|
+
|
|
104
|
+
# Or for development mode
|
|
105
|
+
pip install -e .
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Usage
|
|
109
|
+
|
|
110
|
+
LazySSH has two interface modes:
|
|
111
|
+
|
|
112
|
+
### Command Mode (Default)
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# Start LazySSH in command mode
|
|
116
|
+
lazyssh
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
In command mode, you can use the following commands:
|
|
120
|
+
- `lazyssh` - Create a new SSH connection
|
|
121
|
+
- Basic usage: `lazyssh -ip <ip> -port <port> -user <username> -socket <n>`
|
|
122
|
+
- With dynamic proxy: `lazyssh -ip <ip> -port <port> -user <username> -socket <n> -proxy [port]`
|
|
123
|
+
- `tunc` - Create a new tunnel (forward or reverse)
|
|
124
|
+
- Example (forward): `tunc ubuntu l 8080 localhost 80`
|
|
125
|
+
- Example (reverse): `tunc ubuntu r 3000 127.0.0.1 3000`
|
|
126
|
+
- `tund` - Delete a tunnel by ID
|
|
127
|
+
- Example: `tund 1`
|
|
128
|
+
- `list` - List connections and tunnels
|
|
129
|
+
- `term` - Open a terminal for a connection
|
|
130
|
+
- Example: `term ubuntu`
|
|
131
|
+
- `close` - Close a connection
|
|
132
|
+
- `mode` - Switch to prompt mode
|
|
133
|
+
- `help` - Show help
|
|
134
|
+
- `exit` - Exit LazySSH
|
|
135
|
+
|
|
136
|
+
#### Dynamic SOCKS Proxy
|
|
137
|
+
|
|
138
|
+
To create a dynamic SOCKS proxy when establishing an SSH connection:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# Create connection with dynamic proxy on default port (1080)
|
|
142
|
+
lazyssh -ip 192.168.1.100 -port 22 -user admin -socket myserver -proxy
|
|
143
|
+
|
|
144
|
+
# Create connection with dynamic proxy on custom port
|
|
145
|
+
lazyssh -ip 192.168.1.100 -port 22 -user admin -socket myserver -proxy 8080
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
You can then configure your applications to use the SOCKS proxy at `localhost:1080` (or your custom port).
|
|
149
|
+
|
|
150
|
+
### Prompt Mode
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Start LazySSH in prompt mode
|
|
154
|
+
lazyssh --prompt
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
In prompt mode, you'll see a menu with numbered options:
|
|
158
|
+
1. Create new SSH connection (with optional SOCKS proxy)
|
|
159
|
+
2. Destroy tunnel
|
|
160
|
+
3. Create tunnel
|
|
161
|
+
4. Open terminal
|
|
162
|
+
5. Close connection
|
|
163
|
+
6. Switch to command mode
|
|
164
|
+
7. Exit
|
|
165
|
+
|
|
166
|
+
## Troubleshooting
|
|
167
|
+
|
|
168
|
+
### Command Not Found
|
|
169
|
+
|
|
170
|
+
If you installed with `pip install --user` and get "command not found":
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
# Add to your PATH manually
|
|
174
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
175
|
+
|
|
176
|
+
# To make it permanent, add this line to your ~/.bashrc file
|
|
177
|
+
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
|
|
178
|
+
source ~/.bashrc
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Missing Dependencies
|
|
182
|
+
|
|
183
|
+
If you're missing any dependencies:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Install Terminator (Ubuntu/Debian)
|
|
187
|
+
sudo apt install terminator
|
|
188
|
+
|
|
189
|
+
# Install Terminator (Fedora)
|
|
190
|
+
sudo dnf install terminator
|
|
191
|
+
|
|
192
|
+
# Install Terminator (RHEL/CentOS)
|
|
193
|
+
sudo yum install terminator
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Development
|
|
197
|
+
|
|
198
|
+
### Project Structure
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
lazyssh/
|
|
202
|
+
├── src/ # Source code
|
|
203
|
+
│ └── lazyssh/ # Main package
|
|
204
|
+
├── tests/ # Test suite
|
|
205
|
+
├── docs/ # Documentation
|
|
206
|
+
├── pyproject.toml # Project configuration
|
|
207
|
+
├── setup.py # Package installation
|
|
208
|
+
├── Makefile # Development tasks
|
|
209
|
+
├── pre-commit-check.sh # Script to run all CI checks locally
|
|
210
|
+
└── .pre-commit-config.yaml # Code quality hooks
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Setup Development Environment
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
# Clone the repository
|
|
217
|
+
git clone https://github.com/Bochner/lazyssh.git
|
|
218
|
+
cd lazyssh
|
|
219
|
+
|
|
220
|
+
# Install dev dependencies
|
|
221
|
+
pip install -e ".[dev]"
|
|
222
|
+
|
|
223
|
+
# Install pre-commit hooks
|
|
224
|
+
pip install pre-commit
|
|
225
|
+
pre-commit install
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Running CI Checks Locally
|
|
229
|
+
|
|
230
|
+
Before committing your code, you can run all the CI checks locally using the provided script:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
# Make the script executable (first time only)
|
|
234
|
+
chmod +x pre-commit-check.sh
|
|
235
|
+
|
|
236
|
+
# Run all checks in a virtual environment
|
|
237
|
+
./pre-commit-check.sh
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
This script:
|
|
241
|
+
- Creates a temporary virtual environment (`.pre-commit-venv`)
|
|
242
|
+
- Installs all development dependencies
|
|
243
|
+
- Runs the following checks:
|
|
244
|
+
- Black formatting
|
|
245
|
+
- isort import sorting
|
|
246
|
+
- flake8 linting
|
|
247
|
+
- mypy type checking
|
|
248
|
+
- pytest (if test files exist)
|
|
249
|
+
- Package building
|
|
250
|
+
- Package verification with twine
|
|
251
|
+
- Cleans up the repository by removing:
|
|
252
|
+
- The temporary virtual environment
|
|
253
|
+
- Python cache files
|
|
254
|
+
- Build artifacts
|
|
255
|
+
- Test artifacts
|
|
256
|
+
|
|
257
|
+
The script is designed to be robust and will clean up after itself even if errors occur. It requires Python 3 to be installed on your system.
|
|
258
|
+
|
|
259
|
+
This ensures your code passes all CI checks and your repository is clean before committing.
|
|
260
|
+
|
|
261
|
+
### Common Development Tasks
|
|
262
|
+
|
|
263
|
+
We provide a Makefile for common tasks:
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
# Install in development mode
|
|
267
|
+
make install
|
|
268
|
+
|
|
269
|
+
# Run tests
|
|
270
|
+
make test
|
|
271
|
+
|
|
272
|
+
# Format code (black and isort)
|
|
273
|
+
make fmt
|
|
274
|
+
|
|
275
|
+
# Lint code
|
|
276
|
+
make lint
|
|
277
|
+
|
|
278
|
+
# Build package
|
|
279
|
+
make build
|
|
280
|
+
|
|
281
|
+
# Create distribution
|
|
282
|
+
make dist
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
## License
|
|
286
|
+
|
|
287
|
+
MIT License
|
|
288
|
+
|
|
289
|
+
## Contributing
|
|
290
|
+
|
|
291
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
lazyssh-1.0.0/README.md
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# LazySSH
|
|
2
|
+
|
|
3
|
+
A comprehensive SSH toolkit for managing connections, tunnels, and remote sessions with a modern CLI interface.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Dual interface modes:
|
|
10
|
+
- Interactive menu mode
|
|
11
|
+
- Command mode with smart tab completion
|
|
12
|
+
- Multiple SSH connection management
|
|
13
|
+
- Forward and reverse tunnel creation
|
|
14
|
+
- Dynamic port forwarding with SOCKS proxy support
|
|
15
|
+
- Control socket management
|
|
16
|
+
- Terminal session management with Terminator
|
|
17
|
+
- Automatic connection cleanup on exit
|
|
18
|
+
- Real-time status display of connections and tunnels
|
|
19
|
+
- Full visibility of SSH commands being executed
|
|
20
|
+
|
|
21
|
+
## Requirements
|
|
22
|
+
|
|
23
|
+
- Python 3.7+
|
|
24
|
+
- OpenSSH client
|
|
25
|
+
- Terminator terminal emulator
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
LazySSH can be installed using standard Python packaging tools:
|
|
30
|
+
|
|
31
|
+
### Option 1: Install with pip (Recommended)
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Install globally
|
|
35
|
+
pip install lazyssh
|
|
36
|
+
|
|
37
|
+
# Or install for the current user only
|
|
38
|
+
pip install --user lazyssh
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Option 2: Install from repository
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Clone the repository
|
|
45
|
+
git clone https://github.com/Bochner/lazyssh.git
|
|
46
|
+
cd lazyssh
|
|
47
|
+
|
|
48
|
+
# Install
|
|
49
|
+
pip install .
|
|
50
|
+
|
|
51
|
+
# Or for development mode
|
|
52
|
+
pip install -e .
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Usage
|
|
56
|
+
|
|
57
|
+
LazySSH has two interface modes:
|
|
58
|
+
|
|
59
|
+
### Command Mode (Default)
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Start LazySSH in command mode
|
|
63
|
+
lazyssh
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
In command mode, you can use the following commands:
|
|
67
|
+
- `lazyssh` - Create a new SSH connection
|
|
68
|
+
- Basic usage: `lazyssh -ip <ip> -port <port> -user <username> -socket <n>`
|
|
69
|
+
- With dynamic proxy: `lazyssh -ip <ip> -port <port> -user <username> -socket <n> -proxy [port]`
|
|
70
|
+
- `tunc` - Create a new tunnel (forward or reverse)
|
|
71
|
+
- Example (forward): `tunc ubuntu l 8080 localhost 80`
|
|
72
|
+
- Example (reverse): `tunc ubuntu r 3000 127.0.0.1 3000`
|
|
73
|
+
- `tund` - Delete a tunnel by ID
|
|
74
|
+
- Example: `tund 1`
|
|
75
|
+
- `list` - List connections and tunnels
|
|
76
|
+
- `term` - Open a terminal for a connection
|
|
77
|
+
- Example: `term ubuntu`
|
|
78
|
+
- `close` - Close a connection
|
|
79
|
+
- `mode` - Switch to prompt mode
|
|
80
|
+
- `help` - Show help
|
|
81
|
+
- `exit` - Exit LazySSH
|
|
82
|
+
|
|
83
|
+
#### Dynamic SOCKS Proxy
|
|
84
|
+
|
|
85
|
+
To create a dynamic SOCKS proxy when establishing an SSH connection:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Create connection with dynamic proxy on default port (1080)
|
|
89
|
+
lazyssh -ip 192.168.1.100 -port 22 -user admin -socket myserver -proxy
|
|
90
|
+
|
|
91
|
+
# Create connection with dynamic proxy on custom port
|
|
92
|
+
lazyssh -ip 192.168.1.100 -port 22 -user admin -socket myserver -proxy 8080
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
You can then configure your applications to use the SOCKS proxy at `localhost:1080` (or your custom port).
|
|
96
|
+
|
|
97
|
+
### Prompt Mode
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# Start LazySSH in prompt mode
|
|
101
|
+
lazyssh --prompt
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
In prompt mode, you'll see a menu with numbered options:
|
|
105
|
+
1. Create new SSH connection (with optional SOCKS proxy)
|
|
106
|
+
2. Destroy tunnel
|
|
107
|
+
3. Create tunnel
|
|
108
|
+
4. Open terminal
|
|
109
|
+
5. Close connection
|
|
110
|
+
6. Switch to command mode
|
|
111
|
+
7. Exit
|
|
112
|
+
|
|
113
|
+
## Troubleshooting
|
|
114
|
+
|
|
115
|
+
### Command Not Found
|
|
116
|
+
|
|
117
|
+
If you installed with `pip install --user` and get "command not found":
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# Add to your PATH manually
|
|
121
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
122
|
+
|
|
123
|
+
# To make it permanent, add this line to your ~/.bashrc file
|
|
124
|
+
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
|
|
125
|
+
source ~/.bashrc
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Missing Dependencies
|
|
129
|
+
|
|
130
|
+
If you're missing any dependencies:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# Install Terminator (Ubuntu/Debian)
|
|
134
|
+
sudo apt install terminator
|
|
135
|
+
|
|
136
|
+
# Install Terminator (Fedora)
|
|
137
|
+
sudo dnf install terminator
|
|
138
|
+
|
|
139
|
+
# Install Terminator (RHEL/CentOS)
|
|
140
|
+
sudo yum install terminator
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Development
|
|
144
|
+
|
|
145
|
+
### Project Structure
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
lazyssh/
|
|
149
|
+
├── src/ # Source code
|
|
150
|
+
│ └── lazyssh/ # Main package
|
|
151
|
+
├── tests/ # Test suite
|
|
152
|
+
├── docs/ # Documentation
|
|
153
|
+
├── pyproject.toml # Project configuration
|
|
154
|
+
├── setup.py # Package installation
|
|
155
|
+
├── Makefile # Development tasks
|
|
156
|
+
├── pre-commit-check.sh # Script to run all CI checks locally
|
|
157
|
+
└── .pre-commit-config.yaml # Code quality hooks
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Setup Development Environment
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# Clone the repository
|
|
164
|
+
git clone https://github.com/Bochner/lazyssh.git
|
|
165
|
+
cd lazyssh
|
|
166
|
+
|
|
167
|
+
# Install dev dependencies
|
|
168
|
+
pip install -e ".[dev]"
|
|
169
|
+
|
|
170
|
+
# Install pre-commit hooks
|
|
171
|
+
pip install pre-commit
|
|
172
|
+
pre-commit install
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Running CI Checks Locally
|
|
176
|
+
|
|
177
|
+
Before committing your code, you can run all the CI checks locally using the provided script:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
# Make the script executable (first time only)
|
|
181
|
+
chmod +x pre-commit-check.sh
|
|
182
|
+
|
|
183
|
+
# Run all checks in a virtual environment
|
|
184
|
+
./pre-commit-check.sh
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
This script:
|
|
188
|
+
- Creates a temporary virtual environment (`.pre-commit-venv`)
|
|
189
|
+
- Installs all development dependencies
|
|
190
|
+
- Runs the following checks:
|
|
191
|
+
- Black formatting
|
|
192
|
+
- isort import sorting
|
|
193
|
+
- flake8 linting
|
|
194
|
+
- mypy type checking
|
|
195
|
+
- pytest (if test files exist)
|
|
196
|
+
- Package building
|
|
197
|
+
- Package verification with twine
|
|
198
|
+
- Cleans up the repository by removing:
|
|
199
|
+
- The temporary virtual environment
|
|
200
|
+
- Python cache files
|
|
201
|
+
- Build artifacts
|
|
202
|
+
- Test artifacts
|
|
203
|
+
|
|
204
|
+
The script is designed to be robust and will clean up after itself even if errors occur. It requires Python 3 to be installed on your system.
|
|
205
|
+
|
|
206
|
+
This ensures your code passes all CI checks and your repository is clean before committing.
|
|
207
|
+
|
|
208
|
+
### Common Development Tasks
|
|
209
|
+
|
|
210
|
+
We provide a Makefile for common tasks:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
# Install in development mode
|
|
214
|
+
make install
|
|
215
|
+
|
|
216
|
+
# Run tests
|
|
217
|
+
make test
|
|
218
|
+
|
|
219
|
+
# Format code (black and isort)
|
|
220
|
+
make fmt
|
|
221
|
+
|
|
222
|
+
# Lint code
|
|
223
|
+
make lint
|
|
224
|
+
|
|
225
|
+
# Build package
|
|
226
|
+
make build
|
|
227
|
+
|
|
228
|
+
# Create distribution
|
|
229
|
+
make dist
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## License
|
|
233
|
+
|
|
234
|
+
MIT License
|
|
235
|
+
|
|
236
|
+
## Contributing
|
|
237
|
+
|
|
238
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
Binary file
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "lazyssh"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "A comprehensive SSH toolkit for managing connections and tunnels"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
authors = [
|
|
11
|
+
{name = "Bochner", email = "lazyssh@example.com"}
|
|
12
|
+
]
|
|
13
|
+
license = {text = "MIT"}
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 5 - Production/Stable",
|
|
16
|
+
"Intended Audience :: System Administrators",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.7",
|
|
20
|
+
"Programming Language :: Python :: 3.8",
|
|
21
|
+
"Programming Language :: Python :: 3.9",
|
|
22
|
+
"Programming Language :: Python :: 3.10",
|
|
23
|
+
"Programming Language :: Python :: 3.11",
|
|
24
|
+
"License :: OSI Approved :: MIT License",
|
|
25
|
+
"Operating System :: POSIX :: Linux",
|
|
26
|
+
"Environment :: Console",
|
|
27
|
+
"Topic :: System :: Networking",
|
|
28
|
+
"Topic :: System :: Systems Administration",
|
|
29
|
+
]
|
|
30
|
+
keywords = ["ssh", "tunnel", "proxy", "socks", "terminal", "connection", "management"]
|
|
31
|
+
requires-python = ">=3.7"
|
|
32
|
+
dependencies = [
|
|
33
|
+
"colorama>=0.4.6",
|
|
34
|
+
"rich>=13.0.0",
|
|
35
|
+
"click>=8.0.0",
|
|
36
|
+
"pexpect>=4.8.0",
|
|
37
|
+
"python-dotenv>=1.0.0",
|
|
38
|
+
"prompt_toolkit>=3.0.39,<3.1.0",
|
|
39
|
+
"wcwidth>=0.2.5",
|
|
40
|
+
"art>=5.9",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[project.urls]
|
|
44
|
+
"Homepage" = "https://github.com/Bochner/lazyssh"
|
|
45
|
+
"Bug Tracker" = "https://github.com/Bochner/lazyssh/issues"
|
|
46
|
+
"Documentation" = "https://github.com/Bochner/lazyssh"
|
|
47
|
+
"Source Code" = "https://github.com/Bochner/lazyssh"
|
|
48
|
+
|
|
49
|
+
[project.optional-dependencies]
|
|
50
|
+
dev = [
|
|
51
|
+
"black",
|
|
52
|
+
"isort",
|
|
53
|
+
"pylint",
|
|
54
|
+
"pytest",
|
|
55
|
+
"pytest-cov",
|
|
56
|
+
"mypy",
|
|
57
|
+
"pre-commit",
|
|
58
|
+
"build",
|
|
59
|
+
"wheel",
|
|
60
|
+
"twine",
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
[project.scripts]
|
|
64
|
+
lazyssh = "lazyssh.__main__:main"
|
|
65
|
+
|
|
66
|
+
[tool.black]
|
|
67
|
+
line-length = 100
|
|
68
|
+
target-version = ['py37', 'py38', 'py39', 'py310', 'py311']
|
|
69
|
+
include = '\.pyi?$'
|
|
70
|
+
|
|
71
|
+
[tool.isort]
|
|
72
|
+
profile = "black"
|
|
73
|
+
line_length = 100
|
|
74
|
+
|
|
75
|
+
[tool.pytest.ini_options]
|
|
76
|
+
testpaths = ["tests"]
|
|
77
|
+
python_files = "test_*.py"
|
|
78
|
+
python_functions = "test_*"
|
|
79
|
+
python_classes = "Test*"
|
|
80
|
+
|
|
81
|
+
[tool.mypy]
|
|
82
|
+
python_version = "3.8"
|
|
83
|
+
warn_return_any = true
|
|
84
|
+
warn_unused_configs = true
|
|
85
|
+
disallow_untyped_defs = false
|
|
86
|
+
disallow_incomplete_defs = false
|
|
87
|
+
|
|
88
|
+
[tool.coverage.run]
|
|
89
|
+
source = ["src"]
|
|
90
|
+
omit = ["tests/*"]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
colorama>=0.4.6
|
|
2
|
+
rich>=13.0.0
|
|
3
|
+
click>=8.0.0
|
|
4
|
+
pexpect>=4.8.0
|
|
5
|
+
python-dotenv>=1.0.0
|
|
6
|
+
prompt_toolkit>=3.0.39,<3.1.0
|
|
7
|
+
wcwidth>=0.2.5
|
|
8
|
+
art>=5.9
|
|
9
|
+
# System dependencies:
|
|
10
|
+
# openssh-client - Required for SSH functionality
|
|
11
|
+
# terminator - Optional, for terminal emulation (alternatives will be used if not available)
|
lazyssh-1.0.0/setup.cfg
ADDED