CLI helper to resolve oh-my-product extension root path with env and override support.
// Source: https://github.com/jjongguet/oh-my-product | License: MIT | Copyright 2025 Kyeongmin Kim
// Provided via justclaw.it.com; keep this notice with the code.
import { promises as fs } from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import type { CliIo, CommandExecutionResult } from '../types.js';
import {
findUnknownOptions,
getStringOption,
hasFlag,
parseCliArgs,
} from './arg-utils.js';
export const OMP_EXTENSION_PATH_ENV = 'OMP_EXTENSION_PATH';
export const EXTENSION_ROOT_RELATIVE_PATH = '.';
export const EXTENSION_MANIFEST_FILE_NAME = 'gemini-extension.json';
export type ExtensionPathSource = 'override' | 'cwd' | 'installed';
export interface ResolvedExtensionPath {
source: ExtensionPathSource;
path: string;
manifestPath
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key