Slash commands for GitHub markdown fields. Includes /giphy GIF search and insert.
- Adds slash command palette to GitHub markdown textareas
/giphyto search and insert GIFs- Easily extensible with new commands
See docs/commands/README.md for a full list and usage details.
- Bun (v1.0+)
bun install
bun run build- Build:
bun install && bun run build - Open
chrome://extensions - Enable Developer mode
- Click Load unpacked
- Select the
distfolder
- Go to GitHub
- Open an issue or PR comment field
- Type
/giphy cats(or/gspfor command list) - Use arrow keys to navigate
- Press Enter to insert
- Press Esc to close
For development with automatic rebuilding:
bun run devThis starts Bun in watch mode. Reload the extension in Chrome to see changes.
To check bundle sizes:
bun run analyzeThis reports the size of each bundle after building.
Run Playwright E2E tests:
bun run test:e2esrc/
├── api/ # API clients (e.g., giphy.ts)
├── assets/ # Static assets (icons, images)
├── content/ # Content scripts
│ ├── commands/ # Slash command implementations
│ │ ├── giphy.ts
│ │ ├── gsp.ts
│ │ ├── index.ts
│ │ ├── registry.ts
│ │ └── registry.test.ts
│ ├── picker/ # Picker UI (supports .tsx files)
│ │ ├── picker.ts
│ │ ├── state.ts
│ │ └── styles.ts
│ ├── index.ts # Content entry
│ └── types.ts
├── utils/ # Shared utilities
│ ├── dom.ts
│ ├── dom.test.ts
│ ├── math.ts
│ ├── math.test.ts
│ ├── storage.ts
│ ├── storage.test.ts
│ └── theme.ts
dist/ # Build output (load in Chrome)
docs/ # Documentation
│ └── commands/ # Per-command docs
│ ├── README.md
│ ├── giphy/README.md
│ └── gsp/README.md
e2e/ # End-to-end tests (Playwright)
scripts/ # Build scripts
│ └── build.ts
PRIVACY.md # Privacy policy
package.json # Project metadata & scripts
tsconfig.json # TypeScript config
vitest.config.ts # Test config
playwright.config.ts # E2E test config
| Script | Description |
|---|---|
bun run build |
Production build to dist/ |
bun run dev |
Watch mode for development |
bun run typecheck |
TypeScript type checking |
bun run lint |
ESLint check |
bun run lint:fix |
ESLint auto-fix |
bun run format |
Format with Prettier |
bun run format:check |
Check Prettier formatting |
bun run test |
Run unit tests (Vitest) |
bun run test:e2e |
Run E2E tests (Playwright) |
bun run analyze |
Build and report bundle sizes |
bun run check |
Run all checks (type, lint, format, test) |
bun run clean |
Remove dist/ folder |
- Create a new file in
src/content/commands/and implement your command. - Register it in
src/content/commands/registry.tsand import insrc/content/index.ts. - Add end-user docs under
docs/commands/<command>/README.md.
Example skeleton:
import { registerCommand, type CommandSpec } from "./registry.ts";
const myCommand: CommandSpec = {
preflight: async () => ({ showSetup: false }),
getEmptyState: async () => ({ items: [] }),
getResults: async (query) => ({ items: [] }),
renderItems: (items, suggestTitle) => { /* ... */ },
renderCurrent: () => { /* ... */ },
onSelect: (item) => { /* ... */ },
};
registerCommand("mycommand", myCommand);- Type
/giphy - Paste your key in the setup panel
- Press Test to verify
- Press Save
- Open
chrome://extensions - Find GitHub Slash Palette
- Click Details
- Click Extension options
- Paste the key and Save
Where is the key stored?
The key is stored using
chrome.storage.localon your device only.
- Build Tool: Bun - Fast all-in-one JavaScript runtime
- UI Support: React/JSX available for components
- Testing: Vitest (unit tests) + Playwright (E2E tests)
- Language: TypeScript with JSX support
- Linting: ESLint + Prettier
See PRIVACY.md for the privacy policy.