gto-ssh 0.1.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.
- gto_ssh-0.1.0/PKG-INFO +5 -0
- gto_ssh-0.1.0/README.md +14 -0
- gto_ssh-0.1.0/pyproject.toml +13 -0
- gto_ssh-0.1.0/setup.cfg +4 -0
- gto_ssh-0.1.0/src/gto/__init__.py +0 -0
- gto_ssh-0.1.0/src/gto/app.py +55 -0
- gto_ssh-0.1.0/src/gto_ssh.egg-info/PKG-INFO +5 -0
- gto_ssh-0.1.0/src/gto_ssh.egg-info/SOURCES.txt +9 -0
- gto_ssh-0.1.0/src/gto_ssh.egg-info/dependency_links.txt +1 -0
- gto_ssh-0.1.0/src/gto_ssh.egg-info/entry_points.txt +2 -0
- gto_ssh-0.1.0/src/gto_ssh.egg-info/top_level.txt +1 -0
gto_ssh-0.1.0/PKG-INFO
ADDED
gto_ssh-0.1.0/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
cat <<EOF > README.md
|
|
2
|
+
# GTO (Gum Transmission Operator)
|
|
3
|
+
|
|
4
|
+
A simple SSH manager that uses [gum](https://github.com/charmbracelet/gum) for terminal interactivity.
|
|
5
|
+
|
|
6
|
+
## Prerequisites
|
|
7
|
+
This tool requires **gum** to be installed on your system.
|
|
8
|
+
Please install it following the instructions at: https://github.com/charmbracelet/gum
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
- Run \`gto config\` to add, delete, or favorite hosts.
|
|
12
|
+
- Run \`gto\` to select a host to SSH into.
|
|
13
|
+
- Run \`gg\` to connect to your favorite host.
|
|
14
|
+
EOF
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "gto-ssh"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
authors = [{name = "Otakumob", email = "wolfer.carter@gmail.com"}]
|
|
9
|
+
description = "Gum Transmission Operator"
|
|
10
|
+
dependencies = []
|
|
11
|
+
|
|
12
|
+
[project.scripts]
|
|
13
|
+
gto = "gto.app:main"
|
gto_ssh-0.1.0/setup.cfg
ADDED
|
File without changes
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
import json
|
|
3
|
+
import subprocess
|
|
4
|
+
import sys
|
|
5
|
+
import shutil
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
# Use a standard config path so it works for all users
|
|
9
|
+
DATA_FILE = Path.home() / ".config/gto.json"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def load_hosts():
|
|
13
|
+
DATA_FILE.parent.mkdir(parents=True, exist_ok=True)
|
|
14
|
+
if not DATA_FILE.exists():
|
|
15
|
+
return []
|
|
16
|
+
with open(DATA_FILE, "r") as f:
|
|
17
|
+
try:
|
|
18
|
+
return json.load(f)
|
|
19
|
+
except json.JSONDecodeError:
|
|
20
|
+
return []
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def save_hosts(hosts):
|
|
24
|
+
with open(DATA_FILE, "w") as f:
|
|
25
|
+
json.dump(hosts, f, indent=2)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def run_config():
|
|
29
|
+
# Your existing config logic here...
|
|
30
|
+
pass
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def run_selector(fav_mode=False):
|
|
34
|
+
# Your existing selector logic here...
|
|
35
|
+
pass
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def main():
|
|
39
|
+
# System Dependency Check
|
|
40
|
+
if not shutil.which("gum"):
|
|
41
|
+
print(
|
|
42
|
+
"Error: 'gum' is not installed. Please install it from https://github.com/charmbracelet/gum"
|
|
43
|
+
)
|
|
44
|
+
sys.exit(1)
|
|
45
|
+
|
|
46
|
+
if len(sys.argv) > 1 and sys.argv[1] == "config":
|
|
47
|
+
run_config()
|
|
48
|
+
elif len(sys.argv) > 1 and sys.argv[1] == "--fav":
|
|
49
|
+
run_selector(fav_mode=True)
|
|
50
|
+
else:
|
|
51
|
+
run_selector()
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
if __name__ == "__main__":
|
|
55
|
+
main()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gto
|