pyvolt-cli 0.1.0__tar.gz → 0.2.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyvolt-cli
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: The command-line companion to Pyvolt: managed Python deployments on infrastructure you actually own.
5
5
  Project-URL: Homepage, https://pyvolt.com
6
6
  Project-URL: Repository, https://github.com/pyvolt-hq/pyvolt-cli
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "pyvolt-cli"
7
- version = "0.1.0"
7
+ version = "0.2.0"
8
8
  description = "The command-line companion to Pyvolt: managed Python deployments on infrastructure you actually own."
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
@@ -120,6 +120,35 @@ def servers():
120
120
  console.print(t)
121
121
 
122
122
 
123
+ @app.command()
124
+ def ssh(
125
+ server: str = typer.Argument(..., metavar="SERVER"),
126
+ app_name: str = typer.Option("", "--app", "-a", help="cd into this app's directory on connect."),
127
+ ):
128
+ """Open an SSH shell on a server (as the pyvolt app-user).
129
+
130
+ A thin convenience wrapper: it resolves the host/port from the API and
131
+ execs your local `ssh`, so your own key must be on the box — add it under
132
+ Account → SSH Keys (or `pyvolt` on the web dashboard)."""
133
+ import os
134
+ import shutil
135
+
136
+ if not shutil.which("ssh"):
137
+ raise fail("No `ssh` client found on PATH.")
138
+ api = Api()
139
+ srv = api.resolve_server(server)
140
+ if srv["status"] != "ready":
141
+ raise fail(f"{srv['name']} is {srv['status']}, not ready.")
142
+ target = f"{srv.get('ssh_user', 'pyvolt')}@{srv['ip_address']}"
143
+ args = ["ssh", "-p", str(srv.get("ssh_port", 22)), target]
144
+ if app_name:
145
+ site = api.resolve_app(app_name)
146
+ # Drop into the app's checkout, then hand over an interactive shell.
147
+ args += ["-t", f"cd sites/{site['domain']}/repo 2>/dev/null; exec \"$SHELL\" -l"]
148
+ console.print(f"[dim]Connecting to {target}…[/dim]")
149
+ os.execvp("ssh", args)
150
+
151
+
123
152
  @app.command()
124
153
  def apps(server: str = typer.Option("", "--server", help="Filter by server name.")):
125
154
  """List your apps."""
File without changes
File without changes
File without changes