Skip to content

docs(hosting-cli): add CLAUDE.md for reflex-hosting-cli package#6452

Open
Kastier1 wants to merge 1 commit intomainfrom
hosting-cli-claudemd
Open

docs(hosting-cli): add CLAUDE.md for reflex-hosting-cli package#6452
Kastier1 wants to merge 1 commit intomainfrom
hosting-cli-claudemd

Conversation

@Kastier1
Copy link
Copy Markdown
Contributor

@Kastier1 Kastier1 commented May 4, 2026

Type of change

  • This change requires a documentation update

Description

Adds packages/reflex-hosting-cli/CLAUDE.md so coding agents working in that package have the package-specific context that isn't covered by the repo-root CLAUDE.md. Documents the v1 (decommissioned 2024-12-05) vs v2 layout, the programmatic surface (login/logout/deploy) consumed by reflex/reflex.py, the MINIMUM_REFLEX_VERSION/RECOMMENDED_REFLEX_VERSION lifecycle and the compat branches that should drop with each bump, env-var resolution for the hosting URLs (incl. legacy CP_* aliases), cloud.yml / [tool.reflex-cloud] config loading with the RegionOption/VmType literals, auth-token storage at Reflex.DIR/hosting_v1.json, and the freeze on v2/utils.py (0.6.5→0.6.6 compat shim only).

No code changes.

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.
@Kastier1 Kastier1 requested a review from a team as a code owner May 4, 2026 20:55
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 4, 2026

Greptile Summary

This PR adds packages/reflex-hosting-cli/CLAUDE.md to give coding agents package-specific context (v1/v2 layout, programmatic surface, version pins, URL resolution, config loading, auth storage, and style rules). The document is largely accurate against the source, with two minor documentation inaccuracies flagged below.

Confidence Score: 4/5

Safe 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

Filename Overview
packages/reflex-hosting-cli/CLAUDE.md New CLAUDE.md providing coding-agent guidelines for reflex-hosting-cli; mostly accurate but has two minor inaccuracies: the v2/utils.py removal threshold condition is already met by the current MINIMUM_REFLEX_VERSION (0.6.6.post1), and the _patch_typer importability check omits the required typer.core/typer.models sub-module guards.

Sequence Diagram

sequenceDiagram
    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
Loading

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:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 _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.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 4, 2026

Merging this PR will not alter performance

✅ 17 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing hosting-cli-claudemd (4304798) with main (a84e29b)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Copy link
Copy Markdown
Collaborator

@masenf masenf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the main repo we have AGENTS.md and a CLAUDE.md is a symlink to that to have broader compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants