Skip to content

Commit 04a6547

Browse files
committed
Phase 7: v1.0.0 polish — agents topic, help examples, api-coverage.md (v1.0.0)
- Add rc0 help agents topic (how to drive rc0 from scripts and LLM agents) - Add worked examples to --help for all key commands: zone, record, dnssec, acme, auth, tsig, messages - Raise coverage gate from 86 → 87 (actual 87.21%) - Add docs/api-coverage.md auto-generated from pinned OpenAPI spec (63/63 mapped) - Add scripts/gen_api_coverage.py to regenerate api-coverage.md - Bump version to 1.0.0; mark classifier Production/Stable
1 parent 4c87a92 commit 04a6547

14 files changed

Lines changed: 572 additions & 29 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.0.0] — v1.0.0 Polish
11+
12+
### Added
13+
- `rc0 help agents` topic — how to drive rc0 from scripts and LLM agents:
14+
machine-readable output, exit codes, dry-run, `rc0 introspect`, pagination,
15+
CI token management, and the recommended agent pattern.
16+
- `docs/api-coverage.md` auto-generated from `scripts/gen_api_coverage.py`;
17+
63/63 endpoints in the pinned OpenAPI spec mapped with ✅/⚠️ status.
18+
- `scripts/gen_api_coverage.py` — generates `docs/api-coverage.md` from the
19+
pinned spec; run with `uv run python scripts/gen_api_coverage.py`.
20+
21+
### Changed
22+
- Coverage gate raised from 86% → 87% (actual: 87.21%).
23+
- `pyproject.toml` classifier updated from Alpha → Production/Stable.
24+
- All key command help texts now include worked examples in `--help` output:
25+
`zone` (list/show/create/update/delete), `record` (list/add/update/delete),
26+
`dnssec` (sign/unsign/ack-ds), `acme` (all four commands), `auth` (login/
27+
logout/status), `tsig` (list/add/delete), `messages` (list/ack-all).
28+
1029
## [0.9.0] — Packaging & Distribution
1130

1231
### Added

‎docs/api-coverage.md‎

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# API Coverage
2+
3+
Generated from pinned OpenAPI spec v2.9.
4+
5+
| Status | Method | Endpoint | CLI Command | Notes |
6+
|--------|--------|----------|-------------|-------|
7+
| ✅ | `GET` | `/api/v1/acme/zones/{zone}/rrsets` | `rc0 acme list-challenges` | |
8+
| ✅ | `PATCH` | `/api/v1/acme/zones/{zone}/rrsets` | `rc0 acme add-challenge / remove-challenge` | |
9+
| ✅ | `GET` | `/api/v1/acme/{zone}` | `rc0 acme zone-exists` | |
10+
| ✅ | `GET` | `/api/v2/messages` | `rc0 messages poll` | |
11+
| ✅ | `GET` | `/api/v2/messages/list` | `rc0 messages list` | |
12+
| ✅ | `DELETE` | `/api/v2/messages/{id}` | `rc0 messages ack` | |
13+
| ✅ | `GET` | `/api/v2/reports/accounting` | `rc0 report accounting` | |
14+
| ✅ | `GET` | `/api/v2/reports/domainlist` | `rc0 report domainlist` | |
15+
| ✅ | `GET` | `/api/v2/reports/nxdomains` | `rc0 report nxdomains` | |
16+
| ✅ | `GET` | `/api/v2/reports/problematiczones` | `rc0 report problematic-zones` | |
17+
| ✅ | `GET` | `/api/v2/reports/queryrates` | `rc0 report queryrates` | |
18+
| ✅ | `GET` | `/api/v2/settings` | `rc0 settings show` | |
19+
| ✅ | `PUT` | `/api/v2/settings/secondaries` | `rc0 settings secondaries set` | |
20+
| ✅ | `DELETE` | `/api/v2/settings/secondaries` | `rc0 settings secondaries unset` | |
21+
| ✅ | `PUT` | `/api/v2/settings/tsig/in` | `rc0 settings tsig-in set` | |
22+
| ✅ | `DELETE` | `/api/v2/settings/tsig/in` | `rc0 settings tsig-in unset` | |
23+
| ✅ | `PUT` | `/api/v2/settings/tsig/out` | `rc0 settings tsig-out set` | |
24+
| ✅ | `DELETE` | `/api/v2/settings/tsig/out` | `rc0 settings tsig-out unset` | |
25+
| ⚠️ | `PUT` | `/api/v2/settings/tsigout` | `[DEPRECATED — no CLI command]` | [DEPRECATED] |
26+
| ⚠️ | `DELETE` | `/api/v2/settings/tsigout` | `[DEPRECATED — no CLI command]` | [DEPRECATED] |
27+
| ✅ | `GET` | `/api/v2/stats/countries` | `rc0 stats countries` | |
28+
| ✅ | `GET` | `/api/v2/stats/querycounts` | `rc0 stats queries` | |
29+
| ✅ | `GET` | `/api/v2/stats/topmagnitude` | `rc0 stats topmagnitude` | [DEPRECATED] |
30+
| ✅ | `GET` | `/api/v2/stats/topnxdomains` | `rc0 stats topnxdomains` | [DEPRECATED] |
31+
| ✅ | `GET` | `/api/v2/stats/topqnames` | `rc0 stats topqnames` | [DEPRECATED] |
32+
| ✅ | `GET` | `/api/v2/stats/topzones` | `rc0 stats topzones` | |
33+
| ✅ | `GET` | `/api/v2/tsig` | `rc0 tsig list` | |
34+
| ✅ | `POST` | `/api/v2/tsig` | `rc0 tsig add` | |
35+
| ✅ | `GET` | `/api/v2/tsig/out` | `rc0 tsig list-out` | [DEPRECATED] |
36+
| ⚠️ | `POST` | `/api/v2/tsig/out` | `[DEPRECATED — no CLI command]` | [DEPRECATED] |
37+
| ⚠️ | `PUT` | `/api/v2/tsig/out/{keyname}` | `[DEPRECATED — no CLI command]` | [DEPRECATED] |
38+
| ⚠️ | `DELETE` | `/api/v2/tsig/out/{keyname}` | `[DEPRECATED — no CLI command]` | [DEPRECATED] |
39+
| ✅ | `GET` | `/api/v2/tsig/{keyname}` | `rc0 tsig show` | |
40+
| ✅ | `PUT` | `/api/v2/tsig/{keyname}` | `rc0 tsig update` | |
41+
| ✅ | `DELETE` | `/api/v2/tsig/{keyname}` | `rc0 tsig delete` | |
42+
| ✅ | `GET` | `/api/v2/zones` | `rc0 zone list` | |
43+
| ✅ | `POST` | `/api/v2/zones` | `rc0 zone create` | |
44+
| ✅ | `GET` | `/api/v2/zones/{zone}` | `rc0 zone show` | |
45+
| ✅ | `PUT` | `/api/v2/zones/{zone}` | `rc0 zone update` | |
46+
| ✅ | `PATCH` | `/api/v2/zones/{zone}` | `rc0 zone enable / disable` | |
47+
| ✅ | `DELETE` | `/api/v2/zones/{zone}` | `rc0 zone delete` | |
48+
| ✅ | `POST` | `/api/v2/zones/{zone}/dsupdate` | `rc0 dnssec ack-ds` | |
49+
| ✅ | `GET` | `/api/v2/zones/{zone}/inbound` | `rc0 zone xfr-in show` | |
50+
| ✅ | `POST` | `/api/v2/zones/{zone}/inbound` | `rc0 zone xfr-in set` | |
51+
| ✅ | `DELETE` | `/api/v2/zones/{zone}/inbound` | `rc0 zone xfr-in unset` | |
52+
| ✅ | `POST` | `/api/v2/zones/{zone}/keyrollover` | `rc0 dnssec keyrollover` | |
53+
| ✅ | `GET` | `/api/v2/zones/{zone}/outbound` | `rc0 zone xfr-out show` | |
54+
| ✅ | `POST` | `/api/v2/zones/{zone}/outbound` | `rc0 zone xfr-out set` | |
55+
| ✅ | `DELETE` | `/api/v2/zones/{zone}/outbound` | `rc0 zone xfr-out unset` | |
56+
| ✅ | `POST` | `/api/v2/zones/{zone}/retrieve` | `rc0 zone retrieve` | |
57+
| ✅ | `GET` | `/api/v2/zones/{zone}/rrsets` | `rc0 record list` | |
58+
| ✅ | `PUT` | `/api/v2/zones/{zone}/rrsets` | `rc0 record replace-all` | |
59+
| ✅ | `PATCH` | `/api/v2/zones/{zone}/rrsets` | `rc0 record add / update / delete / apply` | |
60+
| ✅ | `DELETE` | `/api/v2/zones/{zone}/rrsets` | `rc0 record clear` | |
61+
| ✅ | `POST` | `/api/v2/zones/{zone}/sign` | `rc0 dnssec sign` | |
62+
| ✅ | `POST` | `/api/v2/zones/{zone}/simulate/dsremoved` | `rc0 dnssec simulate dsremoved` | |
63+
| ✅ | `POST` | `/api/v2/zones/{zone}/simulate/dsseen` | `rc0 dnssec simulate dsseen` | |
64+
| ✅ | `GET` | `/api/v2/zones/{zone}/stats/magnitude` | `rc0 stats zone magnitude` | [DEPRECATED] |
65+
| ✅ | `GET` | `/api/v2/zones/{zone}/stats/nxdomains` | `rc0 stats zone nxdomains` | [DEPRECATED] |
66+
| ✅ | `GET` | `/api/v2/zones/{zone}/stats/qnames` | `rc0 stats zone qnames` | [DEPRECATED] |
67+
| ✅ | `GET` | `/api/v2/zones/{zone}/stats/queries` | `rc0 stats zone queries` | |
68+
| ✅ | `GET` | `/api/v2/zones/{zone}/status` | `rc0 zone status` | |
69+
| ✅ | `POST` | `/api/v2/zones/{zone}/unsign` | `rc0 dnssec unsign` | |

‎pyproject.toml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[project]
22
name = "rc0-cli"
3-
version = "0.9.0"
3+
version = "1.0.0"
44
description = "Command line for RcodeZero DNS."
55
readme = "README.md"
66
requires-python = ">=3.14"
77
license = { text = "MIT" }
88
authors = [{ name = "Zoltán Fekete" }]
99
keywords = ["dns", "rcodezero", "cli", "anycast", "dnssec"]
1010
classifiers = [
11-
"Development Status :: 3 - Alpha",
11+
"Development Status :: 5 - Production/Stable",
1212
"Environment :: Console",
1313
"Intended Audience :: System Administrators",
1414
"License :: OSI Approved :: MIT License",
@@ -127,7 +127,7 @@ branch = true
127127
[tool.coverage.report]
128128
# Floor — prevents regressions. Mission-plan §15 target for v1.0.0 is
129129
# 90% line / 85% branch; tighten this gate as each phase lands real code.
130-
fail_under = 86
130+
fail_under = 87
131131
show_missing = true
132132
skip_covered = false
133133
exclude_lines = [

‎scripts/gen_api_coverage.py‎

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
#!/usr/bin/env python3
2+
"""Generate docs/api-coverage.md from the pinned OpenAPI spec and CLI mapping.
3+
4+
Run from the repo root:
5+
uv run python scripts/gen_api_coverage.py
6+
"""
7+
8+
from __future__ import annotations
9+
10+
import json
11+
import sys
12+
from pathlib import Path
13+
14+
REPO_ROOT = Path(__file__).parent.parent
15+
SPEC_PATH = REPO_ROOT / "tests" / "fixtures" / "openapi.json"
16+
OUT_PATH = REPO_ROOT / "docs" / "api-coverage.md"
17+
18+
# Full endpoint → CLI command mapping (extends contract test map with mutations)
19+
ENDPOINT_TO_COMMAND: dict[tuple[str, str], tuple[str, ...]] = {
20+
# ACME (v1)
21+
("GET", "/api/v1/acme/{zone}"): ("acme", "zone-exists"),
22+
("GET", "/api/v1/acme/zones/{zone}/rrsets"): ("acme", "list-challenges"),
23+
("PATCH", "/api/v1/acme/zones/{zone}/rrsets"): ("acme", "add-challenge / remove-challenge"),
24+
# Messages
25+
("GET", "/api/v2/messages"): ("messages", "poll"),
26+
("GET", "/api/v2/messages/list"): ("messages", "list"),
27+
("DELETE", "/api/v2/messages/{id}"): ("messages", "ack"),
28+
# Reports
29+
("GET", "/api/v2/reports/accounting"): ("report", "accounting"),
30+
("GET", "/api/v2/reports/domainlist"): ("report", "domainlist"),
31+
("GET", "/api/v2/reports/nxdomains"): ("report", "nxdomains"),
32+
("GET", "/api/v2/reports/problematiczones"): ("report", "problematic-zones"),
33+
("GET", "/api/v2/reports/queryrates"): ("report", "queryrates"),
34+
# Settings
35+
("GET", "/api/v2/settings"): ("settings", "show"),
36+
("PUT", "/api/v2/settings/secondaries"): ("settings", "secondaries", "set"),
37+
("DELETE", "/api/v2/settings/secondaries"): ("settings", "secondaries", "unset"),
38+
("PUT", "/api/v2/settings/tsig/in"): ("settings", "tsig-in", "set"),
39+
("DELETE", "/api/v2/settings/tsig/in"): ("settings", "tsig-in", "unset"),
40+
("PUT", "/api/v2/settings/tsig/out"): ("settings", "tsig-out", "set"),
41+
("DELETE", "/api/v2/settings/tsig/out"): ("settings", "tsig-out", "unset"),
42+
("PUT", "/api/v2/settings/tsigout"): ("[DEPRECATED — no CLI command]",),
43+
("DELETE", "/api/v2/settings/tsigout"): ("[DEPRECATED — no CLI command]",),
44+
# Stats
45+
("GET", "/api/v2/stats/countries"): ("stats", "countries"),
46+
("GET", "/api/v2/stats/querycounts"): ("stats", "queries"),
47+
("GET", "/api/v2/stats/topmagnitude"): ("stats", "topmagnitude"),
48+
("GET", "/api/v2/stats/topnxdomains"): ("stats", "topnxdomains"),
49+
("GET", "/api/v2/stats/topqnames"): ("stats", "topqnames"),
50+
("GET", "/api/v2/stats/topzones"): ("stats", "topzones"),
51+
# TSIG
52+
("GET", "/api/v2/tsig"): ("tsig", "list"),
53+
("POST", "/api/v2/tsig"): ("tsig", "add"),
54+
("GET", "/api/v2/tsig/out"): ("tsig", "list-out"),
55+
("POST", "/api/v2/tsig/out"): ("[DEPRECATED — no CLI command]",),
56+
("PUT", "/api/v2/tsig/out/{keyname}"): ("[DEPRECATED — no CLI command]",),
57+
("DELETE", "/api/v2/tsig/out/{keyname}"): ("[DEPRECATED — no CLI command]",),
58+
("GET", "/api/v2/tsig/{keyname}"): ("tsig", "show"),
59+
("PUT", "/api/v2/tsig/{keyname}"): ("tsig", "update"),
60+
("DELETE", "/api/v2/tsig/{keyname}"): ("tsig", "delete"),
61+
# Zones
62+
("GET", "/api/v2/zones"): ("zone", "list"),
63+
("POST", "/api/v2/zones"): ("zone", "create"),
64+
("GET", "/api/v2/zones/{zone}"): ("zone", "show"),
65+
("PUT", "/api/v2/zones/{zone}"): ("zone", "update"),
66+
("PATCH", "/api/v2/zones/{zone}"): ("zone", "enable / disable"),
67+
("DELETE", "/api/v2/zones/{zone}"): ("zone", "delete"),
68+
("GET", "/api/v2/zones/{zone}/inbound"): ("zone", "xfr-in", "show"),
69+
("POST", "/api/v2/zones/{zone}/inbound"): ("zone", "xfr-in", "set"),
70+
("DELETE", "/api/v2/zones/{zone}/inbound"): ("zone", "xfr-in", "unset"),
71+
("POST", "/api/v2/zones/{zone}/keyrollover"): ("dnssec", "keyrollover"),
72+
("GET", "/api/v2/zones/{zone}/outbound"): ("zone", "xfr-out", "show"),
73+
("POST", "/api/v2/zones/{zone}/outbound"): ("zone", "xfr-out", "set"),
74+
("DELETE", "/api/v2/zones/{zone}/outbound"): ("zone", "xfr-out", "unset"),
75+
("GET", "/api/v2/zones/{zone}/rrsets"): ("record", "list"),
76+
("PATCH", "/api/v2/zones/{zone}/rrsets"): ("record", "add / update / delete / apply"),
77+
("PUT", "/api/v2/zones/{zone}/rrsets"): ("record", "replace-all"),
78+
("DELETE", "/api/v2/zones/{zone}/rrsets"): ("record", "clear"),
79+
("POST", "/api/v2/zones/{zone}/retrieve"): ("zone", "retrieve"),
80+
("POST", "/api/v2/zones/{zone}/sign"): ("dnssec", "sign"),
81+
("GET", "/api/v2/zones/{zone}/simulate/dsremoved"): ("dnssec", "simulate", "dsremoved"),
82+
("POST", "/api/v2/zones/{zone}/simulate/dsremoved"): ("dnssec", "simulate", "dsremoved"),
83+
("GET", "/api/v2/zones/{zone}/simulate/dsseen"): ("dnssec", "simulate", "dsseen"),
84+
("POST", "/api/v2/zones/{zone}/simulate/dsseen"): ("dnssec", "simulate", "dsseen"),
85+
("GET", "/api/v2/zones/{zone}/stats/magnitude"): ("stats", "zone", "magnitude"),
86+
("GET", "/api/v2/zones/{zone}/stats/nxdomains"): ("stats", "zone", "nxdomains"),
87+
("GET", "/api/v2/zones/{zone}/stats/qnames"): ("stats", "zone", "qnames"),
88+
("GET", "/api/v2/zones/{zone}/stats/queries"): ("stats", "zone", "queries"),
89+
("GET", "/api/v2/zones/{zone}/status"): ("zone", "status"),
90+
("POST", "/api/v2/zones/{zone}/unsign"): ("dnssec", "unsign"),
91+
("POST", "/api/v2/zones/{zone}/dsupdate"): ("dnssec", "ack-ds"),
92+
}
93+
94+
95+
def main() -> int:
96+
spec = json.loads(SPEC_PATH.read_text(encoding="utf-8"))
97+
spec_version = spec.get("info", {}).get("version", "unknown")
98+
99+
rows: list[tuple[str, str, bool, str, str]] = [] # (method, path, deprecated, command, status)
100+
unmapped: list[tuple[str, str]] = []
101+
102+
method_order = {"get": 0, "post": 1, "put": 2, "patch": 3, "delete": 4}
103+
104+
for path, path_item in sorted(spec["paths"].items()):
105+
for method in sorted(path_item.keys(), key=lambda m: method_order.get(m, 99)):
106+
if method not in method_order:
107+
continue
108+
op = path_item[method]
109+
deprecated = op.get("deprecated", False)
110+
key = (method.upper(), path)
111+
cmd = ENDPOINT_TO_COMMAND.get(key)
112+
if cmd is None:
113+
unmapped.append(key)
114+
rows.append((method.upper(), path, deprecated, "", "❌"))
115+
elif cmd[0].startswith("[DEPRECATED"):
116+
rows.append((method.upper(), path, deprecated, cmd[0], "⚠️"))
117+
else:
118+
cmd_str = "rc0 " + " ".join(cmd)
119+
rows.append((method.upper(), path, deprecated, cmd_str, "✅"))
120+
121+
lines: list[str] = [
122+
"# API Coverage",
123+
"",
124+
f"Generated from pinned OpenAPI spec v{spec_version}.",
125+
"",
126+
"| Status | Method | Endpoint | CLI Command | Notes |",
127+
"|--------|--------|----------|-------------|-------|",
128+
]
129+
for method, path, deprecated, cmd, status in rows:
130+
dep_note = "[DEPRECATED]" if deprecated else ""
131+
lines.append(f"| {status} | `{method}` | `{path}` | `{cmd}` | {dep_note} |")
132+
133+
if unmapped:
134+
lines += ["", "## Unmapped endpoints", ""]
135+
for method, path in unmapped:
136+
lines.append(f"- `{method} {path}`")
137+
138+
lines.append("")
139+
OUT_PATH.write_text("\n".join(lines), encoding="utf-8")
140+
mapped = sum(1 for r in rows if r[4] == "✅")
141+
total = len(rows)
142+
print(f"Generated {OUT_PATH} — {mapped}/{total} endpoints mapped.")
143+
if unmapped:
144+
print(f"WARNING: {len(unmapped)} unmapped endpoints:", file=sys.stderr)
145+
for m, p in unmapped:
146+
print(f" {m} {p}", file=sys.stderr)
147+
return 1
148+
return 0
149+
150+
151+
if __name__ == "__main__":
152+
sys.exit(main())

‎src/rc0/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
from __future__ import annotations
44

5-
__version__ = "0.9.0"
5+
__version__ = "1.0.0"
66

77
__all__ = ["__version__"]

‎src/rc0/commands/acme.py‎

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@ def _render_mutation(result: DryRunResult | dict[str, object], state: AppState)
7272

7373
@app.command("zone-exists")
7474
def zone_exists_cmd(ctx: typer.Context, zone: ZoneArg) -> None:
75-
"""Check if a zone is configured for ACME. API: GET /api/v1/acme/{zone}"""
75+
"""Check if a zone is configured for ACME. API: GET /api/v1/acme/{zone}
76+
77+
Examples:
78+
79+
rc0 acme zone-exists example.com
80+
rc0 acme zone-exists example.com -o json
81+
"""
7682
state: AppState = ctx.obj
7783
with _acme_client(state) as client:
7884
result = acme_api.zone_exists(client, zone)
@@ -93,7 +99,13 @@ def list_challenges_cmd(
9399
] = None,
94100
fetch_all: Annotated[bool, typer.Option("--all", help="Auto-paginate every page.")] = False,
95101
) -> None:
96-
"""List ACME challenge TXT records for a zone. API: GET /api/v1/acme/zones/{zone}/rrsets"""
102+
"""List ACME challenge TXT records for a zone. API: GET /api/v1/acme/zones/{zone}/rrsets
103+
104+
Examples:
105+
106+
rc0 acme list-challenges example.com
107+
rc0 acme list-challenges example.com -o json
108+
"""
97109
state: AppState = ctx.obj
98110
with _acme_client(state) as client:
99111
records = acme_api.list_challenges(
@@ -113,7 +125,16 @@ def add_challenge_cmd(
113125
value: Annotated[str, typer.Option("--value", help="Challenge token value.")],
114126
ttl: Annotated[int, typer.Option("--ttl", min=1, help="TTL in seconds.")] = 60,
115127
) -> None:
116-
"""Add an ACME DNS-01 challenge TXT record. API: PATCH /api/v1/acme/zones/{zone}/rrsets"""
128+
"""Add an ACME DNS-01 challenge TXT record. API: PATCH /api/v1/acme/zones/{zone}/rrsets
129+
130+
Requires an ACME-scoped token (see `rc0 help authentication`).
131+
132+
Examples:
133+
134+
rc0 acme add-challenge example.com --value abc123token
135+
rc0 acme add-challenge example.com --value abc123token --ttl 120
136+
rc0 acme add-challenge example.com --value abc123token --dry-run -o json
137+
"""
117138
state: AppState = ctx.obj
118139
with _acme_client(state) as client:
119140
result = acme_write.add_challenge(
@@ -128,7 +149,16 @@ def add_challenge_cmd(
128149

129150
@app.command("remove-challenge")
130151
def remove_challenge_cmd(ctx: typer.Context, zone: ZoneArg) -> None:
131-
"""Remove ACME challenge TXT records from a zone. API: PATCH /api/v1/acme/zones/{zone}/rrsets"""
152+
"""Remove ACME challenge TXT records from a zone. API: PATCH /api/v1/acme/zones/{zone}/rrsets
153+
154+
Prompts for confirmation unless -y is passed.
155+
156+
Examples:
157+
158+
rc0 acme remove-challenge example.com
159+
rc0 acme remove-challenge example.com -y
160+
rc0 acme remove-challenge example.com --dry-run -o json
161+
"""
132162
state: AppState = ctx.obj
133163
if not state.dry_run and not state.yes:
134164
confirm_yes_no(f"Remove all ACME challenge TXT records from {zone}?")

‎src/rc0/commands/auth.py‎

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,14 @@ def login(
3838
),
3939
] = False,
4040
) -> None:
41-
"""Prompt for an API token, validate it, and store it."""
41+
"""Prompt for an API token, validate it, and store it.
42+
43+
Examples:
44+
45+
rc0 auth login
46+
rc0 auth login --token "$RC0_API_TOKEN"
47+
rc0 --profile staging auth login
48+
"""
4249
state: AppState = ctx.obj
4350
raw_token = token or getpass.getpass("API token: ")
4451
if not raw_token:
@@ -62,7 +69,13 @@ def login(
6269

6370
@app.command("logout")
6471
def logout(ctx: typer.Context) -> None:
65-
"""Remove the stored token for the active profile."""
72+
"""Remove the stored token for the active profile.
73+
74+
Examples:
75+
76+
rc0 auth logout
77+
rc0 --profile staging auth logout
78+
"""
6679
state: AppState = ctx.obj
6780
removed = auth_core.delete_token(state.profile_name)
6881
payload = {
@@ -79,7 +92,13 @@ def logout(ctx: typer.Context) -> None:
7992

8093
@app.command("status")
8194
def status(ctx: typer.Context) -> None:
82-
"""Show where the active token is stored, without revealing its value."""
95+
"""Show where the active token is stored, without revealing its value.
96+
97+
Examples:
98+
99+
rc0 auth status
100+
rc0 --profile staging auth status
101+
"""
83102
state: AppState = ctx.obj
84103
record = auth_core.load_token(state.profile_name)
85104
if record is None:

0 commit comments

Comments
 (0)