|
| 1 | +--- |
| 2 | +description: Upgrade the nano-banana-image-editor plugin to the latest version from the marketplace repository |
| 3 | +tools: Bash, AskUserQuestion |
| 4 | +--- |
| 5 | + |
| 6 | +# Nano Banana Image Editor Plugin Upgrade |
| 7 | + |
| 8 | +You are running the nano-banana-image-editor upgrade command to update the plugin to the latest version. |
| 9 | + |
| 10 | +## Your Task |
| 11 | + |
| 12 | +Guide the user through upgrading the nano-banana-image-editor plugin by pulling the latest changes from the marketplace repository. |
| 13 | + |
| 14 | +## Workflow |
| 15 | + |
| 16 | +### Step 1: Verify Current Installation |
| 17 | + |
| 18 | +Check the current version and installation location: |
| 19 | + |
| 20 | +```bash |
| 21 | +# Get marketplace directory |
| 22 | +MARKETPLACE_DIR=$(dirname $(dirname ${CLAUDE_PLUGIN_ROOT})) |
| 23 | + |
| 24 | +# Get current version from marketplace.json |
| 25 | +CURRENT_VERSION=$(jq -r '.plugins[] | select(.name=="nano-banana-image-editor") | .version' "$MARKETPLACE_DIR/.claude-plugin/marketplace.json") |
| 26 | + |
| 27 | +# Verify git repository |
| 28 | +cd "$MARKETPLACE_DIR" && git rev-parse --git-dir >/dev/null 2>&1 && echo "✓ Git repository found" || echo "✗ Not a git repository" |
| 29 | +``` |
| 30 | + |
| 31 | +**Output to user:** |
| 32 | + |
| 33 | +``` |
| 34 | +Current version: [version] |
| 35 | +Marketplace directory: [path] |
| 36 | +``` |
| 37 | + |
| 38 | +### Step 2: Check for Updates |
| 39 | + |
| 40 | +Fetch the latest tags and check for updates: |
| 41 | + |
| 42 | +```bash |
| 43 | +cd "$MARKETPLACE_DIR" |
| 44 | +git fetch --tags origin |
| 45 | +``` |
| 46 | + |
| 47 | +Then get the version information: |
| 48 | + |
| 49 | +```bash |
| 50 | +# Get the latest version tag for this plugin |
| 51 | +LATEST_TAG=$(git tag -l 'nano-banana-image-editor/v*' --sort=-v:refname | head -n 1) |
| 52 | + |
| 53 | +# Get current tag (if on a tag) |
| 54 | +CURRENT_TAG=$(git describe --tags --exact-match 2>/dev/null || echo "none") |
| 55 | + |
| 56 | +# Filter to only nano-banana-image-editor tags if we're on a tag |
| 57 | +if [ "$CURRENT_TAG" != "none" ]; then |
| 58 | + echo "$CURRENT_TAG" | grep -q '^nano-banana-image-editor/' || CURRENT_TAG="none" |
| 59 | +fi |
| 60 | + |
| 61 | +echo "Latest tag: $LATEST_TAG" |
| 62 | +echo "Current tag: $CURRENT_TAG" |
| 63 | +``` |
| 64 | + |
| 65 | +**Analyze the output:** |
| 66 | + |
| 67 | +- If `LATEST_TAG` is empty → No tagged releases available yet |
| 68 | +- If `CURRENT_TAG` equals `LATEST_TAG` → Already on latest version |
| 69 | +- If `LATEST_TAG` is newer → Continue to Step 3 |
| 70 | +- If git fetch fails → Inform user there's a connection issue |
| 71 | + |
| 72 | +**Output to user:** |
| 73 | + |
| 74 | +``` |
| 75 | +Current version: [CURRENT_VERSION] (tag: [CURRENT_TAG or "not on a tagged release"]) |
| 76 | +Latest available: [LATEST_TAG] |
| 77 | +``` |
| 78 | + |
| 79 | +### Step 3: Show Release Notes |
| 80 | + |
| 81 | +If updates are available, show what's changed by reading the CHANGELOG: |
| 82 | + |
| 83 | +```bash |
| 84 | +cd "$MARKETPLACE_DIR" && git show "$LATEST_TAG:plugins/nano-banana-image-editor/CHANGELOG.md" | head -50 |
| 85 | +``` |
| 86 | + |
| 87 | +**Present the release notes** to the user, focusing on the latest version's changes. |
| 88 | + |
| 89 | +### Step 4: Confirm Upgrade |
| 90 | + |
| 91 | +Use the **AskUserQuestion** tool to ask: |
| 92 | + |
| 93 | +- **Question**: "Ready to upgrade nano-banana-image-editor to the latest version?" |
| 94 | +- **Options**: |
| 95 | + - "Yes, upgrade now" (description: "Pull latest changes from the repository") |
| 96 | + - "No, not now" (description: "Keep current version") |
| 97 | + |
| 98 | +If user selects "No, not now": |
| 99 | + |
| 100 | +- Output: "Upgrade cancelled. Your current version remains unchanged." |
| 101 | +- Exit the command |
| 102 | + |
| 103 | +### Step 5: Perform Upgrade |
| 104 | + |
| 105 | +If user confirms, checkout the latest tagged release: |
| 106 | + |
| 107 | +```bash |
| 108 | +cd "$MARKETPLACE_DIR" && git checkout "$LATEST_TAG" |
| 109 | +``` |
| 110 | + |
| 111 | +**Check the exit code:** |
| 112 | + |
| 113 | +- Exit code 0 → Success, continue to Step 6 |
| 114 | +- Exit code != 0 → Error occurred, show user the error message and stop |
| 115 | + |
| 116 | +**Note:** This checks out the specific tagged release ensuring you get a stable, tested version. |
| 117 | + |
| 118 | +### Step 6: Rebuild Plugin Dependencies |
| 119 | + |
| 120 | +After pulling changes, reinstall Python dependencies: |
| 121 | + |
| 122 | +```bash |
| 123 | +cd ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor && bash scripts/install_dependencies.sh |
| 124 | +``` |
| 125 | + |
| 126 | +**Monitor for errors:** |
| 127 | + |
| 128 | +- If successful → Continue to Step 7 |
| 129 | +- If errors occur → Show errors to user and explain that manual intervention may be needed |
| 130 | + |
| 131 | +### Step 7: Verify New Version |
| 132 | + |
| 133 | +Check the updated version: |
| 134 | + |
| 135 | +```bash |
| 136 | +NEW_VERSION=$(jq -r '.plugins[] | select(.name=="nano-banana-image-editor") | .version' "$MARKETPLACE_DIR/.claude-plugin/marketplace.json") |
| 137 | +``` |
| 138 | + |
| 139 | +### Step 8: Success Message & Restart Prompt |
| 140 | + |
| 141 | +**Output to user:** |
| 142 | + |
| 143 | +``` |
| 144 | +✅ Nano Banana Image Editor upgraded successfully! |
| 145 | +
|
| 146 | +Previous version: [old version] |
| 147 | +Current version: [new version] |
| 148 | +
|
| 149 | +⚠️ Important: You must restart Claude Code to apply the changes. |
| 150 | +
|
| 151 | +To restart: |
| 152 | +1. Close this conversation |
| 153 | +2. Restart Claude Code |
| 154 | +3. Start a new session |
| 155 | +
|
| 156 | +After restarting, you can verify the upgrade by running: |
| 157 | +/nano-banana-image-editor:image test |
| 158 | +``` |
| 159 | + |
| 160 | +## Error Handling |
| 161 | + |
| 162 | +### Git Repository Not Found |
| 163 | + |
| 164 | +If the marketplace directory is not a git repository: |
| 165 | + |
| 166 | +``` |
| 167 | +❌ Upgrade failed: nano-banana-image-editor marketplace is not a git repository. |
| 168 | +
|
| 169 | +This can happen if the plugin was installed differently. To upgrade manually: |
| 170 | +
|
| 171 | +1. Navigate to: [marketplace directory] |
| 172 | +2. Run: git fetch --tags origin |
| 173 | +3. List tags: git tag -l 'nano-banana-image-editor/v*' --sort=-v:refname |
| 174 | +4. Checkout latest: git checkout <latest-version-tag> |
| 175 | +5. Navigate to: [plugin directory]/skills/nano-banana-image-editor |
| 176 | +6. Run: bash scripts/install_dependencies.sh |
| 177 | +7. Restart Claude Code |
| 178 | +
|
| 179 | +If you continue to have issues, try reinstalling the plugin: |
| 180 | +/plugin marketplace remove emdashcodes-claude-code-plugins |
| 181 | +/plugin marketplace add emdashcodes/claude-code-plugins |
| 182 | +/plugin install nano-banana-image-editor@emdashcodes-claude-code-plugins |
| 183 | +``` |
| 184 | + |
| 185 | +### Network/Connection Errors |
| 186 | + |
| 187 | +If git fetch/pull fails due to network issues: |
| 188 | + |
| 189 | +``` |
| 190 | +❌ Upgrade failed: Unable to connect to repository. |
| 191 | +
|
| 192 | +Please check your network connection and GitHub access. |
| 193 | +
|
| 194 | +To upgrade manually: |
| 195 | +cd [marketplace directory] |
| 196 | +git fetch --tags origin |
| 197 | +git tag -l 'nano-banana-image-editor/v*' --sort=-v:refname # List versions |
| 198 | +git checkout <latest-version-tag> |
| 199 | +cd [plugin directory]/skills/nano-banana-image-editor |
| 200 | +bash scripts/install_dependencies.sh |
| 201 | +
|
| 202 | +Then restart Claude Code. |
| 203 | +``` |
| 204 | + |
| 205 | +### Build Errors |
| 206 | + |
| 207 | +If dependency installation fails: |
| 208 | + |
| 209 | +``` |
| 210 | +❌ Upgrade completed but dependency installation failed. |
| 211 | +
|
| 212 | +The latest code was pulled, but there were errors during Python dependency installation. |
| 213 | +You may need to troubleshoot manually. |
| 214 | +
|
| 215 | +Error details: |
| 216 | +[show error output] |
| 217 | +
|
| 218 | +To retry manually: |
| 219 | +cd [plugin directory]/skills/nano-banana-image-editor |
| 220 | +bash scripts/install_dependencies.sh |
| 221 | +
|
| 222 | +If issues persist, report at: https://github.com/emdashcodes/claude-code-plugins/issues |
| 223 | +``` |
| 224 | + |
| 225 | +## Important Notes |
| 226 | + |
| 227 | +- This command upgrades to the latest **tagged release** (stable, tested versions) |
| 228 | +- Uses plugin-prefixed semantic versioning tags (e.g., `nano-banana-image-editor/v1.0.0`, `nano-banana-image-editor/v1.1.0`) |
| 229 | +- Your configuration file (`.nano-banana-config.json`) will not be affected |
| 230 | +- A restart of Claude Code is **required** for changes to take effect |
| 231 | +- The upgrade process does not modify your existing Gemini API token or settings |
0 commit comments