Skip to content

docs: document --env-file CLI flag for source map auth#17099

Merged
ablaszkiewicz merged 3 commits into
masterfrom
docs/error-tracking-cli-env-file
May 29, 2026
Merged

docs: document --env-file CLI flag for source map auth#17099
ablaszkiewicz merged 3 commits into
masterfrom
docs/error-tracking-cli-env-file

Conversation

@ablaszkiewicz
Copy link
Copy Markdown
Contributor

@ablaszkiewicz ablaszkiewicz commented May 28, 2026

Changes

image

Documents the new --env-file CLI option introduced in PostHog/posthog#60465, which loads POSTHOG_CLI_* credentials from a dotenv-style file.

The note was added to the shared CLI authenticate snippet (contents/docs/error-tracking/_snippets/cli/authenticate.mdx), so it appears consistently across all CLI-based source map upload pages (cli, web, react, node, nuxt, react-native, angular, ios, android, and the upload-source-maps index).

Documented behavior, matching the shipped code in that PR:

  • Load credentials from a dotenv file via --env-file <PATH>
  • Process environment always takes precedence; the file is only read when required variables aren't already set
  • Full precedence: CLI args → process env → --env-file → credentials saved by posthog-cli login
  • Credentials are read from a single source, so POSTHOG_CLI_HOST only applies when it comes from the same source as the API key and project ID

Note: The source PR's description mentions auto-loading ./.env/.env.local, but that was an earlier draft — the merged code (commands.rs/auth.rs + the README diff) ships an explicit --env-file flag, which is what's documented here.

🤖 Generated with Claude Code

Documents the new `--env-file` option from PostHog/posthog#60465, which
loads POSTHOG_CLI_* credentials from a dotenv-style file. Added to the
shared CLI authenticate snippet so it appears across all CLI-based
source map upload pages.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

Deploy preview

Status Details Updated (UTC)
🟢 Ready View preview May 28, 2026 06:29PM

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

Vale prose linter → found 0 errors, 1 warnings, 0 suggestions in your markdown

Full report → Copy the linter results into an LLM to batch-fix issues.

Linter being weird? Update the rules!

contents/docs/error-tracking/upload-source-maps/cli.mdx — 0 errors, 1 warnings, 0 suggestions
Line Severity Message Rule
55:88 warning 'sourcemap' is a possible misspelling. PostHogBase.Spelling

ablaszkiewicz and others added 2 commits May 28, 2026 20:13
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Move the --env-file note out of the shared authenticate snippet and into
the upload-source-maps/cli page, so it no longer appears on the other
CLI-based upload pages.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ablaszkiewicz ablaszkiewicz requested review from a team, cat-ph and hpouillot May 29, 2026 09:45
@ablaszkiewicz
Copy link
Copy Markdown
Contributor Author

I'm just gonna merge this because I need this in the context mill

@ablaszkiewicz ablaszkiewicz merged commit 2b87b0d into master May 29, 2026
17 checks passed
@ablaszkiewicz ablaszkiewicz deleted the docs/error-tracking-cli-env-file branch May 29, 2026 10:53
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