Skip to content

Document the CLI refusing a project .env target or credential - #796

Open
kriszyp wants to merge 5 commits into
mainfrom
docs/cli-dotenv-refusal
Open

kriszyp wants to merge 5 commits into
mainfrom
docs/cli-dotenv-refusal

Conversation

@kriszyp

@kriszyp kriszyp commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

⊙ Problem

Refuse a project .env CLI target or credential, and save logins under the client's target (harper#4001) makes the harper CLI stop with an error when a project's .env sets its target, credentials or connection settings. Our docs still tell readers to put HARPER_CLI_TARGET there and say harper login writes it. On that CLI, the safe-deployments guide fails at its first step.

🤔 Are docs enough?

Not alone. npm create harper@latest still writes HARPER_CLI_TARGET in .env, so a new project's harper login and npm run deploy fail on a 5.4 CLI. These docs tell readers to remove the line, but create-harper needs its own change before 5.4 ships. No issue tracks it yet.

💡 Solution

  • One section holds the rule: the refused names, the exceptions and how to migrate. Other pages keep a short summary and link to it.
  • A new list shows how the CLI picks a target, because the saved target applies to the whole OS user, not one project.
  • The safe-deployments guide now exports HARPER_CLI_TARGET and no longer copies .env into a staged release.
  • The 5.4 notes get an upgrade note and a section.

⚖️ Alternatives

🤔 Export the target in the guide, or rely on the saved login?

Export. The saved target moves with each login, so a bare rollback command could reach another cluster. The cost is setting it again in each new shell.

🤔 Document dotenv -- harper deploy?

Yes, once, with a warning. harper#4001 lists this option, but it passes the CLI everything in the file, bypassing the check. The guide does not use it.

🤔 How does a team share a target now?

target= in a package.json script replaces the old advice to commit .env. The URL stays visible in review, and a script needs no new dependency.

🔧 Changes

reference/components/applications.md and the getting-started guide also show harper login, with no note: neither scaffolds with create-harper, and the error names the fix. The v4 snapshot is unchanged. These pages stay here, like other open 5.4 docs PRs, until Assemble the v5 reference and open release notes from harper and harper-pro (#788) lands.

✅ Verification

  • Ran each documented behavior on a throwaway Harper built from the harper#4001 head (249786d1), with scratch HOME and ROOTPATH. The guide's export, login, deploy and staged deploy all worked.
  • format:check, lint, typecheck, test:examples and build pass. The three new anchors are in the built HTML.
What the CLI did
In the project Command Result
.env sets the target an operation, harper login <url>, list_backups (server running and stopped), harper deploy exit 1, error names the key
.env sets the target the same with target=<url> exit 1
.env sets NODE_EXTRA_CA_CERTS local get_components exit 1
.env sets https_proxy with HTTPS_PROXY exported exit 1 (Linux)
.env sets the target with it exported, or under dotenv -- runs
.env sets the target harper logout, version, status runs
.env.local sets HTTPS_PROXY; .env.example sets the target an operation runs
Clean .env harper login <url>, then a bare operation .env unchanged, last_target saved and used
Clean .env harper logout <url> last_target cleared
Clean .env npm run deploy with target= in the script deployed

Not run: Windows, and .env.vault end to end (the loader reads it through dotenv).

Depends-on: harper#4001

Refs HarperFast/harper#1927, HarperFast/harper#1928

Signed: Claude Opus 5.5 (dev-agent, dispatch task docs-harper-4001)

🤖 Generated with Claude Code

Related PRs: #788 overlaps, 2 others independent

Late Grok findings

6 surviving (highest minor) — Grok reviewed 08690bf
  • minor — release-notes/v5-lincoln/5.4.md:321 — the upgrade paragraph says "Remove the line" for any refused name. For an application value such as HTTPS_PROXY, that drops the value the component's loadEnv was supplying, and the paragraph gives no other place to put it.
  • minor — learn/administration/safe-deployments-and-rollback.mdx:84 — the staged release no longer copies .env, so values a kept loadEnv entry reads stop reaching the nodes. (previously adjudicated)
  • minor — reference/environment-variables/overview.md:66 — short summaries of the refusal rule on other pages leave out the "unless the environment sets it" exception and the full set of refused names. (previously adjudicated)
  • minor — reference/cli/authentication.md:27 — the "Local Operations" fallback (saved login, then socket) contradicts the new ordered list at reference/cli/authentication.md:37-42, which puts the environment target in between. (previously adjudicated)
  • minor — release-notes/v5-lincoln/5.4.md:315 — "That covers HARPER_CLI_*" names more than the closed list the CLI actually refuses. Same wording in the migration text at reference/cli/authentication.md:210 and release-notes/v5-lincoln/5.4.md:17. (previously adjudicated)
  • nit — reference/cli/authentication.md:189 — the list of commands that read .env doesn't name harper preview (reference/cli/commands.md:305). (previously adjudicated)

Not standing: 3 merged. Grok ran 8m (8m from launch to report); the fold adjudication (cursor-grok@08690bf95b23-bbf9ec41, claude) took 1m.

Origin — the dispatch brief this PR was written from

Document that the harper CLI refuses a project .env target or credential

Document a breaking CLI change from HarperFast/harper PR HarperFast/harper#4001 (fixes harper#1927 and harper#1928), targeted at v5.4.

What changed for users:

  • The harper CLI no longer lets a .env file in the current directory set its target, credentials or connection trust. If that file sets any of HARPER_CLI_TARGET, CLI_TARGET, HARPER_CLI_USERNAME/_PASSWORD/_OPERATION_TOKEN/_REFRESH_TOKEN (and the CLI_TARGET_* equivalents), ACTIONS_ID_TOKEN_REQUEST_URL/_TOKEN, GITHUB_REPOSITORY/GITHUB_SHA/GITHUB_REF/GITHUB_EVENT_PATH, HOME/USERPROFILE, NODE_TLS_REJECT_UNAUTHORIZED, NODE_EXTRA_CA_CERTS, SSL_CERT_FILE/SSL_CERT_DIR, NODE_USE_ENV_PROXY, HTTP_PROXY/HTTPS_PROXY/NO_PROXY (any letter case) and the shell/CI environment does not already set it, CLI operations, harper login and the backup commands stop with an error naming the keys. Values exported in the shell or CI environment work as before and win over the file. Other .env keys still load. Application runtime .env handling (harper run/dev, components) is unchanged.
  • harper login no longer appends HARPER_CLI_TARGET to the project .env; it saves the target it connected to in ~/.harperdb/credentials.json, which later commands use by default. It always saves and prints the URL the user gave, never a target named by the server's reply.
  • harper logout no longer reads .env.

Migration to document: remove HARPER_CLI_* / CLI_TARGET* lines from the project .env; then either rely on harper login <url> (saved target), pass target=<url>, export the variables in the shell or CI secrets, or load the file deliberately in an npm script (dotenv -- harper deploy). CI using harper login --for-ci output as secrets is unaffected.

Find every page in the docs that tells users to put HARPER_CLI_TARGET (or credentials) in a project .env, or that says harper login writes it there, and update it; add a short note to the CLI reference / CLI authentication page and the v5.4 release notes if the repo keeps them. Link the harper PR. No customer names.

Acceptance

One draft documentation PR covering the CLI .env change and its migration, linking HarperFast/harper#4001.

Dispatch: task docs-harper-4001 · queued by task:harper-cli-target-credential-trust-bundle · ran by claude/opus/high · worker kzyp-xps-1

Ready-For-Promotion: a792e3f urgency=normal late=folded

Review-Coverage: authored=claude; ran=gemini,cursor-composer,codex,cursor-grok; late=cursor-grok:adjudicated; adjudicated=domain; declined=muse; rounds=5; full=2 @ a792e3f

Review-Attention: skim ~2m (decisions: team-target-sharing-route, document-dotenv-cli-bypass, guide-uses-shell-export) @ a792e3f

kriszyp and others added 4 commits November 3, 2026 15:49
harper#4001 makes the harper CLI stop with an error when a .env in the
current directory sets its target, credentials or connection trust, and
harper login no longer writes .env. Add the canonical key list and migration
to the CLI authentication page, correct the pages that told readers to put
the target in .env, and add the 5.4 upgrade note. The safe-deployments guide
now exports HARPER_CLI_TARGET, since the saved target is per OS user.

Dispatch-Task: docs-harper-4001
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Short summaries named only part of the list or dropped the environment
exception, and HARPER_CLI_* overstated it: HARPER_CLI_TIMEOUT_MS still loads.
Note runtime keys for staged releases that keep loadEnv.

Dispatch-Task: docs-harper-4001
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dispatch-Task: docs-harper-4001
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dispatch-Task: docs-harper-4001
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kriszyp kriszyp added this to the v5.4 milestone Nov 3, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request updates the Harper CLI documentation for version 5.4.0, detailing the new behavior where the CLI refuses to load targets, credentials, or connection settings from a project's local .env file and instead throws an error. The feedback focuses on improving readability by ensuring that these file refusal conditions and critical limitations are presented in separate, distinct sentences rather than being combined with other concepts.

Comment thread fabric/cluster-creation-management.md Resolved
@github-actions
github-actions Bot temporarily deployed to pr-796 November 3, 2026 23:14 Inactive
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-796

This preview will update automatically when you push new commits.

Dispatch-Task: docs-harper-4001
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-796

This preview will update automatically when you push new commits.

@kriszyp
kriszyp marked this pull request as ready for review November 4, 2026 04:07
@kriszyp
kriszyp requested a review from a team as a code owner November 4, 2026 04:07
@kriszyp
kriszyp requested a review from dawsontoth November 4, 2026 04:07

This branch was successfully deployed

1 active deployment
pr-796 — a792e3f0 Deployed Nov 3, 2026 by github-actions[bot]
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.

1 participant