Skip to content

fix(logs): correct the --env help text — omitting it reads both envs - #624

Merged
davidsu merged 1 commit into
mainfrom
fix/logs-env-help-omit
Sep 15, 2026
Merged

davidsu merged 1 commit into
mainfrom
fix/logs-env-help-omit

Conversation

@davidsu

@davidsu davidsu commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Note

Description

The --env option on base44 logs was documented as defaulting to preview, which is not what the command does. Omitting the flag applies no env filter at all, so the API returns both preview and prod rows. This PR corrects the help text to say Omit to read both. and adds a help-output assertion covering the new wording.

Related Issue

None

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • packages/cli/src/cli/commands/project/logs.ts: replaced the misleading Default: preview suffix on the --env option description with Omit to read both.
  • packages/cli/tests/cli/logs.spec.ts: added an assertion to the existing logs --help test so the corrected wording is pinned.

Supporting analysis of why the old text was wrong:

  • buildFilters (logs.ts:71-73) sets filters.env only when the flag is present, so no flag means no env key in the query sent to the API.
  • The options.env ?? "preview" fallback at logs.ts:474 is passed only to formatLogs, which uses it solely to pick the empty-state message (logs.ts:312-318). It never narrows what gets fetched.

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated docs/ (AGENTS.md) if I made architectural changes

Additional Notes

Help-text only — no runtime behavior changes. The command already read both environments when --env was omitted; only the documentation of that behavior was wrong. Note that the empty-state message still assumes preview when the flag is absent (logs.ts:314-315), which is out of scope here but may be worth a follow-up.

The PR author reports bun run test tests/cli/logs.spec.ts passing (49 tests) plus a negative-control revert that fails the new assertion; I was not able to execute the suite in this environment to confirm, so the testing boxes above reflect only what is verifiable from the diff.


🤖 Generated by Claude | 2026-09-14 10:02 UTC | af1a615

`base44 logs --help` claimed `--env` defaults to `preview`, but omitting it
sends no env filter at all: `buildFilters` only sets `filters.env` when the
flag is given (logs.ts:71-73), so the API returns both preview and prod rows.
The `options.env ?? "preview"` fallback further down only picks the empty-state
message for `formatLogs`, it never narrows the query.

Say what the flag actually does, and assert the wording in the help spec.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.1.14-pr.624.af1a615

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.1.14-pr.624.af1a615"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.1.14-pr.624.af1a615"
  }
}

Preview published to npm registry — try new features instantly!

@davidsu
davidsu merged commit 19f6f11 into main Sep 15, 2026
15 checks passed
@davidsu
davidsu deleted the fix/logs-env-help-omit branch September 15, 2026 07:45
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