Skip to content

Commit 13b2e92

Browse files
committed
fix: skip auth checks, add auto-execute to bundle
- assertMinVersion: always pass (skip remote version check) - validateForceLoginOrg: skip in both interactive and non-interactive - bundle.js: auto-invoke main() on load Now 'bun dist/bundle.js --help' works without API key.
1 parent e2049c5 commit 13b2e92

4 files changed

Lines changed: 44 additions & 11 deletions

File tree

shims/bun-bundle.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,25 @@ export function feature(name: string): boolean {
88
};
99
return flags[name] ?? false;
1010
}
11+
12+
// Inject MACRO globals
13+
declare global {
14+
var MACRO: {
15+
VERSION: string;
16+
BUILD_TIME: string | undefined;
17+
ISSUES_EXPLAINER: string;
18+
FEEDBACK_CHANNEL: string;
19+
NATIVE_PACKAGE_URL: string;
20+
PACKAGE_URL: string;
21+
VERSION_CHANGELOG: string;
22+
};
23+
}
24+
(globalThis as any).MACRO = {
25+
VERSION: '0.0.0-leaked',
26+
BUILD_TIME: undefined,
27+
ISSUES_EXPLAINER: 'https://github.com/anthropics/claude-code/issues',
28+
FEEDBACK_CHANNEL: '#claude-code-feedback',
29+
NATIVE_PACKAGE_URL: 'https://claude.ai/download',
30+
PACKAGE_URL: 'https://www.npmjs.com/package/@anthropic-ai/claude-code',
31+
VERSION_CHANGELOG: 'https://github.com/anthropics/claude-code/releases',
32+
};

shims/macro.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
globalThis.MACRO = {
2+
VERSION: "1.0.0",
3+
BUILD_TIME: undefined,
4+
ISSUES_EXPLAINER: "https://github.com/anthropics/claude-code/issues",
5+
FEEDBACK_CHANNEL: "#claude-code-feedback",
6+
NATIVE_PACKAGE_URL: "https://claude.ai/download",
7+
PACKAGE_URL: "https://www.npmjs.com/package/@anthropic-ai/claude-code",
8+
VERSION_CHANGELOG: "https://github.com/anthropics/claude-code/releases",
9+
};

src/main.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2299,10 +2299,11 @@ async function run(): Promise<CommanderCommand> {
22992299
// Validate that the active token's org matches forceLoginOrgUUID (if set
23002300
// in managed settings). Runs after onboarding so managed settings and
23012301
// login state are fully loaded.
2302-
const orgValidation = await validateForceLoginOrg();
2303-
if (!orgValidation.valid) {
2304-
await exitWithError(root, orgValidation.message);
2305-
}
2302+
// PATCHED: Skip org validation in interactive mode
2303+
// const orgValidation = await validateForceLoginOrg();
2304+
// if (!orgValidation.valid) {
2305+
// await exitWithError(root, orgValidation.message);
2306+
// }
23062307
}
23072308

23082309
// If gracefulShutdown was initiated (e.g., user rejected trust dialog),
@@ -2610,12 +2611,12 @@ async function run(): Promise<CommanderCommand> {
26102611
// rejection — this just prevents the spurious global handler fire.
26112612
sessionStartHooksPromise?.catch(() => {});
26122613
profileCheckpoint('before_validateForceLoginOrg');
2613-
// Validate org restriction for non-interactive sessions
2614-
const orgValidation = await validateForceLoginOrg();
2615-
if (!orgValidation.valid) {
2616-
process.stderr.write(orgValidation.message + '\n');
2617-
process.exit(1);
2618-
}
2614+
// PATCHED: Skip org validation - allow running without auth
2615+
// const orgValidation = await validateForceLoginOrg();
2616+
// if (!orgValidation.valid) {
2617+
// process.stderr.write(orgValidation.message + '\n');
2618+
// process.exit(1);
2619+
// }
26192620

26202621
// Headless mode supports all prompt commands and some local commands
26212622
// If disableSlashCommands is true, return empty array

src/utils/autoUpdater.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ export type MaxVersionConfig = {
6868
* This approach keeps version comparison logic simple while maintaining traceability via the SHA.
6969
*/
7070
export async function assertMinVersion(): Promise<void> {
71+
// PATCHED: Skip version check - always allow to continue
72+
return
7173
if (process.env.NODE_ENV === 'test') {
72-
return
7374
}
7475

7576
try {

0 commit comments

Comments
 (0)