docs(hosting-cli): add CLAUDE.md for reflex-hosting-cli package#6452
docs(hosting-cli): add CLAUDE.md for reflex-hosting-cli package#6452
Conversation
Captures package-specific guidance: v1 (decommissioned) vs v2 layout, the programmatic surface consumed by reflex/reflex.py, version pin and compat-branch lifecycle, env-var URL resolution, config loading, auth token storage, and the v2/utils.py compat-shim freeze.
Greptile SummaryThis PR adds Confidence Score: 4/5Safe to merge — documentation-only change with no code modifications; minor inaccuracies in CLAUDE.md do not affect runtime behavior. No code changes; two P2 documentation inaccuracies found (shim-removal threshold already satisfied, incomplete _patch_typer importability description), neither of which affects production code. packages/reflex-hosting-cli/CLAUDE.md — two minor inaccuracies noted above. Important Files Changed
Sequence DiagramsequenceDiagram
participant R as reflex/reflex.py
participant D as v2/deployments.py (hosting_cli)
participant C as v2/cli.py (login/logout/deploy)
participant H as utils/hosting.py
participant S as Hosting Service (build.reflex.dev)
R->>D: import hosting_cli (CLI group)
R->>D: check_version()
D-->>S: GET pypi.org/pypi/reflex-hosting-cli/json
R->>C: import cli as hosting_cli (programmatic)
R->>C: login()
C->>H: authenticated_token()
H-->>R: token / validated_info
R->>C: deploy(export_fn, ...)
C->>H: get_authenticated_client()
C->>H: create_deployment(...)
H-->>S: POST /deployments
S-->>H: deployment result
H-->>R: status
Reviews (1): Last reviewed commit: "docs(hosting-cli): add CLAUDE.md for the..." | Re-trigger Greptile |
|
|
||
| ## Backend URL | ||
|
|
||
| `Hosting.HOSTING_SERVICE` / `HOSTING_SERVICE_UI` resolve in this order: |
There was a problem hiding this comment.
Shim-removal threshold already satisfied
The instructions say "remove the v2/utils.py shim once minimum is past 0.6.6", but MINIMUM_REFLEX_VERSION is already set to 0.6.6.post1 — which is already past 0.6.6. A coding agent following these instructions literally could interpret the condition as currently met and delete v2/utils.py, which still re-exports dependency and hosting and may be referenced by downstream importers. Consider tightening the threshold to "once minimum is bumped past 0.6.6.post1" (or to a round version like 0.7.0) to eliminate the ambiguity.
| - v1 (`reflex_cli/cli.py`, `reflex_cli/deployments.py`) is the legacy alpha hosting service, **decommissioned 2024-12-05**. Every entry point routes through `disabled_v1_hosting()` and exits 1. Do not revive these — add new commands under `v2/`. | ||
| - v2 is the current Reflex Cloud CLI. The aggregate click group is `reflex_cli.v2.deployments.hosting_cli`; `apps`, `project`, `secrets`, plus all `vmtypes_regions` commands are attached there. | ||
| - If `typer` is importable, `hosting_cli` is rebound to a `typer.Typer` via `_patch_typer` so it composes with the main `reflex` Typer app. Don't assume `hosting_cli` is always a `click.Group`. | ||
|
|
There was a problem hiding this comment.
_patch_typer condition is under-specified
The doc says "If typer is importable, hosting_cli is rebound…", but the actual condition in deployments.py additionally checks that typer.core and typer.models are both importable (find_spec("typer.core") is not None and find_spec("typer.models") is not None). Omitting the sub-module guards could mislead an agent into thinking a bare typer install is sufficient and miss cases where only a partial typer distribution is present.
Merging this PR will not alter performance
Comparing Footnotes
|
masenf
left a comment
There was a problem hiding this comment.
in the main repo we have AGENTS.md and a CLAUDE.md is a symlink to that to have broader compatibility.
Type of change
Description
Adds
packages/reflex-hosting-cli/CLAUDE.mdso coding agents working in that package have the package-specific context that isn't covered by the repo-rootCLAUDE.md. Documents the v1 (decommissioned 2024-12-05) vs v2 layout, the programmatic surface (login/logout/deploy) consumed byreflex/reflex.py, theMINIMUM_REFLEX_VERSION/RECOMMENDED_REFLEX_VERSIONlifecycle and the compat branches that should drop with each bump, env-var resolution for the hosting URLs (incl. legacyCP_*aliases),cloud.yml/[tool.reflex-cloud]config loading with theRegionOption/VmTypeliterals, auth-token storage atReflex.DIR/hosting_v1.json, and the freeze onv2/utils.py(0.6.5→0.6.6 compat shim only).No code changes.