Skip to content

link: two-step workspace picker + cross-workspace --app-id#568

Open
netanelgilad wants to merge 1 commit into
claude/cli-workspaces-support-h5x81lfrom
claude/cli-link-workspace-picker-h5x81l
Open

link: two-step workspace picker + cross-workspace --app-id#568
netanelgilad wants to merge 1 commit into
claude/cli-workspaces-support-h5x81lfrom
claude/cli-link-workspace-picker-h5x81l

Conversation

@netanelgilad

@netanelgilad netanelgilad commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Note

Description

Reworks the base44 link command's existing-app selection to be workspace-aware. Interactive linking now uses a two-step flow — pick a workspace (skipped when you belong to only one), then pick an app scoped to that workspace — while --app-id is validated directly via getApp so it can link any app you can access, including apps in workspaces other than your personal one. Managed-source apps are rejected with a clear message.

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 resolveExplicitAppId() to link.ts: validates --app-id by fetching the app directly, so cross-workspace apps become linkable; surfaces a helpful InvalidInputError on 404/403 and rejects managed-source apps.
  • Added chooseProjectInteractively(): resolves the target workspace (via resolveWorkspaceId, prompting only when in more than one workspace), then lists and picks a linkable app scoped to that workspace.
  • Extended resolveWorkspaceId() with an optional promptMessage so link can ask "Which workspace is the app in?" instead of the create-oriented wording.
  • listProjects() now accepts an optional workspaceId and passes workspace_id to GET /api/apps to scope the app list.
  • getApp() now requests is_managed_source_code; AppDetailSchema parses/transforms it to isManagedSourceCode.
  • Updated the -w, --workspace help text to reflect that it also scopes the app picker.
  • Added TestAPIServer.mockGetApp() (keyed off the response's own id) and updated link.spec.ts to cover cross-workspace linking, managed-source rejection, and the not-found error path.

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

The server remains the source of truth for permissions — the CLI never filters or validates by role. Existing-app links via --app-id no longer require the app to appear in the caller's personal-scoped project list, which was the previous limitation.


🤖 Generated by Claude | 2026-07-15 15:07 UTC | e436c11

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.1.3-pr.568.e436c11

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.3-pr.568.e436c11"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.1.3-pr.568.e436c11"
  }
}

Preview published to npm registry — try new features instantly!

@netanelgilad
netanelgilad force-pushed the claude/cli-link-workspace-picker-h5x81l branch from f1c286a to 33cadb1 Compare July 15, 2026 14:51
The `link` existing-app picker was scoped to the caller's personal workspace
(the server defaults app listing to the active workspace), so apps in other
workspaces were unreachable — and `--app-id` for such an app was rejected by
the personal-scoped pre-validation.

- Interactive "link existing" now picks a workspace first (skipped when you
  belong to only one), then lists apps scoped to that workspace via the new
  listProjects({ workspaceId }) (workspace_id query param).
- `--workspace <id>` scopes that picker (in addition to its --create meaning).
- `--app-id` is now validated by fetching the app directly (getApp), so it
  links any app you can access regardless of workspace; managed-source apps
  are rejected with a clear message, and unknown/inaccessible ids get a
  friendly "not found" error.

Adds resolveListingWorkspaceId (all memberships, since linking only reads),
is_managed_source_code on getApp/AppDetail, and link specs for the
cross-workspace, managed-source, and not-found paths.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0171Y6jogaAWB1suBYaEULp1
@netanelgilad
netanelgilad force-pushed the claude/cli-link-workspace-picker-h5x81l branch from 33cadb1 to 983dab3 Compare July 15, 2026 15:06
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