runtime-sdk 0.1.1__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.
@@ -0,0 +1,133 @@
1
+ Metadata-Version: 2.4
2
+ Name: runtime-sdk
3
+ Version: 0.2.0
4
+ Summary: Runtime Python SDK and CLI
5
+ Project-URL: Repository, https://github.com/The-Money-Company-Limited/runtimevm
6
+ Project-URL: Issues, https://github.com/The-Money-Company-Limited/runtimevm/issues
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3.11
9
+ Classifier: Programming Language :: Python :: 3.12
10
+ Classifier: Programming Language :: Python :: 3.13
11
+ Classifier: Programming Language :: Python :: 3 :: Only
12
+ Classifier: Environment :: Console
13
+ Requires-Python: >=3.11
14
+ Description-Content-Type: text/markdown
15
+ Requires-Dist: httpx>=0.28.1
16
+ Requires-Dist: questionary>=2.0
17
+ Requires-Dist: rich>=13.7
18
+
19
+ # runtime-sdk
20
+
21
+ Python SDK and CLI for Runtime.
22
+
23
+ ## Install
24
+
25
+ ```bash
26
+ uv tool install runtime-sdk
27
+ ```
28
+
29
+ To upgrade an existing install:
30
+
31
+ ```bash
32
+ uv tool upgrade runtime-sdk
33
+ ```
34
+
35
+ ## Configure
36
+
37
+ The CLI talks to `http://127.0.0.1:8080` by default. Override it with:
38
+
39
+ ```bash
40
+ export RUNTIME_BASE_URL=https://api.runruntime.dev
41
+ ```
42
+
43
+ Or pass `--base-url` per command.
44
+
45
+ ## Usage
46
+
47
+ ```bash
48
+ # Auth
49
+ runtime signup you@example.com --name "Your Name"
50
+ runtime verify 123456
51
+ runtime whoami
52
+ runtime logout
53
+ runtime login <api_key>
54
+
55
+ # Computers
56
+ runtime create
57
+ runtime list
58
+ runtime info <id>
59
+ runtime run <id> "echo hello"
60
+ runtime run <id> "apt install -y nodejs" --uid 0
61
+ runtime publish <id> 3000
62
+ runtime delete <id>
63
+ ```
64
+
65
+ ## Python
66
+
67
+ ```python
68
+ from runtime_sdk import RuntimeClient
69
+
70
+ client = RuntimeClient(base_url="https://api.runruntime.dev", api_key="rt_live_...")
71
+
72
+ # Create a computer
73
+ computer = client.create_computer()
74
+ print(computer["public_url"]) # https://goldbird.runruntime.dev
75
+
76
+ # Run a command
77
+ result = client.run_command(computer["id"], "echo hello")
78
+ print(result["stdout"])
79
+
80
+ # Pin the public URL to a local app port
81
+ client.publish_port(computer["id"], 3000)
82
+
83
+ # List, info, delete
84
+ computers = client.list_computers()
85
+ info = client.get_computer(computer["id"])
86
+ client.delete_computer(computer["id"])
87
+ ```
88
+
89
+ ## Development
90
+
91
+ For fast local backend iteration:
92
+
93
+ ```bash
94
+ make local-backend
95
+ ```
96
+
97
+ For deploying and testing against the Hetzner production server:
98
+
99
+ ```bash
100
+ make sync SERVER_IP=x.x.x.x SSH_USER=root
101
+ make smoke
102
+ ```
103
+
104
+ Use `make deploy` instead of `make sync` when migrations, env
105
+ files, Caddy, or systemd units changed.
106
+
107
+ Run the SDK unit tests through the backend project environment:
108
+
109
+ ```bash
110
+ uv run python -m unittest scripts.tests.test_runtime_sdk
111
+ ```
112
+
113
+ ## Release
114
+
115
+ Preview the next release without changing files:
116
+
117
+ ```bash
118
+ ./scripts/release_runtime_sdk.sh --dry-run
119
+ ```
120
+
121
+ Publish a patch release:
122
+
123
+ ```bash
124
+ ./scripts/release_runtime_sdk.sh --publish
125
+ ```
126
+
127
+ Publish a different version bump:
128
+
129
+ ```bash
130
+ ./scripts/release_runtime_sdk.sh --bump minor --publish
131
+ ```
132
+
133
+ The script loads `backend/.env` automatically, so `UV_PUBLISH_TOKEN` can live there.
@@ -0,0 +1,115 @@
1
+ # runtime-sdk
2
+
3
+ Python SDK and CLI for Runtime.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ uv tool install runtime-sdk
9
+ ```
10
+
11
+ To upgrade an existing install:
12
+
13
+ ```bash
14
+ uv tool upgrade runtime-sdk
15
+ ```
16
+
17
+ ## Configure
18
+
19
+ The CLI talks to `http://127.0.0.1:8080` by default. Override it with:
20
+
21
+ ```bash
22
+ export RUNTIME_BASE_URL=https://api.runruntime.dev
23
+ ```
24
+
25
+ Or pass `--base-url` per command.
26
+
27
+ ## Usage
28
+
29
+ ```bash
30
+ # Auth
31
+ runtime signup you@example.com --name "Your Name"
32
+ runtime verify 123456
33
+ runtime whoami
34
+ runtime logout
35
+ runtime login <api_key>
36
+
37
+ # Computers
38
+ runtime create
39
+ runtime list
40
+ runtime info <id>
41
+ runtime run <id> "echo hello"
42
+ runtime run <id> "apt install -y nodejs" --uid 0
43
+ runtime publish <id> 3000
44
+ runtime delete <id>
45
+ ```
46
+
47
+ ## Python
48
+
49
+ ```python
50
+ from runtime_sdk import RuntimeClient
51
+
52
+ client = RuntimeClient(base_url="https://api.runruntime.dev", api_key="rt_live_...")
53
+
54
+ # Create a computer
55
+ computer = client.create_computer()
56
+ print(computer["public_url"]) # https://goldbird.runruntime.dev
57
+
58
+ # Run a command
59
+ result = client.run_command(computer["id"], "echo hello")
60
+ print(result["stdout"])
61
+
62
+ # Pin the public URL to a local app port
63
+ client.publish_port(computer["id"], 3000)
64
+
65
+ # List, info, delete
66
+ computers = client.list_computers()
67
+ info = client.get_computer(computer["id"])
68
+ client.delete_computer(computer["id"])
69
+ ```
70
+
71
+ ## Development
72
+
73
+ For fast local backend iteration:
74
+
75
+ ```bash
76
+ make local-backend
77
+ ```
78
+
79
+ For deploying and testing against the Hetzner production server:
80
+
81
+ ```bash
82
+ make sync SERVER_IP=x.x.x.x SSH_USER=root
83
+ make smoke
84
+ ```
85
+
86
+ Use `make deploy` instead of `make sync` when migrations, env
87
+ files, Caddy, or systemd units changed.
88
+
89
+ Run the SDK unit tests through the backend project environment:
90
+
91
+ ```bash
92
+ uv run python -m unittest scripts.tests.test_runtime_sdk
93
+ ```
94
+
95
+ ## Release
96
+
97
+ Preview the next release without changing files:
98
+
99
+ ```bash
100
+ ./scripts/release_runtime_sdk.sh --dry-run
101
+ ```
102
+
103
+ Publish a patch release:
104
+
105
+ ```bash
106
+ ./scripts/release_runtime_sdk.sh --publish
107
+ ```
108
+
109
+ Publish a different version bump:
110
+
111
+ ```bash
112
+ ./scripts/release_runtime_sdk.sh --bump minor --publish
113
+ ```
114
+
115
+ The script loads `backend/.env` automatically, so `UV_PUBLISH_TOKEN` can live there.
@@ -1,11 +1,13 @@
1
1
  [project]
2
2
  name = "runtime-sdk"
3
- version = "0.1.1"
3
+ version = "0.2.0"
4
4
  description = "Runtime Python SDK and CLI"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
7
7
  dependencies = [
8
8
  "httpx>=0.28.1",
9
+ "questionary>=2.0",
10
+ "rich>=13.7",
9
11
  ]
10
12
  classifiers = [
11
13
  "Programming Language :: Python :: 3",