Repository navigation
fix(link): never list apps when --app-id is given - #672
Merged
Merged
Conversation
`link --app-id` confirmed the ID by listing apps, a platform route that refuses a workspace key, so a CI `base44 link --app-id` with BASE44_API_KEY failed with `Error listing projects: Unauthorized`. With a workspace key it now links directly; the key is checked against the app on its first app request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tmb4PCrrV2SLRpBjkGAgXJ
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.2.1-pr.672.b7a4085Prefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.2.1-pr.672.b7a4085"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.2.1-pr.672.b7a4085"
}
}
Preview published to npm registry — try new features instantly! |
The listing only confirmed an explicit id, covered just the 50 most recently updated apps, and is refused to a workspace key. The first request that addresses the app checks the id anyway. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tmb4PCrrV2SLRpBjkGAgXJ
netanelgilad
pushed a commit
to base44/apps-examples
that referenced
this pull request
Oct 21, 2026
Contributor
Author
|
Verified end to end with this PR's preview ( Generated by Claude Code |
netanelgilad
pushed a commit
to base44/apps-examples
that referenced
this pull request
Oct 21, 2026
0.2.2 carries base44/cli#672: `link --app-id` no longer lists apps, which a workspace API key is refused on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tmb4PCrrV2SLRpBjkGAgXJ
netanelgilad
added a commit
to base44/apps-examples
that referenced
this pull request
Oct 21, 2026
0.2.2 carries base44/cli#672: `link --app-id` no longer lists apps, which a workspace API key is refused on. Claude-Session: https://claude.ai/code/session_01Tmb4PCrrV2SLRpBjkGAgXJ Co-authored-by: Claude <noreply@anthropic.com>
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
base44 link --app-id <id>used to callGET /api/appspurely to confirm the ID was in that list before writing.app.jsonc. That listing is a platform route a scoped workspace API key (BASE44_API_KEY) is refused on, and it only covers the 50 most recently updated apps — so linking failed in CI withUnauthorized. ['api_key'] -> Object not found, and a valid older app could be reported "not found" even for a logged-in user. With an explicit ID,linknow writes the config directly; a wrong ID fails on the first request that actually addresses the app, which already checks the ID (and, for a key, its workspace, scope and app binding).linkwithout an ID still lists apps for the interactive picker.Related Issue
Same workspace-key gap as #671 (
published-url). Surfaced by base44/apps-examples#17.Type of Change
Changes Made
packages/cli/src/cli/commands/project/link.ts: the "choose" path now fetches the project list only when no app ID was given. An explicit--app-id(or the legacy--project-id/--projectId) goes straight towriteAppConfig+setAppContext.projects.find(...)existence check and itsInvalidInputError("App with ID ... not found"); validation moves to the server on the first request that addresses the app.packages/cli/tests/cli/link.spec.ts: new case assertinglink --app-idsucceeds and writes the app ID when a workspace API key is set andGET /api/appsreturns 401 — it failed before this change.--app-id/--project-id/--projectId/ managed-source-code tests no longer mocklistProjects, proving the listing is never requested.CHANGELOG.md: entry under Fixed.Testing
npm test)linkandenv-token-authspecs: 27 passed.bun run typecheck,bun run lintand knip clean.Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
Behavioural trade-off: a bad
--app-idis no longer caught at link time, so.app.jsoncis written and the failure surfaces on the next command that talks to the app. That is the same error the old listing check was approximating, and it avoids both the 50-app truncation and the workspace-key refusal. Nodocs/change — this alters command behaviour, not architecture.🤖 Generated by Claude | 2026-10-21 14:15 UTC | b7a4085