link: two-step workspace picker + cross-workspace --app-id - #568
Open
netanelgilad wants to merge 1 commit into
Open
link: two-step workspace picker + cross-workspace --app-id#568netanelgilad wants to merge 1 commit into
netanelgilad wants to merge 1 commit into
Conversation
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.1.7-pr.568.c08ba20Prefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.1.7-pr.568.c08ba20"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.1.7-pr.568.c08ba20"
}
}
Preview published to npm registry — try new features instantly! |
netanelgilad
force-pushed
the
claude/cli-link-workspace-picker-h5x81l
branch
2 times, most recently
from
July 15, 2026 15:06
33cadb1 to
983dab3
Compare
netanelgilad
force-pushed
the
claude/cli-link-workspace-picker-h5x81l
branch
from
July 19, 2026 09:09
983dab3 to
9beb9a4
Compare
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
force-pushed
the
claude/cli-link-workspace-picker-h5x81l
branch
from
August 2, 2026 09:36
9beb9a4 to
796f294
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Description
Reworks the existing-app selection in
base44 linkto be workspace-aware. Interactive linking becomes a two-step flow — pick a workspace (skipped when you belong to only one), then pick an app scoped to that workspace — instead of listing only apps in your personal/active workspace.--app-idis now validated directly viagetApprather than being looked up in the app list, so it links any app you can access, including apps in other workspaces. The server remains the source of truth for permissions; the CLI never filters or validates by role.Related Issue
Builds on #577 (
fix(link): list editor-created apps for linking), which landed onmainwhile this PR was open — editor-created (managed-source) apps stay linkable here. No issue is closed by this PR.Type of Change
Changes Made
link.ts— extracted thechoosebranch into two helpers:resolveExplicitAppId()validates--app-idby fetching the app directly (getApp), making cross-workspace apps linkable; 404/403 surface anInvalidInputErrorwith hints ("Check the app ID is correct", "Runbase44 linkwithout--app-idto browse apps by workspace").chooseProjectInteractively()resolves the target workspace viaresolveWorkspaceId(), then fetches and prompts for an app scoped to that workspace; returnsundefinedwhen the workspace has no apps (falls through to the existing "No projects available for linking" outro).workspace-select.ts—resolveWorkspaceId()takes an optional{ promptMessage }solinkcan ask "Which workspace is the app in?" instead of the create-oriented wording; the localoptionsvariable was renamed topromptOptionsto avoid shadowing. Doc comment updated to cover both the create and link cases.core/project/api.ts—listProjects()accepts an optional{ workspaceId }and forwards it as theworkspace_idsearch param onGET /api/apps; omitted means the server scopes to the caller's active/personal workspace.--workspace/-whelp text — now documents that the flag also scopes the app picker, not just app creation.TestAPIServer.mockGetApp()(routes on the response's ownid, so tests can mock apps other than the context app);link.spec.tsswitched frommockListProjectstomockGetAppfor the--app-id/ legacy--project-id/--projectIdcases, plus new coverage for linking an app in another workspace and for the not-found (404) error path.Testing
npm test)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
--project-id/--projectIdaliases and the--orgalias for--workspacestill work, and non-interactive runs are unaffected (resolveWorkspaceIdreturnsundefined, so the server applies its default).--app-idmanaged-source rejection were dropped to honor fix(link): list editor-created apps for linking #577, so editor-created apps remain linkable.main's editor-created-app test is kept, adapted tomockGetApp.docs/updates: this is a behavior change inside an existing command rather than an architectural one; command help text was updated in place.🤖 Generated by Claude | 2026-08-02 09:37 UTC | c08ba20