Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ Use these commands within the interactive chat (`clix`):
| `/new` | /clear | Start a new session |
| `/compact` | /c | Compress conversation history |
| `/agent` | /a | List or switch agents |
| `/firebase` | | Check and configure Firebase credentials |
| `/transfer` | /t | Transfer to agent CLI |
| `/resume` | | Resume a previous session |
| `/install-mcp` | /mcp | Install Clix MCP Server |
Expand Down
121 changes: 121 additions & 0 deletions bun.lock

Large diffs are not rendered by default.

47 changes: 41 additions & 6 deletions llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Clix CLI is an interactive command-line tool that provides a chat interface with
**Core Features:**
- Interactive chat interface as the primary interaction mode
- Support for 6 AI agents: Claude, Codex, Gemini, OpenCode, Cursor, and GitHub Copilot
- 17 slash commands for quick actions
- 18 slash commands for quick actions
- Skills system with 5 interactive skills + 3 autonomous commands
- Interactive debug assistant for problem diagnosis
- Session transfer to native agent CLIs
Expand Down Expand Up @@ -70,14 +70,14 @@ clix
**Features:**
- Natural language conversation with AI
- Real-time streaming responses
- 13 slash commands (type `/` to see menu)
- 18 slash commands (type `/` to see menu)
- Context usage tracking (200K token window for Claude Sonnet)
- History navigation with ↑/↓ arrow keys
- Press Escape to cancel streaming requests
- Automatic history compaction at 90% context threshold

**Available within chat:**
- All 17 slash commands (3 autonomous + 5 skills + 9 system)
- All 18 slash commands (3 autonomous + 5 skills + 10 system)
- Natural language queries
- File exploration and code analysis by agent
- Real-time tool execution visibility
Expand Down Expand Up @@ -206,7 +206,7 @@ The interactive chat (`clix` command) is the primary way to interact with Clix C

### Slash Commands

Type `/` in the chat to see the autocomplete menu. All 17 slash commands are organized into three categories:
Type `/` in the chat to see the autocomplete menu. All 18 slash commands are organized into three categories:

#### Autonomous Commands (3 commands)

Expand All @@ -226,14 +226,15 @@ These execute pre-built workflows from the `@clix-so/clix-agent-skills` package
- `/personalization` - Personalization template creation and debugging
- `/api-triggered-campaigns` - API-triggered campaign setup

#### System Commands (9 commands)
#### System Commands (10 commands)

These are built-in commands for chat management and tools:

- `/help` (aliases: `/h`, `/?`) - Display all available commands with descriptions
- `/new` (alias: `/clear`) - Start a new session (clear history)
- `/compact` (alias: `/c`) - Compress conversation history
- `/agent` (alias: `/a`) - List available agents or switch to specific agent
- `/firebase` - Check and configure Firebase credentials
- `/transfer` (alias: `/t`) - Transfer session to agent CLI
- `/resume` - Resume a previous session
- `/install-mcp` (alias: `/mcp`) - Install Clix MCP Server for current agent
Expand Down Expand Up @@ -458,6 +459,7 @@ System Commands:
/new - Start a new session
/compact - Compress conversation history
/agent - List or switch agents
/firebase - Check and configure Firebase credentials
/transfer - Transfer to agent CLI
/resume - Resume a previous session
/install-mcp - Install Clix MCP Server
Expand Down Expand Up @@ -504,6 +506,39 @@ Compressing conversation history...
Reduced size by 68%
```

#### `/firebase` - Firebase Configuration

**Category:** System Command

**What it does:** Opens an interactive wizard to check and configure Firebase credentials (google-services.json for Android, GoogleService-Info.plist for iOS).

**Features:**
- Auto-detects Firebase credential files in project
- Validates JSON/plist structure against Firebase schema
- Reports issues (missing files, invalid format, wrong location)
- Provides recommendations with help URLs
- Supports React Native, Flutter, iOS, and Android projects

**Detection locations:**
- Android: `app/google-services.json`, `android/app/google-services.json`
- iOS: `ios/GoogleService-Info.plist`, `ios/Runner/GoogleService-Info.plist`

**Example:**
```
> /firebase
Firebase Configuration (react-native)

✓ Android (google-services.json): valid
Location: android/app/google-services.json
Project ID: my-project-12345

✗ iOS (GoogleService-Info.plist): not found
→ Expected: ios/GoogleService-Info.plist
→ Download from Firebase Console

Press Enter to configure, Esc to skip
```

#### `/agent` - Agent Management

**Category:** System Command
Expand Down Expand Up @@ -1123,7 +1158,7 @@ When helping users with Clix CLI, keep these points in mind:
1. **Primary command is `clix`** - This launches interactive chat, not just a welcome screen
2. **Interactive > Commands** - The tool is primarily interactive, not command-based
3. **6 supported agents** - Gemini, Copilot, OpenCode, Cursor, Claude, Codex (recommend starting with Gemini or Copilot for free tiers)
4. **17 slash commands** - 3 autonomous commands + 5 interactive skills + 9 system commands
4. **18 slash commands** - 3 autonomous commands + 5 interactive skills + 10 system commands
5. **Autonomous vs Interactive** - Autonomous commands (`/install`, `/doctor`, `/debug`) can run from CLI, Interactive skills (`/integration`, `/event-tracking`, etc.) require chat mode
6. **Skills from package** - Interactive skills from @clix-so/clix-agent-skills package, Autonomous commands are local
7. **/install vs /integration** - `/install` makes changes autonomously, `/integration` provides guided steps
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@
"homepage": "https://docs.clix.so/clix-cli",
"dependencies": {
"@clix-so/clix-agent-skills": "^0.2.3",
"google-auth-library": "^10.5.0",
"ink": "^6.6.0",
"ink-select-input": "^6.2.0",
"ink-spinner": "^5.0.0",
"ink-text-input": "^6.0.0",
"meow": "^14.0.0",
"picocolors": "^1.1.1",
"plist": "^3.1.0",
"react": "^19.2.3",
"xdg-app-paths": "^8.3.0",
"zod": "^4.3.5"
Expand All @@ -61,6 +63,7 @@
"@biomejs/biome": "^2.0.0",
"@types/bun": "^1.3.5",
"@types/node": "^22.10.5",
"@types/plist": "^3.0.5",
"@types/react": "^19.2.7",
"husky": "^9.0.0",
"lint-staged": "^16.2.7",
Expand Down
47 changes: 47 additions & 0 deletions src/lib/commands/firebase.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* Firebase command - check and configure Firebase credentials.
*
* @module commands/firebase
*/

import type { ReactNode } from 'react';
import { FirebaseWizard } from '@/ui/components/FirebaseWizard';
import type { Command, CommandDoneCallback } from './types';

/**
* Firebase command implementation.
* Opens the Firebase configuration wizard for detecting and validating credentials.
*/
export const firebaseCommand: Command = {
type: 'local-jsx',
name: 'firebase',
description: 'Check and configure Firebase credentials',
isEnabled: true,
isHidden: false,

userFacingName() {
return '/firebase';
},

async call(onDone: CommandDoneCallback): Promise<ReactNode> {
const projectPath = process.cwd();

return (
<FirebaseWizard
projectPath={projectPath}
onComplete={(result) => {
if (result.skipped) {
onDone('Firebase setup skipped');
} else if (result.completed) {
onDone('Firebase configuration complete');
} else {
onDone();
}
}}
onCancel={() => {
onDone('Firebase setup cancelled');
}}
/>
);
},
};
2 changes: 2 additions & 0 deletions src/lib/commands/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { agentCommand } from './agent';
import { compactCommand } from './compact';
import { debugCommand } from './debug';
import { exitCommand } from './exit';
import { firebaseCommand } from './firebase';
import { helpCommand } from './help';
import { installMcpCommand } from './install-mcp';
import { newCommand } from './new';
Expand All @@ -29,6 +30,7 @@ const BUILT_IN_COMMANDS: Command[] = [
compactCommand,
agentCommand,
debugCommand,
firebaseCommand,
transferCommand,
resumeCommand,
installMcpCommand,
Expand Down
66 changes: 64 additions & 2 deletions src/lib/embedded-skills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1136,11 +1136,12 @@ Analyze project files to identify the platform.
**Android:**
- Modify MainActivity or Application class
- Update AndroidManifest.xml with permissions
- Note: Firebase setup may require manual steps
- Verify Firebase configuration (see step 6)

**Flutter:**
- Modify main.dart to initialize SDK
- Update platform-specific files as needed
- Verify Firebase configuration (see step 6)

### 4. Use Placeholders for Secrets

Expand All @@ -1153,6 +1154,32 @@ Execute necessary commands:
- \`cd ios && pod install\` for iOS dependencies
- \`flutter pub get\` for Flutter

### 6. Verify Firebase Configuration

For push notifications to work, Firebase must be properly configured:

**Android (google-services.json):**
- Expected locations:
- Standard Android: \`app/google-services.json\`
- React Native/Flutter: \`android/app/google-services.json\`
- Download from Firebase Console > Project Settings > Your apps > Android app
- Verify package name matches your AndroidManifest.xml

**iOS (GoogleService-Info.plist):**
- Expected locations:
- React Native: \`ios/GoogleService-Info.plist\`
- Flutter: \`ios/Runner/GoogleService-Info.plist\`
- Native iOS: \`<AppName>/GoogleService-Info.plist\`
- Download from Firebase Console > Project Settings > Your apps > iOS app
- Verify bundle ID matches your Xcode project

**Validation:**
- Check if files exist in correct locations
- Verify JSON/plist structure is valid
- Confirm project IDs match between platforms (for cross-platform apps)

Use \`/firebase\` command in interactive mode to check and configure Firebase credentials.

## Automation Rules

✅ **DO:**
Expand Down Expand Up @@ -1213,7 +1240,11 @@ Analyze the project and output a diagnostic JSON report:
"apiKeyConfigured": true | false,
"pushPermissions": true | false,
"entitlements": true | false,
"firebaseConfig": true | false
"firebaseConfig": true | false,
"firebaseAndroid": true | false,
"firebaseIos": true | false,
"firebasePackageMatch": true | false,
"firebaseBundleMatch": true | false
},
"nextSteps": ["Step 1", "Step 2"]
}
Expand All @@ -1238,15 +1269,46 @@ Analyze the project and output a diagnostic JSON report:
- Android: Check AndroidManifest.xml for FCM service
- Check for google-services.json (Android) or GoogleService-Info.plist (iOS)

### Firebase Configuration Check (Detailed)

**Android (google-services.json):**
- Check file presence in expected locations:
- Standard Android: \`app/google-services.json\`
- React Native/Flutter: \`android/app/google-services.json\`
- Validate JSON structure against Firebase schema
- Verify \`project_info.project_id\` exists
- Verify \`client[].client_info.android_client_info.package_name\` matches AndroidManifest.xml
- Report if file found in wrong location (e.g., project root)

**iOS (GoogleService-Info.plist):**
- Check file presence in expected locations:
- React Native: \`ios/GoogleService-Info.plist\`
- Flutter: \`ios/Runner/GoogleService-Info.plist\`
- Native iOS: \`<AppName>/GoogleService-Info.plist\`
- Validate plist structure (API_KEY, GCM_SENDER_ID, GOOGLE_APP_ID, PROJECT_ID, BUNDLE_ID)
- Verify BUNDLE_ID matches Xcode project bundle identifier
- Report if file found in wrong location

**Cross-Platform Validation:**
- For React Native/Flutter projects, verify both Android and iOS configs exist
- Verify PROJECT_ID matches between platforms

### Common Issues to Detect
- Missing SDK dependency
- Missing or invalid API key
- Missing push notification permissions
- Missing capabilities/entitlements
- Outdated SDK version
- Incomplete Firebase/APNs setup
- Firebase config file missing
- Firebase config file in wrong location
- Firebase config file invalid (malformed JSON/plist)
- Firebase package name / bundle ID mismatch
- Firebase project ID mismatch between platforms

Output the JSON diagnostic, then provide a brief summary with actionable recommendations.

Use \`/firebase\` command to interactively check and configure Firebase credentials.
`,
};

Expand Down
25 changes: 25 additions & 0 deletions src/lib/errors/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ export const ERROR_CODES = {
// General errors
UNKNOWN_ERROR: 'UNKNOWN_ERROR',
OPERATION_CANCELLED: 'OPERATION_CANCELLED',

// Firebase errors
FIREBASE_CONFIG_MISSING: 'FIREBASE_CONFIG_MISSING',
FIREBASE_CONFIG_INVALID: 'FIREBASE_CONFIG_INVALID',
FIREBASE_PACKAGE_MISMATCH: 'FIREBASE_PACKAGE_MISMATCH',
FIREBASE_BUNDLE_MISMATCH: 'FIREBASE_BUNDLE_MISMATCH',
FIREBASE_DETECTION_FAILED: 'FIREBASE_DETECTION_FAILED',
} as const;

export type ErrorCode = (typeof ERROR_CODES)[keyof typeof ERROR_CODES];
Expand Down Expand Up @@ -176,3 +183,21 @@ export class SessionError extends ClixError {
this.sessionId = sessionId;
}
}

/**
* Error for Firebase configuration failures.
*/
export class FirebaseError extends ClixError {
public readonly platform: 'android' | 'ios';
public readonly file?: string;

constructor(message: string, platform: 'android' | 'ios', code?: ErrorCode, file?: string) {
super(message, code ?? ERROR_CODES.FIREBASE_CONFIG_INVALID, true, {
platform,
file,
});
this.name = 'FirebaseError';
this.platform = platform;
this.file = file;
}
}
Loading