> ## Documentation Index
> Fetch the complete documentation index at: https://docs.choicely.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Choicely Gemini CLI Extension Conversation Playbook

> Use Gemini Cli with the Choicely extension to clone, build, install, and launch the SDK demos via chat.

# Choicely Gemini CLI Extension – Conversation Playbook

This guide is for anyone who only wants to talk to Gemini and still get the Choicely demo up and running. Every section tells you exactly what to say, what Gemini will do for you, and what to expect back. Follow the prompts and Gemini selects every tool and command on your behalf.

## Before You Start Talking to Gemini

* **Install/update Gemini CLI**: Run `npm install -g @google/gemini-cli`.
* **Install the extension**: Run `gemini extensions install https://github.com/choicely/choicely-gemini-cli-extension.git`.
  * You will be prompted to enter variables like `CHOICELY_APP_KEY`, `JAVA_HOME`, and `ANDROID_HOME`.
  * **Note**: If you leave `CHOICELY_APP_KEY` empty (press Enter to skip), the extension will still install and the app will work fine, but it will show the preconfigured demo app instead of your app. You can provide the key later in the chat (e.g., "Configure the app key to be `<your-key>`").
  * **Note**: If you don't have `JAVA_HOME` or `ANDROID_HOME` set, don't worry! The extension can automatically download the necessary SDKs for you.
* **Prepare a workspace**: The extension uses a folder named `choicely-sdk-demo` in your current directory.
* **Devices and emulators**: Gemini lists every connected phone/AVD/simulator and pauses for your confirmation before booting or using one.

## Quick Way to Ask

* Say: “Clone the demo and build/install/launch on Android,” or “Do the same on iOS.” Gemini handles the steps and tools automatically.

## Workflow 1 – Launch the Android Demo

These five steps take you from nothing to a running Choicely demo on an emulator or real device. Keep the asks simple—“fetch, build, install, launch.” The agent handles targets automatically and only asks you to choose if more than one is available.

### Step 1 – Clone (and Auto-Configure) the Demo Project

* **Say**: “Download the Choicely SDK demo into my current folder.”
* **Expect**: Gemini clones (or refreshes if you’ve allowed overwrite) and returns the repo path. If you haven't set `CHOICELY_APP_KEY`, it will ask you for it or you can provide it now.
  <img src="https://mintcdn.com/choicely/BOgCnHn732p_eC53/images/AI/android-step1.png?fit=max&auto=format&n=BOgCnHn732p_eC53&q=85&s=5ec953e1de16b3cdd293aab346a8bb67" alt="Android clone screenshot" width="1260" height="641" data-path="images/AI/android-step1.png" />

### Step 2 – Build the APK

* **Say**: “Build the Android demo app.”
* **Expect**: Gemini builds the APK. On failure, it returns the error log.
  * **If the build fails due to missing Java/Android SDK**: Say "Install Android dependencies" to have Gemini fix it automatically.
    <img src="https://mintcdn.com/choicely/BOgCnHn732p_eC53/images/AI/android-step2.png?fit=max&auto=format&n=BOgCnHn732p_eC53&q=85&s=b204c1e9b91de38c0ae19e7162f0bf6e" alt="Android build screenshot" width="1260" height="886" data-path="images/AI/android-step2.png" />

### Step 3 – Install the Build

* **Say**: “Install the application on an emulator.”
* **Expect**: Gemini lists the available devices/AVDs, asks if it should start the recommended one, then installs once you confirm. Afterward it repeats the package name and device ID.
  * **Note**: If you need a new emulator, say "Install dependencies with emulator support" to download the emulator binaries.
    <img src="https://mintcdn.com/choicely/BOgCnHn732p_eC53/images/AI/android-step3.png?fit=max&auto=format&n=BOgCnHn732p_eC53&q=85&s=4faccf1ec5f0dfe4a260997fb89576b0" alt="Android install screenshot" width="1260" height="886" data-path="images/AI/android-step3.png" />

### Step 4 – Launch and Validate

* **Say**: “Launch the Choicely demo on the emulator.”
* **Expect**: Gemini opens the app and can capture a screenshot or logs if you ask. It can also force-stop or uninstall on request.
  <img src="https://mintcdn.com/choicely/BOgCnHn732p_eC53/images/AI/android-step4.png?fit=max&auto=format&n=BOgCnHn732p_eC53&q=85&s=c7264fc07c7090b4d0bdd01369131417" alt="Android launch screenshot" width="1679" height="794" data-path="images/AI/android-step4.png" />
  <img src="https://mintcdn.com/choicely/BOgCnHn732p_eC53/images/AI/android-step5.png?fit=max&auto=format&n=BOgCnHn732p_eC53&q=85&s=a9da3e833d42841e74fa364ede80e82b" alt="Android validation screenshot" width="1636" height="726" data-path="images/AI/android-step5.png" />

## Workflow 2 – Launch the iOS Demo (macOS)

Mirror the Android flow on macOS. Ask for the outcome; the agent handles simulator selection/boot automatically and only asks you to choose if more than one simulator is available.

### Step 1 – Clone (and Auto-Configure) the Demo Project

* **Say**: “Download the Choicely SDK demo into the current folder.”
* **Expect**: Gemini clones (or refreshes if you’ve allowed overwrite) and returns the repo path. If you haven't set `CHOICELY_APP_KEY`, it will ask you for it or you can provide it now.
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/choicely/images/AI/ios-step1.png" alt="iOS clone screenshot" />

### Step 2 – Build the iOS Simulator App

* **Say**: “Build the iOS demo app.”
* **Expect**: Gemini runs the Xcode build and reports success or the build error log.
  <img src="https://mintcdn.com/choicely/BOgCnHn732p_eC53/images/AI/ios-step2.png?fit=max&auto=format&n=BOgCnHn732p_eC53&q=85&s=fe43edb8a12f67a6e753273c4c4ff5ba" alt="iOS build screenshot" width="1266" height="791" data-path="images/AI/ios-step2.png" />

### Step 3 – Install the Build

* **Say**: “Install the demo app on a simulator.”
* **Expect**: Gemini shows the simulator options, asks before booting one, then installs and reports the simulator ID/bundle after you confirm.
  <img src="https://mintcdn.com/choicely/BOgCnHn732p_eC53/images/AI/ios-step3.png?fit=max&auto=format&n=BOgCnHn732p_eC53&q=85&s=0a028c07a987bd7675a2ad2e79efb668" alt="iOS install screenshot" width="1260" height="815" data-path="images/AI/ios-step3.png" />

### Step 4 – Launch and Validate

* **Say**: “Launch the Choicely demo on that simulator.”
* **Expect**: Gemini opens the app and can capture a screenshot or logs if you ask. It can also terminate or uninstall on request.
  <img src="https://mintcdn.com/choicely/BOgCnHn732p_eC53/images/AI/ios-step4.png?fit=max&auto=format&n=BOgCnHn732p_eC53&q=85&s=21aa9cf3bf80a2144d5905d113e13858" alt="iOS launch screenshot" width="1720" height="930" data-path="images/AI/ios-step4.png" />

## Troubleshooting / FAQ

### Where do I find my App Key?

In Choicely Studio, go to the "Apps" section, select your application, and copy the App Key (UUID) from the top left corner.

### Can I ask questions about the SDK?

Yes! You can ask things like "How do I customize the view factory?" or "How to set up push notifications?" and Gemini will search the Choicely Mobile SDK documentation for answers.
