Skip to content

Add site + dashboard open commands#169

Merged
kfirstri merged 9 commits intomainfrom
pavelta-browse
Feb 2, 2026
Merged

Add site + dashboard open commands#169
kfirstri merged 9 commits intomainfrom
pavelta-browse

Conversation

@Paveltarno
Copy link
Contributor

@Paveltarno Paveltarno commented Feb 1, 2026

Note

Description

Adds a new site open command that opens the published site URL in the user's browser. This PR also refactors the command structure by introducing parent commands (site and dashboard) with subcommands (deploy/open), making the CLI more organized and following a consistent pattern with other command groups.

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

  • Added new site open command that fetches and opens the published site URL using the /api/apps/platform/{id}/published-url endpoint
  • Created getSiteUrl() utility function in src/core/site/api.ts with proper error handling and schema validation using safeParse pattern
  • Refactored site commands into a proper command group structure with src/cli/commands/site/index.ts as parent command
  • Created dashboard command group with src/cli/commands/dashboard/index.ts as parent, moved existing dashboard command to dashboard open
  • Modified getSiteDeployCommand() to return just the deploy subcommand instead of the entire site command
  • Integrated open package to launch URLs in browser (skipped in CI environments via process.env.CI check)
  • Added comprehensive test coverage in tests/cli/site_open.spec.ts including success, auth, and error scenarios
  • Updated existing dashboard tests to use new dashboard open command syntax
  • Extended Base44APIMock with mockSiteUrl() and mockSiteUrlError() helpers for testing

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 AGENTS.md if I made architectural changes

Additional Notes

The open command will not attempt to open a browser in CI environments (checks process.env.CI). The command uses the new /api/apps/platform/{id}/published-url endpoint to fetch the live site URL dynamically. Both site and dashboard commands now follow a consistent parent-subcommand pattern, improving discoverability and organization. The command requires authentication and project context. This PR uses the safeParse pattern for consistent error handling in the getSiteUrl function.


🤖 Generated by Claude | 2026-02-02 13:29 UTC

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2026

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.0.26-pr.169.a3a6068

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.0.26-pr.169.a3a6068"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.0.26-pr.169.a3a6068"
  }
}

Preview published to npm registry — try new features instantly!

@Paveltarno Paveltarno changed the title Add site browse command Add site + dashboard open commands Feb 2, 2026
@Paveltarno Paveltarno marked this pull request as ready for review February 2, 2026 12:22
@claude
Copy link

claude bot commented Feb 2, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@claude
Copy link

claude bot commented Feb 2, 2026


Code review

No issues found. Checked for bugs and CLAUDE.md compliance.


@github-project-automation github-project-automation bot moved this from Backlog to In review in CLI Development Feb 2, 2026
@kfirstri kfirstri merged commit bca54b1 into main Feb 2, 2026
7 checks passed
@kfirstri kfirstri deleted the pavelta-browse branch February 2, 2026 15:03
@github-project-automation github-project-automation bot moved this from In review to Done in CLI Development Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants