package app import ( "fmt" "os" "path/filepath" "agentu/pkg/config" ) const defaultConfigContent = `# agentu configuration # Replace the placeholder values below with your actual provider settings. # See agentu.example.yaml for the full reference. providers: default: base_url: https://api.openai.com api_key: YOUR_API_KEY_HERE models: - id: gpt-4o context: 128000 - id: gpt-4o-mini context: 128000 ` func bootstrapConfig(configPath string) error { resolved, err := config.ResolvePath(configPath) if err != nil { return fmt.Errorf("resolve config path: %w", err) } dir := filepath.Dir(resolved) if err := os.MkdirAll(dir, 0o755); err != nil { return fmt.Errorf("create config directory: %w", err) } if err := os.WriteFile(resolved, []byte(defaultConfigContent), 0o644); err != nil { return fmt.Errorf("write default config: %w", err) } return nil }