Skip to main content
Glama
gemini-profile.ts1.46 kB
/** * @fileoverview Gemini CLI Profile * Slash command profile for Google Gemini CLI. * * Format: * ``` * description="..." * prompt = """ * [content] * """ * ``` * * Location: .gemini/commands/*.toml */ import { BaseSlashCommandProfile } from './base-profile.js'; import type { SlashCommand, FormattedSlashCommand } from '../types.js'; /** * Gemini CLI profile for slash commands. * * Gemini uses a Python-style format with description and prompt fields. * The prompt content is wrapped in triple quotes. */ export class GeminiProfile extends BaseSlashCommandProfile { readonly name = 'gemini'; readonly displayName = 'Gemini'; readonly commandsDir = '.gemini/commands'; readonly extension = '.toml'; format(command: SlashCommand): FormattedSlashCommand { const description = this.escapeForPython(command.metadata.description); const content = this.escapeForTripleQuotedString(command.content.trim()); return { filename: this.getFilename(command.metadata.name), content: `description="${description}" prompt = """ ${content} """ ` }; } /** * Escape double quotes for Python string literals. */ private escapeForPython(str: string): string { return str.replace(/"/g, '\\"'); } /** * Escape content for use inside triple-quoted strings. * Prevents `"""` sequences from breaking the TOML delimiter. */ private escapeForTripleQuotedString(str: string): string { return str.replace(/"""/g, '""\\"'); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/eyaltoledano/claude-task-master'

If you have feedback or need assistance with the MCP directory API, please join our Discord server