A Chrome extension that generates images via GLM Image API (Zhipu) and uploads them to Tencent Cloud COS โ get permanent links instantly, all from your browser's side panel.
Click to expand/collapse screenshots
| Popup | Side Panel - AI Image Gen |
|---|---|
![]() |
![]() |
| Side Panel - History | Side Panel - History Detail |
|---|---|
![]() |
![]() |
| Side Panel - Cloud Storage | Side Panel - Settings |
|---|---|
![]() |
![]() |
- GLM Image Generation โ AI-powered image generation using Zhipu's GLM Image model (
glm-image), with user-configurable API Key. - Tencent Cloud COS Integration โ Auto-upload generated images to COS for permanent, shareable links.
- Side Panel UI โ Clean, compact side panel interface with AI generation tools and settings management.
- User Settings โ Configure your Zhipu API Key and theme preferences (
light/dark/system) directly in the side panel. - Dark Mode โ
system/light/darktheme switching with VueUse, synced across all extension contexts. - Built-in WXT i18n โ Native
@wxt-dev/i18nmodule, follows the browser locale. Supports Chinese and English. - Shared State via WXT Storage โ Cross-context state synchronization through
wxt/storage(API key, theme, app state). - Element Plus with Auto Import โ UI components and APIs are auto-imported on demand via
unplugin-vue-componentsandunplugin-auto-import. - Multi-Entry SPA Architecture โ
popup,options, andsidepaneleach have their own Vue Router and Pinia instance, fully isolated. - Iconify Icons โ Uses
@iconify/vuefor a rich, customizable icon set. - Complete DX Toolchain โ ESLint (
@antfu/eslint-config), TypeScript strict mode, SCSS, conventional commits (cz-git), semantic versioning (standard-version).
| Layer | Technology |
|---|---|
| Framework | WXT (Web Extension Tools) |
| UI | Vue 3 + Element Plus |
| Icons | Iconify (@iconify/vue) |
| State | Pinia (per-entry instance) |
| Routing | Vue Router 4 (Hash mode, per-entry) |
| i18n | @wxt-dev/i18n (WXT native) |
| Storage | wxt/storage (cross-context sync) |
| AI SDK | OpenAI Node SDK (GLM Image API compatible) |
| Utilities | VueUse + Lodash-es + Day.js |
| HTTP | Axios |
| Styling | SCSS + Element Plus theme customization |
| Linting | @antfu/eslint-config |
| CI/CD | GitHub Actions |
GLM-Image2COS/
โโโ .github/workflows/ # CI/CD: lint + build + release
โโโ .vscode/ # VSCode recommended extensions
โโโ assets/styles/ # Global SCSS: variables, dark mode, reset
โโโ components/ # Shared Vue components
โ โโโ HelloWorld.vue
โโโ composables/ # Vue composables
โ โโโ useDarkMode.ts # Dark mode logic with Pinia + VueUse
โโโ entrypoints/ # Extension entry points
โ โโโ background.ts # Service Worker: storage management & message routing
โ โโโ popup/ # Popup SPA (Product introduction)
โ โ โโโ main.ts / App.vue
โ โ โโโ index.html
โ โ โโโ style.css
โ โโโ sidepanel/ # Side Panel SPA (Core features)
โ โโโ main.ts / App.vue / router.ts
โ โโโ index.html
โ โโโ views/
โ โโโ ToolsView.vue # GLM Image generation tool
โ โโโ HistoryView.vue # Generation history
โ โโโ CloudView.vue # Cloud storage management
โ โโโ SettingsView.vue # API Key & theme configuration
โ โโโ OverviewView.vue # Overview page
โโโ lib/ # Core libraries
โ โโโ glm.ts # GLM Image API client (OpenAI-compatible)
โ โโโ cos.ts # Tencent Cloud COS SDK
โ โโโ create-extension-app.ts # Unified Vue app factory
โ โโโ element-plus.ts # Element Plus locale resolver
โ โโโ i18n.ts # WXT i18n wrapper
โโโ locales/ # i18n translation files
โ โโโ en.json
โ โโโ zh-CN.json
โโโ public/icon/ # Extension icons (16/32/48/96/128)
โโโ screenshots/ # Preview screenshots
โโโ stores/ # Pinia stores (definitions shared, instances isolated)
โ โโโ app.ts # App state: theme, global settings
โ โโโ cloud.ts # Cloud files state
โ โโโ history.ts # Generation history state
โ โโโ userSettings.ts # User settings: API Key persistence
โโโ utils/ # Utilities
โ โโโ messaging.ts # Type-safe extension messaging
โ โโโ storage.ts # WXT storage adapter & types
โโโ wxt.config.ts # WXT configuration
โโโ tsconfig.json # TypeScript configuration
โโโ eslint.config.mjs # ESLint flat config
โโโ package.json
- Node.js >= 18
- Bun >= 1.0 (recommended)
bun installThis will also run wxt prepare automatically via postinstall to generate i18n types and WXT type declarations.
# Chrome (default)
bun run dev
# Firefox
bun run dev:firefoxAfter starting, load the extension in your browser:
| Browser | Steps |
|---|---|
| Chrome | Open chrome://extensions โ Enable "Developer mode" โ "Load unpacked" โ Select .output/chrome-mv3 |
| Firefox | Open about:debugging#/runtime/this-firefox โ "Load Temporary Add-on" โ Select .output/firefox-mv3/manifest.json |
# Chrome
bun run build
# Firefox
bun run build:firefox
# Build and zip both
bun run zip
bun run zip:firefoxOutput is in the .output/ directory.
After loading the extension, open the side panel and navigate to Settings to configure your Zhipu API Key. The key is persisted locally and used for all GLM Image API calls.
The primary user interface is the Side Panel, which provides the following main views:
| Route | View | Description |
|---|---|---|
/ |
OverviewView |
Overview page with basic info and entries |
/tools |
ToolsView |
AI image generation โ enter prompts and generate images via GLM Image API |
/history |
HistoryView |
Generation history โ view, delete, download, or upload to cloud |
/cloud |
CloudView |
Cloud storage management โ manage objects uploaded to Tencent Cloud COS |
/settings |
SettingsView |
Configure API Key, COS settings, and theme |
The extension communicates with the Zhipu GLM Image API through an OpenAI-compatible client (lib/glm.ts). The API Key is user-configurable and stored in userSettingsStore, following the standard WXT storage pattern for cross-context sync.
Shared application state (theme, API key, COS settings, etc.) is persisted through WXT Storage (wxt/storage). Each UI entry's Pinia store watches storage changes and stays in sync:
โโโโโโโโโโโโ โโโโโโโโโโโโ
โ Popup โ โSidepanel โ
โ (Pinia) โ โ (Pinia) โ
โโโโโโฌโโโโโโ โโโโโโฌโโโโโโ
โ โ
โ wxt/storage โ
โโโโโโโโฌโโโโโโโโ
โ
โโโโโโโโโดโโโโโโโโ
โ Background โ
โ (Service Wkr) โ
โโโโโโโโโโโโโโโโโ
Translations are defined in locales/*.json and follow the browser's UI language. No runtime language switching โ WXT i18n maps to chrome.i18n / browser.i18n natively.
| Command | Description |
|---|---|
bun run dev |
Start dev server (Chrome) |
bun run dev:firefox |
Start dev server (Firefox) |
bun run build |
Build for production (Chrome) |
bun run build:firefox |
Build for production (Firefox) |
bun run zip |
Build and create .zip for Chrome |
bun run zip:firefox |
Build and create .zip for Firefox |
bun run lint |
Run ESLint |
bun run lint:fix |
Run ESLint with auto-fix |
bun run format |
Run ESLint with auto-fix |
bun run typecheck |
Run TypeScript type checking |
bun run commit |
Interactive conventional commit (cz-git) |
bun run release |
Bump version and generate CHANGELOG |
Planned features and improvements:
- GLM Image ๅๅฒ่ฎฐๅฝ็ฎก็ โ ็ฎก็ GLM Image ็ๆ็ๅพ็ๅๅฒ่ฎฐๅฝ๏ผๆฏๆๆฅ็ใๅ ้คๅ้ๆฐ็ๆใ
Image generation history management โ view, delete, and regenerate past results. - ้ๆ Tencent Cloud COS โ ๅฐ็ๆ็ๅพ็่ชๅจไธไผ ่ณ่
พ่ฎฏไบ COS๏ผ่ทๅๆฐธไน
ๅฏๅไบซ็้พๆฅใ
Integrate Tencent Cloud COS for automatic image uploads and permanent shareable links. - ไผๅ Side Panel UI ่ฎพ่ฎก โ ๆน่ฟ sidepanel ็็้ข่ฎพ่ฎกๅไบคไบไฝ้ชใ
Optimize the side panel UI design and user experience, and optimize the popup. - Chrome ้็ฅๅผน็ชไธญ็ๅคๅถ้พๆฅ โ ๅจ Chrome ้็ฅไธญ็ดๆฅๆไพๅคๅถๅพ็้พๆฅ็ๅ่ฝใ
Implement copy-link functionality in Chrome notification popups.
This project uses conventional commits with cz-git for standardized commit messages.
bun run commitFollow the prompts to select the type (feat, fix, docs, etc.) and scope. The commit message will be automatically formatted.
To release a new version:
bun run release # Auto-detect version bump
bun run release:patch # 0.0.x
bun run release:minor # 0.x.0
bun run release:major # x.0.0This will:
- Bump the version in
package.json - Generate / update
CHANGELOG.md - Create a git tag (
v*) - Trigger the GitHub Actions release workflow





