Skip to content
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
- Fixed issue where `__name__` fields with DESCENDING order were incorrectly filtered from index listings, causing duplicate index issues (#7629) and deployment conflicts (#8859). The fix now preserves `__name__` fields with explicit DESCENDING order while filtering out implicit ASCENDING `__name__` fields.
- Fixed an issue where `firebase init dataconnect` didn't enable the Data Connect API by default (#8927).
- Add firebase init aitools to help developers set up Firebase AI tools in their projects (#8949).
- Updated the Firebase Data Connect local toolkit to v2.11.0, which includes the following changes (#8948):
- [Fixed] Kotlin code generation with enums
- [Fixed] Deploying schemas with enums would report false breaking changes
Expand Down
3 changes: 1 addition & 2 deletions prompts/FIREBASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ firebase deploy --except functions

firebase use staging
firebase use production

````
```
</example>

## Local Development
Expand Down
7 changes: 7 additions & 0 deletions src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@
});
}

choices.push({
value: "aitools",
name: "AI Tools: Configure AI coding assistants to work with your Firebase project",
checked: false,
hidden: true,
});

const featureNames = choices.map((choice) => choice.value);

const HELP = `Interactively configure the current directory as a Firebase project or initialize new features in an already configured Firebase project directory.
Expand Down Expand Up @@ -186,7 +193,7 @@

const setup: Setup = {
config: config.src,
rcfile: config.readProjectFile(".firebaserc", {

Check warning on line 196 in src/commands/init.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe assignment of an `any` value
json: true,
fallback: {},
}),
Expand Down
22 changes: 11 additions & 11 deletions src/init/features/aitools/claude.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import { AIToolModule, AIToolConfigResult } from "./types";
import { updateFirebaseSection } from "./promptUpdater";

const CLAUDE_SETTINGS_PATH = ".claude/settings.local.json";
const CLAUDE_PROMPT_PATH = "CLAUDE.local.md";
const MCP_CONFIG_PATH = ".mcp.json";
const CLAUDE_PROMPT_PATH = "CLAUDE.md";

export const claude: AIToolModule = {
name: "claude",
Expand All @@ -12,8 +12,8 @@
/**
* Configures Claude Code with Firebase context.
*
* - .claude/settings.local.json: Merges with existing config (preserves user settings)
* - CLAUDE.local.md: Updates Firebase section only (preserves user content)
* - .mcp.json: Merges with existing MCP server config (preserves user settings)
* - CLAUDE.md: Updates Firebase section only (preserves user content)
*/
async configure(
config: Config,
Expand All @@ -22,13 +22,13 @@
): Promise<AIToolConfigResult> {
const files: AIToolConfigResult["files"] = [];

// Handle MCP configuration - merge with existing if present
let existingConfig: any = {};
let settingsUpdated = false;
// Handle MCP configuration in .mcp.json - merge with existing if present
let existingConfig: { mcpServers?: Record<string, { command: string; args: string[] }> } = {};
let mcpUpdated = false;
try {
const existingContent = config.readProjectFile(CLAUDE_SETTINGS_PATH);
const existingContent = config.readProjectFile(MCP_CONFIG_PATH);

Check warning on line 29 in src/init/features/aitools/claude.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe assignment of an `any` value
if (existingContent) {
existingConfig = JSON.parse(existingContent);

Check warning on line 31 in src/init/features/aitools/claude.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe argument of type `any` assigned to a parameter of type `string`

Check warning on line 31 in src/init/features/aitools/claude.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe assignment of an `any` value
}
} catch (e) {
// File doesn't exist or is invalid JSON, start fresh
Expand All @@ -43,11 +43,11 @@
command: "npx",
args: ["-y", "firebase-tools", "experimental:mcp", "--dir", projectPath],
};
config.writeProjectFile(CLAUDE_SETTINGS_PATH, JSON.stringify(existingConfig, null, 2));
settingsUpdated = true;
config.writeProjectFile(MCP_CONFIG_PATH, JSON.stringify(existingConfig, null, 2));
mcpUpdated = true;
}

files.push({ path: CLAUDE_SETTINGS_PATH, updated: settingsUpdated });
files.push({ path: MCP_CONFIG_PATH, updated: mcpUpdated });

const { updated } = await updateFirebaseSection(config, CLAUDE_PROMPT_PATH, enabledFeatures, {
interactive: true,
Expand Down
1 change: 1 addition & 0 deletions src/init/features/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ export {
RequiredInfo as ApptestingInfo,
actuate as apptestingAcutate,
} from "./apptesting";
export { doSetup as aitools } from "./aitools";
1 change: 1 addition & 0 deletions src/init/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
featureInfo?: SetupInfo;

/** Basic Project information */
project?: Record<string, any>;

Check warning on line 21 in src/init/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
projectId?: string;
projectLocation?: string;
isBillingEnabled?: boolean;

hosting?: Record<string, any>;

Check warning on line 26 in src/init/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
}

export interface SetupInfo {
Expand Down Expand Up @@ -87,11 +87,12 @@
askQuestions: features.apptestingAskQuestions,
actuate: features.apptestingAcutate,
},
{ name: "aitools", displayName: "AI Tools", doSetup: features.aitools },
];

const featureMap = new Map(featuresList.map((feature) => [feature.name, feature]));

export async function init(setup: Setup, config: Config, options: any): Promise<any> {

Check warning on line 95 in src/init/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type

Check warning on line 95 in src/init/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type

Check warning on line 95 in src/init/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing JSDoc comment
const nextFeature = setup.features?.shift();
if (nextFeature) {
const start = process.uptime();
Expand All @@ -111,7 +112,7 @@
);

if (f.doSetup) {
await f.doSetup(setup, config, options);

Check warning on line 115 in src/init/index.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe argument of type `any` assigned to a parameter of type `Options`
} else {
if (f.askQuestions) {
await f.askQuestions(setup, config, options);
Expand Down
Loading