fix(cli): project_root 默认使用当前工作目录

loadConfig 无参数且无 AIRCODING_PROJECT_ROOT 时,
fallback 到 process.cwd(),支持在任意路径直接启动

用法: cd /any/path && bun run <repo>/packages/cli/src/index.ts run

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
AirCoding
2026-06-10 09:11:03 +08:00
parent b1ad99c5c1
commit f44b26bf82

View File

@@ -30,7 +30,7 @@ const DEFAULT_CONFIG: AirConfig = {
export function loadConfig(project_root?: string): AirConfig {
let config = { ...DEFAULT_CONFIG }
const resolved_project_root = project_root || process.env.AIRCODING_PROJECT_ROOT
const resolved_project_root = project_root || process.env.AIRCODING_PROJECT_ROOT || process.cwd()
// Load global config: ~/.air/config.json
const global_path = join(homedir(), '.air', 'config.json')