UNPKG

ai-x-terminal

Version:

Enhance your command-line experience with AI capabilities using OpenAI's API. Easily integrate with projects and leverage AI in the terminal.

14 lines (13 loc) 437 B
import fs from 'fs'; import path from 'path'; export function loadConfig() { const configPath = path.join(process.cwd(), '.ax.json'); if (fs.existsSync(configPath)) { return JSON.parse(fs.readFileSync(configPath, 'utf-8')); } return {}; } export function saveConfig(config) { const configPath = path.join(process.cwd(), '.ax.json'); fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + '\n'); }