Lines 70-110javascript
72 await enableCodexPlugin(paths.codexConfigPath);
76 pluginName: PLUGIN_NAME,
77 marketplaceName: MARKETPLACE_NAME,
78 sourcePluginDir: sourceDir,
79 pluginDir: paths.pluginDir,
80 marketplacePath: paths.marketplacePath,
81 codexConfigPath: paths.codexConfigPath,
84 viewUrl: codexPluginUrl(paths.marketplacePath),
85 shareUrl: codexPluginUrl(paths.marketplacePath, "share"),
89export async function installCodexPolicy({ pluginDir, projectDir }) {
90 const policyUrl = pathToFileURL(path.join(pluginDir, "lib", "policy.mjs"));
91 const { installPolicy } = await import(policyUrl.href);
92 return installPolicy({ projectDir });
MediumDynamic Require
Package source references dynamic require/import behavior.
lib/codex-plugin.mjsView on unpkg · L90 95export function formatCodexPluginInstall(result) {
97 "Codex plugin installed:",
98 ` Source: ${result.sourcePluginDir}`,
99 ` Plugin: ${result.pluginDir}`,
100 ` Marketplace: ${result.marketplacePath}`,
101 ` Codex config: ${result.codexConfigPath}`,
102 ` Codex install: ${result.installedWithCodex ? "codex plugin add daruma@personal" : "config fallback"}`,
103 ` MCP resource: ${result.resourceUrl}`,
104 ` Open in Codex: ${result.viewUrl}`,
108async function installViaCodexCli({ runCommand = run } = {}) {
110 await runCommand("codex", ["plugin", "add", `${PLUGIN_NAME}@${MARKETPLACE_NAME}`]);