verulla-cli 0.0.5__tar.gz → 0.0.7__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.
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/CHANGELOG.md +8 -0
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/PKG-INFO +2 -2
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/pyproject.toml +2 -2
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/tests/test_apps_client.py +19 -2
- verulla_cli-0.0.7/tests/test_cli_import.py +6 -0
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/tests/test_main.py +141 -2
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/verulla_cli/__init__.py +1 -1
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/verulla_cli/apps_client.py +17 -3
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/verulla_cli/main.py +113 -21
- verulla_cli-0.0.5/tests/test_cli_import.py +0 -4
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/.gitignore +0 -0
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/tests/test_admin_cmd.py +0 -0
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/tests/test_auth.py +0 -0
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/tests/test_buildkit.py +0 -0
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/tests/test_buildkit_real.py +0 -0
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/tests/test_deploy_client.py +0 -0
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/tests/test_dev_check.py +0 -0
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/tests/test_emulate.py +0 -0
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/tests/test_owner_commands.py +0 -0
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/tests/test_packaging.py +0 -0
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/tests/test_secrets_client.py +0 -0
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/tests/test_sketch_status.py +0 -0
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/verulla_cli/auth.py +0 -0
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/verulla_cli/buildkit.py +0 -0
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/verulla_cli/config.py +0 -0
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/verulla_cli/deploy_client.py +0 -0
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/verulla_cli/emulate.py +0 -0
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/verulla_cli/packaging.py +0 -0
- {verulla_cli-0.0.5 → verulla_cli-0.0.7}/verulla_cli/secrets_client.py +0 -0
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# verulla-cli changelog
|
|
2
2
|
|
|
3
|
+
## 0.0.7
|
|
4
|
+
|
|
5
|
+
- `verulla pro` and `verulla trial` are the new names; `live`/`sketch` still work.
|
|
6
|
+
|
|
7
|
+
## 0.0.6
|
|
8
|
+
|
|
9
|
+
- Support the `port:` manifest field for Dockerfile apps, including the Dockerfile `EXPOSE` consistency check.
|
|
10
|
+
|
|
3
11
|
## 0.0.5
|
|
4
12
|
|
|
5
13
|
- Make `verulla deploy --wait` wait for the deployed app's runtime health to become ready, not just build/apply completion. It exits nonzero on a crash and reports the available crash cause plus a hint to check the configured (or default 8080) listening port; the wait timeout remains bounded.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: verulla-cli
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.7
|
|
4
4
|
Requires-Python: >=3.12
|
|
5
5
|
Requires-Dist: docker>=7
|
|
6
6
|
Requires-Dist: httpx>=0.27
|
|
7
7
|
Requires-Dist: typer>=0.12
|
|
8
|
-
Requires-Dist: verulla-manifest==0.0.
|
|
8
|
+
Requires-Dist: verulla-manifest==0.0.3
|
|
@@ -100,10 +100,27 @@ def test_sketch_events_passes_cursor_and_limit_without_changing_contract():
|
|
|
100
100
|
|
|
101
101
|
def test_sketch_events_rejects_invalid_response_payload():
|
|
102
102
|
client = FakeClient(response(200, {"events": [{"type": "sketch.retention_ended"}], "next_cursor": None, "has_more": False}))
|
|
103
|
-
with pytest.raises(AppsError, match="invalid
|
|
103
|
+
with pytest.raises(AppsError, match="invalid free-trial event response"):
|
|
104
104
|
get_sketch_events("http://api.test", "token", "demo", client=client)
|
|
105
105
|
|
|
106
106
|
|
|
107
|
+
@pytest.mark.parametrize(
|
|
108
|
+
("code", "message"),
|
|
109
|
+
[
|
|
110
|
+
( "spend_cap_required", "Set a monthly spending limit in the account console, then retry `verulla pro APP`."),
|
|
111
|
+
(
|
|
112
|
+
"live_activation_disabled",
|
|
113
|
+
"Pro upgrades are not available right now. Your app's data is kept for 14 days after the free trial ends.",
|
|
114
|
+
),
|
|
115
|
+
],
|
|
116
|
+
)
|
|
117
|
+
def test_activation_errors_have_actionable_non_support_only_copy(code, message):
|
|
118
|
+
client = FakeClient(response(409, {"detail": {"code": code, "message": "backend detail"}}))
|
|
119
|
+
|
|
120
|
+
with pytest.raises(AppsError, match=message.replace("'", "\\'")):
|
|
121
|
+
activate_app("http://api.test", "token", "demo", "idempotency-key", client)
|
|
122
|
+
|
|
123
|
+
|
|
107
124
|
|
|
108
125
|
def test_currency_client_calls_preserve_legacy_cent_fields_and_send_topup_currency():
|
|
109
126
|
client = FakeClient(response(201, {"topup_id": "top-1", "amount_cents": 1500, "currency": "CAD"}))
|
|
@@ -251,7 +268,7 @@ def test_activation_402_has_actionable_spending_limit_guidance():
|
|
|
251
268
|
|
|
252
269
|
def test_activation_402_explains_required_spending_limit():
|
|
253
270
|
client = FakeClient(response(402, {"detail": {"code": "spend_cap_required"}}))
|
|
254
|
-
with pytest.raises(AppsError, match="Set a monthly spending limit
|
|
271
|
+
with pytest.raises(AppsError, match="Set a monthly spending limit in the account console"):
|
|
255
272
|
activate_app("http://api.test", "token", "demo", "request-3", client)
|
|
256
273
|
|
|
257
274
|
|
|
@@ -10,17 +10,69 @@ from verulla_cli.main import _secret_scope, app
|
|
|
10
10
|
runner = CliRunner()
|
|
11
11
|
|
|
12
12
|
|
|
13
|
+
def test_cli_reports_installed_version() -> None:
|
|
14
|
+
result = runner.invoke(app, ["--version"])
|
|
15
|
+
|
|
16
|
+
assert result.exit_code == 0
|
|
17
|
+
assert result.output.strip() == "verulla 0.0.7"
|
|
18
|
+
|
|
19
|
+
|
|
13
20
|
def test_auth_and_customer_commands_are_registered() -> None:
|
|
14
21
|
result = runner.invoke(app, ["--help"])
|
|
15
22
|
assert result.exit_code == 0
|
|
16
23
|
assert "auth" in result.output and "customers" in result.output
|
|
17
24
|
assert "signup" in result.output
|
|
25
|
+
assert "trial" in result.output
|
|
26
|
+
assert "sketch" not in result.output
|
|
27
|
+
assert "live" not in result.output.lower()
|
|
18
28
|
for command in ("wallet", "spend", "usage", "pricing", "topup"):
|
|
19
29
|
assert command in result.output
|
|
20
30
|
for command in ("show", "set"):
|
|
21
31
|
assert command in runner.invoke(app, ["auth", "--help"]).output
|
|
22
32
|
for command in ("list", "lock", "unlock", "delete", "export", "invite"):
|
|
23
33
|
assert command in runner.invoke(app, ["customers", "--help"]).output
|
|
34
|
+
domains_help = runner.invoke(app, ["domains", "--help"])
|
|
35
|
+
assert domains_help.exit_code == 0
|
|
36
|
+
for command in ("add", "status", "verify"):
|
|
37
|
+
assert command in domains_help.output
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def test_trial_status_and_legacy_sketch_alias_share_the_lifecycle_receipt(monkeypatch) -> None:
|
|
41
|
+
monkeypatch.setattr("verulla_cli.main.get_token", lambda: "token")
|
|
42
|
+
monkeypatch.setattr("verulla_cli.main.get_sketch_status", lambda *args: {
|
|
43
|
+
"app": "demo", "status": "deployed", "url": "https://demo.verulla.app",
|
|
44
|
+
})
|
|
45
|
+
trial = runner.invoke(app, ["trial", "status", "demo"])
|
|
46
|
+
legacy = runner.invoke(app, ["sketch", "status", "demo"])
|
|
47
|
+
assert trial.exit_code == 0, trial.output
|
|
48
|
+
assert legacy.exit_code == 0, legacy.output
|
|
49
|
+
assert "app: demo" in trial.output
|
|
50
|
+
assert "app: demo" in legacy.output
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def test_domains_add_prints_both_customer_dns_records(monkeypatch) -> None:
|
|
54
|
+
monkeypatch.setattr("verulla_cli.main._agent_token", lambda: "agent-token")
|
|
55
|
+
monkeypatch.setattr("verulla_cli.main.api_add_domain", lambda *args: {
|
|
56
|
+
"id": "domain-id", "status": "pending_dns",
|
|
57
|
+
"dns_instructions": [
|
|
58
|
+
{"type": "CNAME", "name": "shop.example.com", "target": "domains.verulla.app",
|
|
59
|
+
"purpose": "Routes this hostname to Verulla."},
|
|
60
|
+
{"type": "CNAME", "name": "_acme-challenge.shop.example.com",
|
|
61
|
+
"target": "deadbeef.acme.verulla.app",
|
|
62
|
+
"purpose": "Delegates certificate validation; leave this record in place."},
|
|
63
|
+
{"type": "ALIAS/ANAME", "name": "example.com", "target": "domains.verulla.app",
|
|
64
|
+
"purpose": "At a zone apex, use provider flattening."},
|
|
65
|
+
{"type": "CNAME", "name": "_acme-challenge.example.com",
|
|
66
|
+
"target": "deadbeef.acme.verulla.app",
|
|
67
|
+
"purpose": "Delegates certificate validation; leave this record in place."},
|
|
68
|
+
],
|
|
69
|
+
})
|
|
70
|
+
result = runner.invoke(app, ["domains", "add", "demo", "shop.example.com"])
|
|
71
|
+
assert result.exit_code == 0, result.output
|
|
72
|
+
assert "Add a CNAME record named shop.example.com pointing to domains.verulla.app." in result.output
|
|
73
|
+
assert "Add a CNAME record named _acme-challenge.shop.example.com pointing to deadbeef.acme.verulla.app." in result.output
|
|
74
|
+
assert "At the zone apex, add a provider-flattened ALIAS/ANAME (or CNAME-flattening) record named example.com pointing to domains.verulla.app." in result.output
|
|
75
|
+
assert "Add a CNAME record named _acme-challenge.example.com pointing to deadbeef.acme.verulla.app." in result.output
|
|
24
76
|
|
|
25
77
|
|
|
26
78
|
def test_signup_stores_key_privately_and_redacts_output(tmp_path, monkeypatch) -> None:
|
|
@@ -174,7 +226,7 @@ def test_help_lists_all_commands() -> None:
|
|
|
174
226
|
result = runner.invoke(app, ["--help"])
|
|
175
227
|
assert result.exit_code == 0
|
|
176
228
|
assert "https://api.verulla.app" in result.output
|
|
177
|
-
for name in ("login", "dev", "deploy", "secrets", "logs", "apps", "status", "delete", "rollback", "
|
|
229
|
+
for name in ("login", "dev", "deploy", "secrets", "logs", "apps", "status", "delete", "rollback", "pro"):
|
|
178
230
|
assert name in result.output
|
|
179
231
|
|
|
180
232
|
|
|
@@ -317,6 +369,36 @@ def test_deploy_valid_manifest_not_logged_in(tmp_path, monkeypatch) -> None:
|
|
|
317
369
|
assert "not authenticated" in result.output
|
|
318
370
|
|
|
319
371
|
|
|
372
|
+
def test_deploy_accepts_dockerfile_port_before_login(tmp_path, monkeypatch) -> None:
|
|
373
|
+
monkeypatch.setattr("verulla_cli.main.get_token", _not_logged_in)
|
|
374
|
+
(tmp_path / "Dockerfile").write_text("FROM example\nEXPOSE 8000\n")
|
|
375
|
+
(tmp_path / "verulla.yml").write_text(
|
|
376
|
+
"version: 1\napp: demo-app\nfunctions:\n"
|
|
377
|
+
" - name: web\n runtime: dockerfile\n port: 8000\n"
|
|
378
|
+
"routes:\n - path: /\n function: web\n"
|
|
379
|
+
)
|
|
380
|
+
|
|
381
|
+
result = runner.invoke(app, ["deploy", str(tmp_path), "--api-url", "http://127.0.0.1:1"])
|
|
382
|
+
|
|
383
|
+
assert result.exit_code == 1
|
|
384
|
+
assert "not authenticated" in result.output
|
|
385
|
+
assert "port" not in result.output.lower()
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
def test_deploy_rejects_unknown_manifest_key_before_login(tmp_path, monkeypatch) -> None:
|
|
389
|
+
def _boom():
|
|
390
|
+
raise AssertionError("get_token must not be called for invalid manifests")
|
|
391
|
+
|
|
392
|
+
monkeypatch.setattr("verulla_cli.main.get_token", _boom)
|
|
393
|
+
(tmp_path / "verulla.yml").write_text(VALID_MANIFEST + "unexpected: true\n")
|
|
394
|
+
|
|
395
|
+
result = runner.invoke(app, ["deploy", str(tmp_path), "--api-url", "http://127.0.0.1:1"])
|
|
396
|
+
|
|
397
|
+
assert result.exit_code == 1
|
|
398
|
+
assert "Error" in result.output
|
|
399
|
+
assert "unexpected" in result.output
|
|
400
|
+
|
|
401
|
+
|
|
320
402
|
def test_deploy_success_prints_deployment(tmp_path, monkeypatch) -> None:
|
|
321
403
|
monkeypatch.setattr(
|
|
322
404
|
"verulla_cli.main.get_token", lambda: "tok"
|
|
@@ -370,7 +452,7 @@ def test_deploy_wait_success_prints_sketch_handoff(tmp_path, monkeypatch) -> Non
|
|
|
370
452
|
assert "2026-11-06T12:00:00Z" in result.output
|
|
371
453
|
assert "72 hours" in result.output
|
|
372
454
|
assert "custom domain" in result.output.lower()
|
|
373
|
-
assert "verulla
|
|
455
|
+
assert "verulla trial status demo-app" in result.output
|
|
374
456
|
assert "owner claim status: pending" in result.output.lower()
|
|
375
457
|
|
|
376
458
|
|
|
@@ -604,6 +686,63 @@ def test_live_confirmation_decline_does_not_activate(monkeypatch) -> None:
|
|
|
604
686
|
assert calls == []
|
|
605
687
|
|
|
606
688
|
|
|
689
|
+
def test_live_when_disabled_explains_data_retention_and_current_unavailability(monkeypatch) -> None:
|
|
690
|
+
monkeypatch.setattr("verulla_cli.main.get_token", lambda: "api-token")
|
|
691
|
+
monkeypatch.setattr("verulla_cli.main.get_app", lambda *args: {"live_activation_available": False})
|
|
692
|
+
|
|
693
|
+
result = runner.invoke(app, ["live", "demo", "--api-url", "https://api.test"])
|
|
694
|
+
|
|
695
|
+
assert result.exit_code == 1
|
|
696
|
+
assert "Pro upgrades are not available right now. Your app's data is kept for 14 days after the free trial ends." in result.output
|
|
697
|
+
assert "contact" not in result.output.lower()
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
def test_live_help_explains_free_trial_to_paid_live() -> None:
|
|
701
|
+
result = runner.invoke(app, ["live", "--help"])
|
|
702
|
+
|
|
703
|
+
assert result.exit_code == 0
|
|
704
|
+
assert "free 72-hour trial" in result.output
|
|
705
|
+
assert "paid Pro" in result.output
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
def test_pro_is_documented_command_and_live_remains_compatible_alias() -> None:
|
|
709
|
+
help_result = runner.invoke(app, ["--help"])
|
|
710
|
+
assert "pro" in help_result.output
|
|
711
|
+
assert "live" not in help_result.output
|
|
712
|
+
pro_help = runner.invoke(app, ["pro", "--help"])
|
|
713
|
+
live_help = runner.invoke(app, ["live", "--help"])
|
|
714
|
+
assert pro_help.exit_code == 0
|
|
715
|
+
assert live_help.exit_code == 0
|
|
716
|
+
assert "Pro" in pro_help.output
|
|
717
|
+
assert "Pro" in live_help.output
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
def test_live_when_already_live_does_not_claim_upgrades_are_opening_soon(monkeypatch) -> None:
|
|
721
|
+
monkeypatch.setattr("verulla_cli.main.get_token", lambda: "api-token")
|
|
722
|
+
monkeypatch.setattr("verulla_cli.main.get_app", lambda *args: {"live_activation_available": False, "tier_id": "live"})
|
|
723
|
+
|
|
724
|
+
result = runner.invoke(app, ["live", "demo", "--api-url", "https://api.test"])
|
|
725
|
+
|
|
726
|
+
assert result.exit_code == 0
|
|
727
|
+
assert "already on Pro" in result.output
|
|
728
|
+
assert "opening soon" not in result.output
|
|
729
|
+
assert "14 days" not in result.output
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
def test_status_prints_machine_readable_next_step(monkeypatch) -> None:
|
|
733
|
+
step = {
|
|
734
|
+
"action": "upgrade_to_live", "command": "verulla live <app>",
|
|
735
|
+
"docs_url": "https://verulla.com/docs/agent-guide.md#keep-your-app-online", "available": False,
|
|
736
|
+
}
|
|
737
|
+
monkeypatch.setattr("verulla_cli.main.get_token", lambda: "api-token")
|
|
738
|
+
monkeypatch.setattr("verulla_cli.main.get_app", lambda *args: {"app": "demo", "status": "suspended", "next_step": step})
|
|
739
|
+
|
|
740
|
+
result = runner.invoke(app, ["status", "demo", "--api-url", "https://api.test"])
|
|
741
|
+
|
|
742
|
+
assert result.exit_code == 0, result.output
|
|
743
|
+
assert 'next_step: {"action":"upgrade_to_live","command":"verulla live <app>","docs_url":"https://verulla.com/docs/agent-guide.md#keep-your-app-online","available":false}' in result.output
|
|
744
|
+
|
|
745
|
+
|
|
607
746
|
def test_live_uses_wallet_currency_for_price_and_headroom(monkeypatch) -> None:
|
|
608
747
|
monkeypatch.setattr("verulla_cli.main.get_token", lambda: "api-token")
|
|
609
748
|
monkeypatch.setattr("verulla_cli.main.get_app", lambda *args: {"live_activation_available": True})
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from typing import Any
|
|
4
|
+
from urllib.parse import quote
|
|
4
5
|
|
|
5
6
|
import httpx
|
|
6
7
|
from verulla_manifest.sketch_events import validate_sketch_event_page
|
|
@@ -37,8 +38,8 @@ def _request(api_url: str, token: str, method: str, path: str, client=None, *, e
|
|
|
37
38
|
message = {
|
|
38
39
|
"insufficient_wallet_funds": "Not enough wallet funds. Top up your wallet, then run this command again.",
|
|
39
40
|
"spend_cap_exceeded": "This would exceed your spending limit. Ask the account owner to raise the limit, then try again.",
|
|
40
|
-
"spend_cap_required": "Set a monthly spending limit
|
|
41
|
-
"live_activation_disabled": "
|
|
41
|
+
"spend_cap_required": "Set a monthly spending limit in the account console, then retry `verulla pro APP`.",
|
|
42
|
+
"live_activation_disabled": "Pro upgrades are not available right now. Your app's data is kept for 14 days after the free trial ends.",
|
|
42
43
|
}.get(code_text, detail.get("message") or str(detail))
|
|
43
44
|
detail = f"{message} (code: {code_text})" if code_text else message
|
|
44
45
|
else:
|
|
@@ -112,7 +113,7 @@ def get_sketch_events(api_url: str, token: str, name: str, *, cursor: str | None
|
|
|
112
113
|
try:
|
|
113
114
|
return validate_sketch_event_page(response)
|
|
114
115
|
except ValueError as exc:
|
|
115
|
-
raise AppsError(f"invalid
|
|
116
|
+
raise AppsError(f"invalid free-trial event response: {exc}") from exc
|
|
116
117
|
|
|
117
118
|
def get_sketch_status(api_url: str, token: str, name: str, client=None) -> dict:
|
|
118
119
|
from urllib.parse import quote
|
|
@@ -221,3 +222,16 @@ def rollback_app(api_url: str, token: str, name: str, client=None) -> dict:
|
|
|
221
222
|
def export_customers(api_url: str, token: str, app: str, client=None) -> str:
|
|
222
223
|
from urllib.parse import quote
|
|
223
224
|
return _request(api_url, token, "GET", f"/v1/apps/{quote(app, safe='')}/customers/export", client, raw=True)
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
def add_domain(api_url: str, token: str, app: str, host: str, client=None) -> dict:
|
|
228
|
+
return _request(api_url, token, "POST", f"/v1/apps/{quote(app, safe='')}/domains", client,
|
|
229
|
+
json_body={"host": host})
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
def list_domains(api_url: str, token: str, app: str, client=None) -> dict:
|
|
233
|
+
return _request(api_url, token, "GET", f"/v1/apps/{quote(app, safe='')}/domains", client)
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
def verify_domain(api_url: str, token: str, app: str, host: str, client=None) -> dict:
|
|
237
|
+
return _request(api_url, token, "POST", f"/v1/apps/{quote(app, safe='')}/domains/{quote(host, safe='')}/verify", client)
|
|
@@ -11,11 +11,15 @@ import uuid
|
|
|
11
11
|
|
|
12
12
|
import typer
|
|
13
13
|
|
|
14
|
+
from verulla_cli import __version__
|
|
14
15
|
from verulla_cli.config import DEFAULT_API_URL
|
|
15
16
|
from verulla_cli.auth import CREDENTIALS_PATH, DeviceLoginError, get_token, run_device_login, save_credentials
|
|
16
17
|
from verulla_manifest import load_manifest, translate
|
|
17
18
|
from verulla_cli.apps_client import (
|
|
18
19
|
AppsError,
|
|
20
|
+
add_domain as api_add_domain,
|
|
21
|
+
list_domains as api_list_domains,
|
|
22
|
+
verify_domain as api_verify_domain,
|
|
19
23
|
create_signup,
|
|
20
24
|
activate_app,
|
|
21
25
|
delete_app as api_delete_app,
|
|
@@ -56,11 +60,30 @@ app = typer.Typer(
|
|
|
56
60
|
name="verulla",
|
|
57
61
|
help=f"Verulla: AI-agent-friendly deployment & hosting CLI. API URL default: {DEFAULT_API_URL} (override with --api-url or VERULLA_API_URL).",
|
|
58
62
|
no_args_is_help=True,
|
|
63
|
+
invoke_without_command=True,
|
|
59
64
|
)
|
|
60
|
-
|
|
61
|
-
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
@app.callback()
|
|
68
|
+
def _main(
|
|
69
|
+
version: bool = typer.Option(
|
|
70
|
+
False, "--version", is_eager=True, help="Show the installed Verulla CLI version and exit."
|
|
71
|
+
),
|
|
72
|
+
) -> None:
|
|
73
|
+
if version:
|
|
74
|
+
typer.echo(f"verulla {__version__}")
|
|
75
|
+
raise typer.Exit()
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
sketch_app = typer.Typer(name="sketch", help="Inspect free-trial lifecycle status.", no_args_is_help=True)
|
|
79
|
+
trial_app = typer.Typer(name="trial", help="Inspect free-trial lifecycle status.", no_args_is_help=True)
|
|
80
|
+
app.add_typer(trial_app, name="trial")
|
|
81
|
+
# Keep the pre-rename command group working for existing scripts.
|
|
82
|
+
app.add_typer(sketch_app, name="sketch", hidden=True)
|
|
62
83
|
owner_app = typer.Typer(name="owner", help="Manage the verified owner hand-off.", no_args_is_help=True)
|
|
63
84
|
app.add_typer(owner_app, name="owner")
|
|
85
|
+
domains_app = typer.Typer(name="domains", help="Manage custom domains and DNS records.", no_args_is_help=True)
|
|
86
|
+
app.add_typer(domains_app, name="domains")
|
|
64
87
|
|
|
65
88
|
_SKETCH_RECEIPT_FIELDS = {
|
|
66
89
|
"app", "tier", "slug", "status", "lifecycle_state", "trial_started_at",
|
|
@@ -257,7 +280,7 @@ def dev(
|
|
|
257
280
|
if output.strip():
|
|
258
281
|
typer.echo(output.rstrip())
|
|
259
282
|
if not check:
|
|
260
|
-
typer.echo("Interactive local preview requires Docker; use verulla deploy to a
|
|
283
|
+
typer.echo("Interactive local preview requires Docker; use verulla deploy to a free-trial app for the remote runtime.")
|
|
261
284
|
return
|
|
262
285
|
return
|
|
263
286
|
runner = docker_runner
|
|
@@ -434,16 +457,16 @@ def deploy(
|
|
|
434
457
|
try:
|
|
435
458
|
receipt = _safe_sketch_receipt(get_sketch_status(api_url.rstrip("/"), token, deployment["app"]))
|
|
436
459
|
except AppsError as exc:
|
|
437
|
-
typer.echo(f"Deployment succeeded, but the
|
|
460
|
+
typer.echo(f"Deployment succeeded, but the free-trial receipt could not be loaded: {exc}", err=True)
|
|
438
461
|
raise typer.Exit(code=1) from exc
|
|
439
|
-
typer.echo("
|
|
462
|
+
typer.echo("Free-trial hand-off")
|
|
440
463
|
typer.echo(f"Public URL: {receipt.get('url') or deployment.get('url') or '(not provided)'}")
|
|
441
464
|
typer.echo(f"Expires at: {receipt.get('expires_at') or '(expiry not provided by API)'}")
|
|
442
465
|
typer.echo(f"Owner claim status: {receipt.get('claim_status') or '(not provided)'}")
|
|
443
466
|
typer.echo("Trial: free for 72 hours from first successful deployment; no custom domain.")
|
|
444
467
|
if receipt.get("limits_url"):
|
|
445
468
|
typer.echo(f"Limits: {receipt['limits_url']}")
|
|
446
|
-
typer.echo(f"Next: share the public URL with the verified owner, then run `verulla
|
|
469
|
+
typer.echo(f"Next: share the public URL with the verified owner, then run `verulla trial status {deployment['app']}` before the free trial expires.")
|
|
447
470
|
|
|
448
471
|
|
|
449
472
|
secrets_app = typer.Typer(help="Manage per-tenant secrets and environment variables.")
|
|
@@ -610,6 +633,8 @@ def apps(
|
|
|
610
633
|
f"{row['app']} {row['status']} runtime={row.get('runtime_health', 'starting')} "
|
|
611
634
|
f"{row.get('url') or '-'}"
|
|
612
635
|
)
|
|
636
|
+
if row.get("next_step") is not None:
|
|
637
|
+
typer.echo(f" next_step: {json.dumps(row['next_step'], separators=(',', ':'))}")
|
|
613
638
|
if row.get("runtime_health_reason"):
|
|
614
639
|
typer.echo(f" runtime_health_reason: {row['runtime_health_reason']}")
|
|
615
640
|
|
|
@@ -628,11 +653,11 @@ def wallet(
|
|
|
628
653
|
|
|
629
654
|
@app.command()
|
|
630
655
|
def usage(
|
|
631
|
-
app_name: str | None = typer.Argument(None, help="Optional
|
|
656
|
+
app_name: str | None = typer.Argument(None, help="Optional Pro app name; omit to show all Pro apps."),
|
|
632
657
|
month: str | None = typer.Option(None, "--month", help="Calendar usage month in YYYY-MM format (legacy view)."),
|
|
633
658
|
api_url: str = typer.Option(DEFAULT_API_URL, "--api-url", envvar="VERULLA_API_URL", show_default=True, help="Verulla control plane base URL."),
|
|
634
659
|
) -> None:
|
|
635
|
-
"""Show
|
|
660
|
+
"""Show Pro term allowances, usage, projected costs and spending headroom."""
|
|
636
661
|
try:
|
|
637
662
|
if month is not None:
|
|
638
663
|
result = get_usage_summary(api_url.rstrip("/"), get_token(), month=month)
|
|
@@ -687,12 +712,12 @@ def topup(
|
|
|
687
712
|
|
|
688
713
|
|
|
689
714
|
@app.command()
|
|
690
|
-
def
|
|
691
|
-
app_name: str = typer.Argument(..., metavar="APP", help="App to
|
|
715
|
+
def pro(
|
|
716
|
+
app_name: str = typer.Argument(..., metavar="APP", help="App to move from its free trial to paid Pro."),
|
|
692
717
|
yes: bool = typer.Option(False, "--yes", "-y", help="Skip confirmation."),
|
|
693
718
|
api_url: str = typer.Option(DEFAULT_API_URL, "--api-url", envvar="VERULLA_API_URL", show_default=True, help="Verulla control plane base URL."),
|
|
694
719
|
) -> None:
|
|
695
|
-
"""
|
|
720
|
+
"""Move an app from its free 72-hour trial to paid Pro at the published price."""
|
|
696
721
|
try:
|
|
697
722
|
token = get_token()
|
|
698
723
|
except DeviceLoginError:
|
|
@@ -700,14 +725,20 @@ def live(
|
|
|
700
725
|
raise typer.Exit(code=1)
|
|
701
726
|
try:
|
|
702
727
|
app_status = get_app(api_url.rstrip("/"), token, app_name)
|
|
728
|
+
if app_status.get("tier_id", app_status.get("tier")) == "live":
|
|
729
|
+
typer.echo("This app is already on Pro.")
|
|
730
|
+
raise typer.Exit(code=0)
|
|
703
731
|
if app_status.get("live_activation_available") is not True:
|
|
704
|
-
typer.echo(
|
|
732
|
+
typer.echo(
|
|
733
|
+
"Pro upgrades are not available right now. Your app's data is kept for 14 days after the free trial ends.",
|
|
734
|
+
err=True,
|
|
735
|
+
)
|
|
705
736
|
raise typer.Exit(code=1)
|
|
706
737
|
spend = get_spend_summary(api_url.rstrip("/"), token)
|
|
707
738
|
currency = spend.get("currency", "USD")
|
|
708
739
|
contract = get_pricing(api_url.rstrip("/"), token)
|
|
709
740
|
except AppsError as exc:
|
|
710
|
-
typer.echo(f"Error checking
|
|
741
|
+
typer.echo(f"Error checking Pro availability or spending-limit headroom: {exc}", err=True)
|
|
711
742
|
raise typer.Exit(code=1) from exc
|
|
712
743
|
live_tier = next((tier for tier in contract.get("tiers", []) if tier.get("id") == "live"), {})
|
|
713
744
|
prices = live_tier.get("prices_cents", {})
|
|
@@ -715,7 +746,7 @@ def live(
|
|
|
715
746
|
if price_cents is None:
|
|
716
747
|
price_cents = live_tier.get("price_usd_cents") if currency == "USD" else live_tier.get("price_cad_cents")
|
|
717
748
|
if currency not in {"USD", "CAD"} or not isinstance(price_cents, int):
|
|
718
|
-
typer.echo(f"Unsupported wallet currency {currency!r} for
|
|
749
|
+
typer.echo(f"Unsupported wallet currency {currency!r} for Pro pricing.", err=True)
|
|
719
750
|
raise typer.Exit(code=1)
|
|
720
751
|
symbol = "C$" if currency == "CAD" else "US$"
|
|
721
752
|
price_text = f"{symbol}{price_cents // 100:,}.{price_cents % 100:02d}"
|
|
@@ -724,16 +755,20 @@ def live(
|
|
|
724
755
|
headroom = f"{symbol}{remaining // 100:,}.{remaining % 100:02d}"
|
|
725
756
|
else:
|
|
726
757
|
headroom = "no spending limit set"
|
|
727
|
-
typer.echo(f"
|
|
758
|
+
typer.echo(f"Pro costs {price_text} per 30 days ({currency}).")
|
|
728
759
|
typer.echo(f"Spending-limit headroom: {headroom}.")
|
|
729
760
|
if not yes:
|
|
730
|
-
typer.confirm(f"
|
|
761
|
+
typer.confirm(f"Move {app_name!r} to Pro for {price_text} per 30 days?", abort=True)
|
|
731
762
|
try:
|
|
732
763
|
result = activate_app(api_url.rstrip("/"), token, app_name, str(uuid.uuid4()))
|
|
733
764
|
except AppsError as exc:
|
|
734
765
|
typer.echo(f"Error: {exc}", err=True)
|
|
735
766
|
raise typer.Exit(code=1) from exc
|
|
736
|
-
typer.echo(f"{app_name} is
|
|
767
|
+
typer.echo(f"{app_name} is Pro through {result.get('paid_through')} (price {result.get('pricing_version')}).")
|
|
768
|
+
|
|
769
|
+
|
|
770
|
+
# Deprecated command name retained for existing scripts and agents.
|
|
771
|
+
app.command("live", hidden=True)(pro)
|
|
737
772
|
|
|
738
773
|
|
|
739
774
|
@app.command()
|
|
@@ -755,13 +790,16 @@ def status(
|
|
|
755
790
|
f"{row['app']} {row['status']} runtime={row.get('runtime_health', 'starting')} "
|
|
756
791
|
f"{row.get('url') or '-'}"
|
|
757
792
|
)
|
|
793
|
+
if row.get("next_step") is not None:
|
|
794
|
+
typer.echo(f" next_step: {json.dumps(row['next_step'], separators=(',', ':'))}")
|
|
758
795
|
if row.get("runtime_health_reason"):
|
|
759
796
|
typer.echo(f" runtime_health_reason: {row['runtime_health_reason']}")
|
|
760
797
|
else:
|
|
761
798
|
row = get_app(api_url.rstrip("/"), token, app_name)
|
|
762
|
-
for key in ("app", "tier_id", "pricing_version", "paid_through", "renewal_date", "status", "runtime_health", "runtime_health_reason", "latest_deployment_id", "source_sha", "function_count", "url", "updated_at", "error", "functions"):
|
|
799
|
+
for key in ("app", "tier_id", "pricing_version", "paid_through", "renewal_date", "status", "next_step", "runtime_health", "runtime_health_reason", "latest_deployment_id", "source_sha", "function_count", "url", "updated_at", "error", "functions"):
|
|
763
800
|
if key in row:
|
|
764
|
-
|
|
801
|
+
value = json.dumps(row[key], separators=(',', ':')) if key == "next_step" else row[key]
|
|
802
|
+
typer.echo(f"{key}: {value}")
|
|
765
803
|
except AppsError as exc:
|
|
766
804
|
typer.echo(f"Error: {exc}", err=True)
|
|
767
805
|
raise typer.Exit(code=1) from exc
|
|
@@ -775,7 +813,7 @@ def sketch_events(
|
|
|
775
813
|
json_output: bool = typer.Option(False, "--json", help="Print the shared API event envelope as JSON."),
|
|
776
814
|
api_url: str = typer.Option(DEFAULT_API_URL, "--api-url", envvar="VERULLA_API_URL", show_default=True),
|
|
777
815
|
) -> None:
|
|
778
|
-
"""Poll durable
|
|
816
|
+
"""Poll durable free-trial countdown events after the supplied cursor."""
|
|
779
817
|
result = _auth_api_call(
|
|
780
818
|
get_sketch_events, api_url.rstrip("/"), _agent_token(), app_name,
|
|
781
819
|
cursor=cursor, limit=limit,
|
|
@@ -794,7 +832,7 @@ def sketch_status(
|
|
|
794
832
|
json_output: bool = typer.Option(False, "--json", help="Print the receipt as JSON."),
|
|
795
833
|
api_url: str = typer.Option(DEFAULT_API_URL, "--api-url", envvar="VERULLA_API_URL", show_default=True, help="Verulla control plane base URL."),
|
|
796
834
|
) -> None:
|
|
797
|
-
"""Show the shared
|
|
835
|
+
"""Show the shared free-trial lifecycle receipt for APP."""
|
|
798
836
|
try:
|
|
799
837
|
token = get_token()
|
|
800
838
|
except DeviceLoginError:
|
|
@@ -813,6 +851,10 @@ def sketch_status(
|
|
|
813
851
|
typer.echo(f"{key}: {receipt[key]}")
|
|
814
852
|
|
|
815
853
|
|
|
854
|
+
trial_app.command("events")(sketch_events)
|
|
855
|
+
trial_app.command("status")(sketch_status)
|
|
856
|
+
|
|
857
|
+
|
|
816
858
|
@owner_app.command("claim")
|
|
817
859
|
def owner_claim(
|
|
818
860
|
app_name: str = typer.Argument(..., metavar="APP"),
|
|
@@ -1054,6 +1096,56 @@ def _auth_api_call(fn, *args, **kwargs):
|
|
|
1054
1096
|
raise typer.Exit(code=1) from exc
|
|
1055
1097
|
|
|
1056
1098
|
|
|
1099
|
+
def _print_dns_instructions(records: list[dict]) -> None:
|
|
1100
|
+
for record in records:
|
|
1101
|
+
destination = record.get("target", record.get("value", ""))
|
|
1102
|
+
if record["type"] == "ALIAS/ANAME":
|
|
1103
|
+
typer.echo(
|
|
1104
|
+
f"At the zone apex, add a provider-flattened ALIAS/ANAME (or CNAME-flattening) "
|
|
1105
|
+
f"record named {record['name']} pointing to {destination}."
|
|
1106
|
+
)
|
|
1107
|
+
else:
|
|
1108
|
+
typer.echo(f"Add a {record['type']} record named {record['name']} pointing to {destination}.")
|
|
1109
|
+
typer.echo(f" {record.get('purpose', '')}")
|
|
1110
|
+
|
|
1111
|
+
|
|
1112
|
+
@domains_app.command("add")
|
|
1113
|
+
def domains_add(
|
|
1114
|
+
app_name: str = typer.Argument(..., metavar="APP"),
|
|
1115
|
+
host: str = typer.Argument(..., metavar="HOST"),
|
|
1116
|
+
api_url: str = typer.Option(DEFAULT_API_URL, "--api-url", envvar="VERULLA_API_URL", show_default=True),
|
|
1117
|
+
) -> None:
|
|
1118
|
+
"""Claim a custom hostname and print its required DNS records."""
|
|
1119
|
+
result = _auth_api_call(api_add_domain, api_url.rstrip("/"), _agent_token(), app_name, host)
|
|
1120
|
+
_print_dns_instructions(result.get("dns_instructions", []))
|
|
1121
|
+
typer.echo(json.dumps({key: value for key, value in result.items() if key != "dns_instructions"}, indent=2))
|
|
1122
|
+
|
|
1123
|
+
|
|
1124
|
+
@domains_app.command("status")
|
|
1125
|
+
def domains_status(
|
|
1126
|
+
app_name: str = typer.Argument(..., metavar="APP"),
|
|
1127
|
+
api_url: str = typer.Option(DEFAULT_API_URL, "--api-url", envvar="VERULLA_API_URL", show_default=True),
|
|
1128
|
+
) -> None:
|
|
1129
|
+
"""List custom domains and restate their persistent DNS records."""
|
|
1130
|
+
result = _auth_api_call(api_list_domains, api_url.rstrip("/"), _agent_token(), app_name)
|
|
1131
|
+
for domain in result.get("domains", []):
|
|
1132
|
+
typer.echo(f"{domain['host']}: {domain['status']}")
|
|
1133
|
+
_print_dns_instructions(domain.get("dns_records", []))
|
|
1134
|
+
typer.echo(json.dumps(result, indent=2))
|
|
1135
|
+
|
|
1136
|
+
|
|
1137
|
+
@domains_app.command("verify")
|
|
1138
|
+
def domains_verify(
|
|
1139
|
+
app_name: str = typer.Argument(..., metavar="APP"),
|
|
1140
|
+
host: str = typer.Argument(..., metavar="HOST"),
|
|
1141
|
+
api_url: str = typer.Option(DEFAULT_API_URL, "--api-url", envvar="VERULLA_API_URL", show_default=True),
|
|
1142
|
+
) -> None:
|
|
1143
|
+
"""Request DNS verification and print any rotated DNS instructions."""
|
|
1144
|
+
result = _auth_api_call(api_verify_domain, api_url.rstrip("/"), _agent_token(), app_name, host)
|
|
1145
|
+
_print_dns_instructions(result.get("dns_instructions", []))
|
|
1146
|
+
typer.echo(json.dumps({key: value for key, value in result.items() if key != "dns_instructions"}, indent=2))
|
|
1147
|
+
|
|
1148
|
+
|
|
1057
1149
|
@auth_app.command("show")
|
|
1058
1150
|
def auth_show(app_name: str = typer.Argument(..., metavar="APP"), api_url: str = typer.Option(DEFAULT_API_URL, "--api-url", envvar="VERULLA_API_URL", show_default=True)) -> None:
|
|
1059
1151
|
"""Show the app's AuthPolicy and version."""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|