MCPcopy Index your code
hub / github.com/continuedev/continue / determineConfigSource

Function determineConfigSource

extensions/cli/src/configLoader.ts:84–100  ·  view source on GitHub ↗

* Determines the configuration source using the specification's precedence rules: * 1. CLI --config flag (highest priority) * 2. Saved config URI (if no CLI flag) * 3. Default resolution (if no flag and no saved URI)

(
  authConfig: AuthConfig,
  cliConfigPath: string | undefined,
  _isHeadless: boolean | undefined,
)

Source from the content-addressed store, hash-verified

82 * 3. Default resolution (if no flag and no saved URI)
83 */
84function determineConfigSource(
85 authConfig: AuthConfig,
86 cliConfigPath: string | undefined,
87 _isHeadless: boolean | undefined,
88): ConfigSource {
89 // Priority 1: CLI --config flag
90 if (cliConfigPath) {
91 return { type: "cli-flag", path: cliConfigPath };
92 }
93
94 // Priority 2: Check for default config.yaml, then fallback to default config
95 const defaultConfigPath = path.join(env.continueHome, "config.yaml");
96 if (fs.existsSync(defaultConfigPath)) {
97 return { type: "local-config-yaml" };
98 }
99 return { type: "remote-default-config" };
100}
101
102/**
103 * Loads configuration from the determined source with appropriate error handling

Callers 1

loadConfigurationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected