Skip to main content
Glama
config.ts1.31 kB
import * as fs from "fs/promises"; import * as fsSync from "fs"; import * as path from "path"; import { ValeServerConfig } from "./types.js"; /** * Loads configuration from environment variables */ export function loadConfig(): ValeServerConfig { const config: ValeServerConfig = {}; // Load config path if specified if (process.env.VALE_CONFIG_PATH) { config.configPath = process.env.VALE_CONFIG_PATH; } return config; } /** * Checks if a .vale.ini file exists in the current working directory (async) */ export async function findValeIniInWorkingDir(): Promise<string | null> { const cwd = process.cwd(); const valeIniPath = path.join(cwd, ".vale.ini"); try { await fs.access(valeIniPath, fsSync.constants.R_OK); return valeIniPath; } catch { return null; } } /** * Verifies that a Vale config file exists and is readable (async) */ export async function verifyConfigFile(configPath: string): Promise<boolean> { try { await fs.access(configPath, fsSync.constants.R_OK); return true; } catch { return false; } } /** * Gets the absolute path for a config file */ export function resolveConfigPath(configPath: string): string { if (path.isAbsolute(configPath)) { return configPath; } return path.resolve(process.cwd(), configPath); }

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/theletterf/vale-mcp-server'

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