Skip to main content

GROK

Constant GROK 

Source
pub const GROK: &str = "// Grok CLI configuration script\n// Generates config files for Grok CLI\n\n// Grok uses OpenAI-compatible API\nlet config = #{\n    model: ctx.profile.model\n};\n\n// Build environment variables\nlet env = #{};\n\n// Only set API key and endpoint env vars if not self-authenticating\n// For self-auth, Grok CLI will use its built-in xAI provider\nif ctx.provider.type != \"self\" {\n    config.api_base = ctx.profile.endpoint;\n    env[\"GROK_BASE_URL\"] = ctx.profile.endpoint;\n    env[\"GROK_API_KEY\"] = \"${API_KEY}\";\n}\n\n// Return the output\n#{\n    files: #{\n        \".grok/config.json\": json::encode_pretty(config)\n    },\n    env: env,\n    hooks: (),\n    mcp_servers: ()\n}\n";