From 7f13ce64eae7d0b3cccdf0312f61fb701841e39a Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 18 Feb 2025 01:06:18 +0200
Subject: [PATCH 01/83] refactor InitCliConfig

---
 pkg/config/config.go      |   2 +-
 pkg/config/config_load.go | 303 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 304 insertions(+), 1 deletion(-)
 create mode 100644 pkg/config/config_load.go

diff --git a/pkg/config/config.go b/pkg/config/config.go
index 66f9adbf02..033de0d38a 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -112,7 +112,7 @@ var (
 // InitCliConfig finds and merges CLI configurations in the following order: system dir, home dir, current dir, ENV vars, command-line arguments
 // https://dev.to/techschoolguru/load-config-from-file-environment-variables-in-golang-with-viper-2j2d
 // https://medium.com/@bnprashanth256/reading-configuration-files-and-environment-variables-in-go-golang-c2607f912b63
-func InitCliConfig(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks bool) (schema.AtmosConfiguration, error) {
+func InitCliConfigOld(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks bool) (schema.AtmosConfiguration, error) {
 	// atmosConfig is loaded from the following locations (from lower to higher priority):
 	// system dir (`/usr/local/etc/atmos` on Linux, `%LOCALAPPDATA%/atmos` on Windows)
 	// home dir (~/.atmos)
diff --git a/pkg/config/config_load.go b/pkg/config/config_load.go
new file mode 100644
index 0000000000..3a7e45c6d5
--- /dev/null
+++ b/pkg/config/config_load.go
@@ -0,0 +1,303 @@
+package config
+
+import (
+	"bytes"
+	"encoding/json"
+	"fmt"
+	"os"
+	"path/filepath"
+	"runtime"
+	"strings"
+
+	"github.com/cloudposse/atmos/pkg/schema"
+	"github.com/cloudposse/atmos/pkg/ui/theme"
+	u "github.com/cloudposse/atmos/pkg/utils"
+	"github.com/cloudposse/atmos/pkg/version"
+	"github.com/mitchellh/go-homedir"
+	"github.com/pkg/errors"
+	"github.com/spf13/viper"
+)
+
+func InitCliConfig(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks bool) (schema.AtmosConfiguration, error) {
+	var err error
+	v := viper.New()
+	v.SetTypeByDefaultValue(true)
+	wd, err := os.Getwd()
+	if err != nil {
+		return schema.AtmosConfiguration{}, err
+	}
+	IsEnvConfigPathRequired := os.Getenv("ATMOS_CLI_CONFIG_PATH") != ""
+	// Set default values
+	setDefaultConfiguration(v)
+	configSources := []struct {
+		paths    []string
+		required bool
+		name     string
+	}{
+		{paths: getSystemConfigPaths(), required: false, name: "system"},
+		{paths: []string{getHomeConfigPath()}, required: false, name: "home"},
+		{paths: []string{wd}, required: false, name: "work-dir"},
+		{paths: []string{os.Getenv("ATMOS_CLI_CONFIG_PATH")}, required: IsEnvConfigPathRequired, name: "env"},
+		{paths: []string{configAndStacksInfo.AtmosCliConfigPath}, required: false, name: "provider"},
+	}
+	// Read and merge configurations
+	configFound, err := readAndMergeConfigs(v, configSources)
+	if err != nil {
+		return schema.AtmosConfiguration{}, err
+	}
+
+	// Handle missing configurations
+	if !configFound {
+		if err := applyDefaultConfiguration(v); err != nil {
+			return schema.AtmosConfiguration{}, err
+		}
+	}
+
+	// Unmarshal configuration
+	var atmosConfig schema.AtmosConfiguration
+	if err := v.Unmarshal(&atmosConfig); err != nil {
+		return atmosConfig, err
+	}
+
+	// Process ENV vars
+	err = processEnvVars(&atmosConfig)
+	if err != nil {
+		return atmosConfig, err
+	}
+
+	// Process command-line args
+	err = processCommandLineArgs(&atmosConfig, configAndStacksInfo)
+	if err != nil {
+		return atmosConfig, err
+	}
+
+	// Process stores config
+	err = processStoreConfig(&atmosConfig)
+	if err != nil {
+		return atmosConfig, err
+	}
+
+	// Process the base path specified in the Terraform provider (which calls into the atmos code)
+	// This overrides all other atmos base path configs (`atmos.yaml`, ENV var `ATMOS_BASE_PATH`)
+	if configAndStacksInfo.AtmosBasePath != "" {
+		atmosConfig.BasePath = configAndStacksInfo.AtmosBasePath
+	}
+
+	// After unmarshalling, ensure AppendUserAgent is set if still empty
+	if atmosConfig.Components.Terraform.AppendUserAgent == "" {
+		atmosConfig.Components.Terraform.AppendUserAgent = fmt.Sprintf("Atmos/%s (Cloud Posse; +https://atmos.tools)", version.Version)
+	}
+
+	// Check config
+	err = checkConfig(atmosConfig, processStacks)
+	if err != nil {
+		return atmosConfig, err
+	}
+
+	// Convert stacks base path to absolute path
+	stacksBasePath := filepath.Join(atmosConfig.BasePath, atmosConfig.Stacks.BasePath)
+	stacksBaseAbsPath, err := filepath.Abs(stacksBasePath)
+	if err != nil {
+		return atmosConfig, err
+	}
+	atmosConfig.StacksBaseAbsolutePath = stacksBaseAbsPath
+
+	// Convert the included stack paths to absolute paths
+	includeStackAbsPaths, err := u.JoinAbsolutePathWithPaths(stacksBaseAbsPath, atmosConfig.Stacks.IncludedPaths)
+	if err != nil {
+		return atmosConfig, err
+	}
+	atmosConfig.IncludeStackAbsolutePaths = includeStackAbsPaths
+
+	// Convert the excluded stack paths to absolute paths
+	excludeStackAbsPaths, err := u.JoinAbsolutePathWithPaths(stacksBaseAbsPath, atmosConfig.Stacks.ExcludedPaths)
+	if err != nil {
+		return atmosConfig, err
+	}
+	atmosConfig.ExcludeStackAbsolutePaths = excludeStackAbsPaths
+
+	// Convert terraform dir to absolute path
+	terraformBasePath := filepath.Join(atmosConfig.BasePath, atmosConfig.Components.Terraform.BasePath)
+	terraformDirAbsPath, err := filepath.Abs(terraformBasePath)
+	if err != nil {
+		return atmosConfig, err
+	}
+	atmosConfig.TerraformDirAbsolutePath = terraformDirAbsPath
+
+	// Convert helmfile dir to absolute path
+	helmfileBasePath := filepath.Join(atmosConfig.BasePath, atmosConfig.Components.Helmfile.BasePath)
+	helmfileDirAbsPath, err := filepath.Abs(helmfileBasePath)
+	if err != nil {
+		return atmosConfig, err
+	}
+	atmosConfig.HelmfileDirAbsolutePath = helmfileDirAbsPath
+
+	if processStacks {
+		// If the specified stack name is a logical name, find all stack manifests in the provided paths
+		stackConfigFilesAbsolutePaths, stackConfigFilesRelativePaths, stackIsPhysicalPath, err := FindAllStackConfigsInPathsForStack(
+			atmosConfig,
+			configAndStacksInfo.Stack,
+			includeStackAbsPaths,
+			excludeStackAbsPaths,
+		)
+		if err != nil {
+			return atmosConfig, err
+		}
+
+		if len(stackConfigFilesAbsolutePaths) < 1 {
+			j, err := u.ConvertToYAML(includeStackAbsPaths)
+			if err != nil {
+				return atmosConfig, err
+			}
+			errorMessage := fmt.Sprintf("\nno stack manifests found in the provided "+
+				"paths:\n%s\n\nCheck if `base_path`, 'stacks.base_path', 'stacks.included_paths' and 'stacks.excluded_paths' are correctly set in CLI config "+
+				"files or ENV vars.", j)
+			return atmosConfig, errors.New(errorMessage)
+		}
+
+		atmosConfig.StackConfigFilesAbsolutePaths = stackConfigFilesAbsolutePaths
+		atmosConfig.StackConfigFilesRelativePaths = stackConfigFilesRelativePaths
+
+		if stackIsPhysicalPath {
+			u.LogTrace(fmt.Sprintf("\nThe stack '%s' matches the stack manifest %s\n",
+				configAndStacksInfo.Stack,
+				stackConfigFilesRelativePaths[0]),
+			)
+			atmosConfig.StackType = "Directory"
+		} else {
+			// The stack is a logical name
+			atmosConfig.StackType = "Logical"
+		}
+	}
+
+	atmosConfig.Initialized = true
+	return atmosConfig, nil
+}
+
+// readAndMergeConfigs handles all config loading logic
+func readAndMergeConfigs(v *viper.Viper, configSources []struct {
+	paths    []string
+	required bool
+	name     string
+}) (bool, error) {
+	configFound := false
+
+	for _, source := range configSources {
+		for _, rawPath := range source.paths {
+			if rawPath == "" {
+				continue
+			}
+
+			path := expandPath(rawPath)
+			absPath, err := filepath.Abs(path)
+			if err != nil {
+				if source.required {
+					return false, fmt.Errorf("invalid config path %s: %w", path, err)
+				}
+				continue
+			}
+
+			// Check if path exists for required sources
+			if source.required {
+				if _, err := os.Stat(absPath); os.IsNotExist(err) {
+					return false, fmt.Errorf("required config path not found: %s", absPath)
+				}
+			}
+
+			v.AddConfigPath(absPath)
+		}
+	}
+	// Try all configuration names and extensions
+	configNames := []string{"atmos", ".atmos"}
+	configExtensions := []string{"yaml", "yml"}
+	// Try all combinations of config names and extensions
+	for _, name := range configNames {
+		v.SetConfigName(name)
+		yamlExist := false
+		for _, ext := range configExtensions {
+			if yamlExist {
+				continue
+			}
+			v.SetConfigType(ext)
+			if err := v.MergeInConfig(); err == nil {
+				configFound = true
+				yamlExist = true
+			} else if _, ok := err.(viper.ConfigFileNotFoundError); !ok {
+				return false, err
+			}
+		}
+	}
+
+	return configFound, nil
+}
+
+// Helper functions
+func setDefaultConfiguration(v *viper.Viper) {
+	v.SetDefault("components.helmfile.use_eks", true)
+	v.SetDefault("components.terraform.append_user_agent",
+		fmt.Sprintf("Atmos/%s (Cloud Posse; +https://atmos.tools)", version.Version))
+	v.SetDefault("settings.inject_github_token", true)
+	v.SetDefault("logs.file", "/dev/stderr")
+	v.SetDefault("logs.level", "Info")
+
+}
+
+func getSystemConfigPaths() []string {
+	if runtime.GOOS == "windows" {
+		if appData := os.Getenv(WindowsAppDataEnvVar); appData != "" {
+			return []string{filepath.Join(appData, "atmos")}
+		}
+		return []string{}
+	}
+	return []string{SystemDirConfigFilePath}
+}
+
+func getHomeConfigPath() string {
+	home, err := homedir.Dir()
+	if err != nil {
+		return ""
+	}
+	return filepath.Join(home, ".atmos")
+}
+
+func isRemoteConfig(path string) bool {
+	return strings.HasPrefix(path, "http://") || strings.HasPrefix(path, "https://")
+}
+
+func addRemoteConfig(v *viper.Viper, url string) error {
+	parts := strings.SplitN(url, "://", 2)
+	if len(parts) != 2 {
+		return fmt.Errorf("invalid remote config URL: %s", url)
+	}
+
+	v.AddRemoteProvider(parts[0], parts[1], "")
+	v.SetConfigType("yaml")
+	return v.ReadRemoteConfig()
+}
+
+func applyDefaultConfiguration(v *viper.Viper) error {
+	logsLevel := os.Getenv("ATMOS_LOGS_LEVEL")
+	if logsLevel == u.LogLevelDebug || logsLevel == u.LogLevelTrace {
+		var atmosConfig schema.AtmosConfiguration
+		u.PrintMessageInColor("Using default configuration...\n", theme.Colors.Info)
+		err := u.PrintAsYAMLToFileDescriptor(atmosConfig, defaultCliConfig)
+		if err != nil {
+			return err
+		}
+	}
+
+	defaultConfig, err := json.Marshal(defaultCliConfig)
+	if err != nil {
+		return err
+	}
+	return v.MergeConfig(bytes.NewReader(defaultConfig))
+}
+
+func expandPath(path string) string {
+	if strings.HasPrefix(path, "~/") {
+		if home, err := homedir.Dir(); err == nil {
+			return filepath.Join(home, path[2:])
+		}
+	}
+	return path
+}

From 9ed97f7eec14172c9245dbeb3cf13746307f52dc Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 18 Feb 2025 22:38:33 +0200
Subject: [PATCH 02/83] add readConfig function

---
 pkg/config/config_load.go | 120 ++++++++++++--------------------------
 1 file changed, 38 insertions(+), 82 deletions(-)

diff --git a/pkg/config/config_load.go b/pkg/config/config_load.go
index 3a7e45c6d5..e282581823 100644
--- a/pkg/config/config_load.go
+++ b/pkg/config/config_load.go
@@ -18,39 +18,28 @@ import (
 	"github.com/spf13/viper"
 )
 
+type ConfigSources struct {
+	paths          string
+	atmosFileNames string
+}
+
 func InitCliConfig(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks bool) (schema.AtmosConfiguration, error) {
-	var err error
 	v := viper.New()
+	//var source []configSources
+	v.SetConfigType("yaml")
 	v.SetTypeByDefaultValue(true)
-	wd, err := os.Getwd()
+	setDefaultConfiguration(v)
+	err := readSystemConfig(v)
 	if err != nil {
 		return schema.AtmosConfiguration{}, err
 	}
-	IsEnvConfigPathRequired := os.Getenv("ATMOS_CLI_CONFIG_PATH") != ""
-	// Set default values
-	setDefaultConfiguration(v)
-	configSources := []struct {
-		paths    []string
-		required bool
-		name     string
-	}{
-		{paths: getSystemConfigPaths(), required: false, name: "system"},
-		{paths: []string{getHomeConfigPath()}, required: false, name: "home"},
-		{paths: []string{wd}, required: false, name: "work-dir"},
-		{paths: []string{os.Getenv("ATMOS_CLI_CONFIG_PATH")}, required: IsEnvConfigPathRequired, name: "env"},
-		{paths: []string{configAndStacksInfo.AtmosCliConfigPath}, required: false, name: "provider"},
-	}
-	// Read and merge configurations
-	configFound, err := readAndMergeConfigs(v, configSources)
+	wd, err := os.Getwd()
 	if err != nil {
 		return schema.AtmosConfiguration{}, err
 	}
-
-	// Handle missing configurations
-	if !configFound {
-		if err := applyDefaultConfiguration(v); err != nil {
-			return schema.AtmosConfiguration{}, err
-		}
+	err = readConfig(v, wd, CliConfigFileName, true)
+	if err != nil {
+		return schema.AtmosConfiguration{}, err
 	}
 
 	// Unmarshal configuration
@@ -173,62 +162,18 @@ func InitCliConfig(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks
 	atmosConfig.Initialized = true
 	return atmosConfig, nil
 }
-
-// readAndMergeConfigs handles all config loading logic
-func readAndMergeConfigs(v *viper.Viper, configSources []struct {
-	paths    []string
-	required bool
-	name     string
-}) (bool, error) {
-	configFound := false
-
-	for _, source := range configSources {
-		for _, rawPath := range source.paths {
-			if rawPath == "" {
-				continue
-			}
-
-			path := expandPath(rawPath)
-			absPath, err := filepath.Abs(path)
-			if err != nil {
-				if source.required {
-					return false, fmt.Errorf("invalid config path %s: %w", path, err)
-				}
-				continue
-			}
-
-			// Check if path exists for required sources
-			if source.required {
-				if _, err := os.Stat(absPath); os.IsNotExist(err) {
-					return false, fmt.Errorf("required config path not found: %s", absPath)
-				}
-			}
-
-			v.AddConfigPath(absPath)
-		}
-	}
-	// Try all configuration names and extensions
-	configNames := []string{"atmos", ".atmos"}
-	configExtensions := []string{"yaml", "yml"}
-	// Try all combinations of config names and extensions
-	for _, name := range configNames {
-		v.SetConfigName(name)
-		yamlExist := false
-		for _, ext := range configExtensions {
-			if yamlExist {
-				continue
-			}
-			v.SetConfigType(ext)
-			if err := v.MergeInConfig(); err == nil {
-				configFound = true
-				yamlExist = true
-			} else if _, ok := err.(viper.ConfigFileNotFoundError); !ok {
-				return false, err
-			}
+func readConfig(v *viper.Viper, path string, fileName string, required bool) error {
+	v.AddConfigPath(path)
+	v.SetConfigName(fileName)
+	err := v.ReadInConfig()
+	if err != nil {
+		if required {
+			return err
 		}
+		return err
 	}
 
-	return configFound, nil
+	return nil
 }
 
 // Helper functions
@@ -242,14 +187,25 @@ func setDefaultConfiguration(v *viper.Viper) {
 
 }
 
-func getSystemConfigPaths() []string {
+func readSystemConfig(v *viper.Viper) error {
+	configFilePath := ""
 	if runtime.GOOS == "windows" {
-		if appData := os.Getenv(WindowsAppDataEnvVar); appData != "" {
-			return []string{filepath.Join(appData, "atmos")}
+		appDataDir := os.Getenv(WindowsAppDataEnvVar)
+		if len(appDataDir) > 0 {
+			configFilePath = appDataDir
+		}
+	} else {
+		configFilePath = SystemDirConfigFilePath
+	}
+
+	if len(configFilePath) > 0 {
+		err := readConfig(v, configFilePath, CliConfigFileName, false)
+		if err != nil {
+			return err
 		}
-		return []string{}
 	}
-	return []string{SystemDirConfigFilePath}
+	return nil
+
 }
 
 func getHomeConfigPath() string {

From 1fe3e6694fd0e78449adf23dd284eab31c5d12cb Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Wed, 19 Feb 2025 00:50:22 +0200
Subject: [PATCH 03/83] add load config

---
 pkg/config/config.go      | 156 +----------------------
 pkg/config/config_load.go | 259 --------------------------------------
 pkg/config/load.go        | 229 +++++++++++++++++++++++++++++++++
 3 files changed, 231 insertions(+), 413 deletions(-)
 delete mode 100644 pkg/config/config_load.go
 create mode 100644 pkg/config/load.go

diff --git a/pkg/config/config.go b/pkg/config/config.go
index c12f09c733..18df7af9fe 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -1,20 +1,15 @@
 package config
 
 import (
-	"bytes"
-	"encoding/json"
 	"fmt"
 	"os"
 	"path/filepath"
-	"runtime"
 
-	"github.com/mitchellh/go-homedir"
 	"github.com/pkg/errors"
 	"github.com/spf13/viper"
 
 	"github.com/cloudposse/atmos/internal/tui/templates"
 	"github.com/cloudposse/atmos/pkg/schema"
-	"github.com/cloudposse/atmos/pkg/ui/theme"
 	u "github.com/cloudposse/atmos/pkg/utils"
 	"github.com/cloudposse/atmos/pkg/version"
 )
@@ -112,7 +107,7 @@ var (
 // InitCliConfig finds and merges CLI configurations in the following order: system dir, home dir, current dir, ENV vars, command-line arguments
 // https://dev.to/techschoolguru/load-config-from-file-environment-variables-in-golang-with-viper-2j2d
 // https://medium.com/@bnprashanth256/reading-configuration-files-and-environment-variables-in-go-golang-c2607f912b63
-func InitCliConfigOld(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks bool) (schema.AtmosConfiguration, error) {
+func InitCliConfig(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks bool) (schema.AtmosConfiguration, error) {
 	// atmosConfig is loaded from the following locations (from lower to higher priority):
 	// system dir (`/usr/local/etc/atmos` on Linux, `%LOCALAPPDATA%/atmos` on Windows)
 	// home dir (~/.atmos)
@@ -120,157 +115,10 @@ func InitCliConfigOld(configAndStacksInfo schema.ConfigAndStacksInfo, processSta
 	// ENV vars
 	// Command-line arguments
 
-	var atmosConfig schema.AtmosConfiguration
-	var err error
-	configFound := false
-	var found bool
-
-	v := viper.New()
-	v.SetConfigType("yaml")
-	v.SetTypeByDefaultValue(true)
-
-	// Default configuration values
-	v.SetDefault("components.helmfile.use_eks", true)
-	v.SetDefault("components.terraform.append_user_agent", fmt.Sprintf("Atmos/%s (Cloud Posse; +https://atmos.tools)", version.Version))
-	v.SetDefault("settings.inject_github_token", true)
-
-	v.SetDefault("logs.file", "/dev/stderr")
-	v.SetDefault("logs.level", "Info")
-
-	// Process config in system folder
-	configFilePath1 := ""
-	atmosConfigFilePath := ""
-	// https://pureinfotech.com/list-environment-variables-windows-10/
-	// https://docs.microsoft.com/en-us/windows/deployment/usmt/usmt-recognized-environment-variables
-	// https://softwareengineering.stackexchange.com/questions/299869/where-is-the-appropriate-place-to-put-application-configuration-files-for-each-p
-	// https://stackoverflow.com/questions/37946282/why-does-appdata-in-windows-7-seemingly-points-to-wrong-folder
-	if runtime.GOOS == "windows" {
-		appDataDir := os.Getenv(WindowsAppDataEnvVar)
-		if len(appDataDir) > 0 {
-			configFilePath1 = appDataDir
-		}
-	} else {
-		configFilePath1 = SystemDirConfigFilePath
-	}
-
-	if len(configFilePath1) > 0 {
-		configFile1 := filepath.Join(configFilePath1, CliConfigFileName)
-		found, err = processConfigFile(atmosConfig, configFile1, v)
-		if err != nil {
-			return atmosConfig, err
-		}
-		if found {
-			configFound = true
-			atmosConfigFilePath = configFile1
-		}
-	}
-
-	// Process config in user's HOME dir
-	configFilePath2, err := homedir.Dir()
-	if err != nil {
-		return atmosConfig, err
-	}
-	configFile2 := filepath.Join(configFilePath2, ".atmos", CliConfigFileName)
-	found, err = processConfigFile(atmosConfig, configFile2, v)
-	if err != nil {
-		return atmosConfig, err
-	}
-	if found {
-		configFound = true
-		atmosConfigFilePath = configFile2
-	}
-
-	// Process config in the current dir
-	configFilePath3, err := os.Getwd()
-	if err != nil {
-		return atmosConfig, err
-	}
-	configFile3 := filepath.Join(configFilePath3, CliConfigFileName)
-	found, err = processConfigFile(atmosConfig, configFile3, v)
-	if err != nil {
-		return atmosConfig, err
-	}
-	if found {
-		configFound = true
-		atmosConfigFilePath = configFile3
-	}
-
-	// Process config from the path in ENV var `ATMOS_CLI_CONFIG_PATH`
-	configFilePath4 := os.Getenv("ATMOS_CLI_CONFIG_PATH")
-	if len(configFilePath4) > 0 {
-		u.LogTrace(fmt.Sprintf("Found ENV var ATMOS_CLI_CONFIG_PATH=%s", configFilePath4))
-		configFile4 := filepath.Join(configFilePath4, CliConfigFileName)
-		found, err = processConfigFile(atmosConfig, configFile4, v)
-		if err != nil {
-			return atmosConfig, err
-		}
-		if found {
-			configFound = true
-			atmosConfigFilePath = configFile4
-		}
-	}
-
-	// Process config from the path specified in the Terraform provider (which calls into the atmos code)
-	if configAndStacksInfo.AtmosCliConfigPath != "" {
-		configFilePath5 := configAndStacksInfo.AtmosCliConfigPath
-		if len(configFilePath5) > 0 {
-			configFile5 := filepath.Join(configFilePath5, CliConfigFileName)
-			found, err = processConfigFile(atmosConfig, configFile5, v)
-			if err != nil {
-				return atmosConfig, err
-			}
-			if found {
-				configFound = true
-				atmosConfigFilePath = configFile5
-			}
-		}
-	}
-
-	if !configFound {
-		// If `atmos.yaml` not found, use the default config
-		// Set `ATMOS_LOGS_LEVEL` ENV var to "Debug" to see the message about Atmos using the default CLI config
-		logsLevelEnvVar := os.Getenv("ATMOS_LOGS_LEVEL")
-		if logsLevelEnvVar == u.LogLevelDebug || logsLevelEnvVar == u.LogLevelTrace {
-			u.PrintMessageInColor("'atmos.yaml' CLI config was not found in any of the searched paths: system dir, home dir, current dir, ENV vars.\n"+
-				"Refer to https://atmos.tools/cli/configuration for details on how to configure 'atmos.yaml'.\n"+
-				"Using the default CLI config:\n\n", theme.Colors.Info)
-
-			err = u.PrintAsYAMLToFileDescriptor(atmosConfig, defaultCliConfig)
-			if err != nil {
-				return atmosConfig, err
-			}
-			fmt.Println()
-		}
-
-		j, err := json.Marshal(defaultCliConfig)
-		if err != nil {
-			return atmosConfig, err
-		}
-
-		reader := bytes.NewReader(j)
-		err = v.MergeConfig(reader)
-		if err != nil {
-			return atmosConfig, err
-		}
-	}
-	// We want the editorconfig color by default to be true
-	atmosConfig.Validate.EditorConfig.Color = true
-	// https://gist.github.com/chazcheadle/45bf85b793dea2b71bd05ebaa3c28644
-	// https://sagikazarmark.hu/blog/decoding-custom-formats-with-viper/
-	err = v.Unmarshal(&atmosConfig)
+	atmosConfig, err := LoadConfig(configAndStacksInfo)
 	if err != nil {
 		return atmosConfig, err
 	}
-	// Set the CLI config path in the atmosConfig struct
-	if filepath.IsAbs(atmosConfigFilePath) {
-		atmosConfig.CliConfigPath = atmosConfigFilePath
-	} else {
-		absPath, err := filepath.Abs(atmosConfigFilePath)
-		if err != nil {
-			return atmosConfig, err
-		}
-		atmosConfig.CliConfigPath = absPath
-	}
 	// Process ENV vars
 	err = processEnvVars(&atmosConfig)
 	if err != nil {
diff --git a/pkg/config/config_load.go b/pkg/config/config_load.go
deleted file mode 100644
index e282581823..0000000000
--- a/pkg/config/config_load.go
+++ /dev/null
@@ -1,259 +0,0 @@
-package config
-
-import (
-	"bytes"
-	"encoding/json"
-	"fmt"
-	"os"
-	"path/filepath"
-	"runtime"
-	"strings"
-
-	"github.com/cloudposse/atmos/pkg/schema"
-	"github.com/cloudposse/atmos/pkg/ui/theme"
-	u "github.com/cloudposse/atmos/pkg/utils"
-	"github.com/cloudposse/atmos/pkg/version"
-	"github.com/mitchellh/go-homedir"
-	"github.com/pkg/errors"
-	"github.com/spf13/viper"
-)
-
-type ConfigSources struct {
-	paths          string
-	atmosFileNames string
-}
-
-func InitCliConfig(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks bool) (schema.AtmosConfiguration, error) {
-	v := viper.New()
-	//var source []configSources
-	v.SetConfigType("yaml")
-	v.SetTypeByDefaultValue(true)
-	setDefaultConfiguration(v)
-	err := readSystemConfig(v)
-	if err != nil {
-		return schema.AtmosConfiguration{}, err
-	}
-	wd, err := os.Getwd()
-	if err != nil {
-		return schema.AtmosConfiguration{}, err
-	}
-	err = readConfig(v, wd, CliConfigFileName, true)
-	if err != nil {
-		return schema.AtmosConfiguration{}, err
-	}
-
-	// Unmarshal configuration
-	var atmosConfig schema.AtmosConfiguration
-	if err := v.Unmarshal(&atmosConfig); err != nil {
-		return atmosConfig, err
-	}
-
-	// Process ENV vars
-	err = processEnvVars(&atmosConfig)
-	if err != nil {
-		return atmosConfig, err
-	}
-
-	// Process command-line args
-	err = processCommandLineArgs(&atmosConfig, configAndStacksInfo)
-	if err != nil {
-		return atmosConfig, err
-	}
-
-	// Process stores config
-	err = processStoreConfig(&atmosConfig)
-	if err != nil {
-		return atmosConfig, err
-	}
-
-	// Process the base path specified in the Terraform provider (which calls into the atmos code)
-	// This overrides all other atmos base path configs (`atmos.yaml`, ENV var `ATMOS_BASE_PATH`)
-	if configAndStacksInfo.AtmosBasePath != "" {
-		atmosConfig.BasePath = configAndStacksInfo.AtmosBasePath
-	}
-
-	// After unmarshalling, ensure AppendUserAgent is set if still empty
-	if atmosConfig.Components.Terraform.AppendUserAgent == "" {
-		atmosConfig.Components.Terraform.AppendUserAgent = fmt.Sprintf("Atmos/%s (Cloud Posse; +https://atmos.tools)", version.Version)
-	}
-
-	// Check config
-	err = checkConfig(atmosConfig, processStacks)
-	if err != nil {
-		return atmosConfig, err
-	}
-
-	// Convert stacks base path to absolute path
-	stacksBasePath := filepath.Join(atmosConfig.BasePath, atmosConfig.Stacks.BasePath)
-	stacksBaseAbsPath, err := filepath.Abs(stacksBasePath)
-	if err != nil {
-		return atmosConfig, err
-	}
-	atmosConfig.StacksBaseAbsolutePath = stacksBaseAbsPath
-
-	// Convert the included stack paths to absolute paths
-	includeStackAbsPaths, err := u.JoinAbsolutePathWithPaths(stacksBaseAbsPath, atmosConfig.Stacks.IncludedPaths)
-	if err != nil {
-		return atmosConfig, err
-	}
-	atmosConfig.IncludeStackAbsolutePaths = includeStackAbsPaths
-
-	// Convert the excluded stack paths to absolute paths
-	excludeStackAbsPaths, err := u.JoinAbsolutePathWithPaths(stacksBaseAbsPath, atmosConfig.Stacks.ExcludedPaths)
-	if err != nil {
-		return atmosConfig, err
-	}
-	atmosConfig.ExcludeStackAbsolutePaths = excludeStackAbsPaths
-
-	// Convert terraform dir to absolute path
-	terraformBasePath := filepath.Join(atmosConfig.BasePath, atmosConfig.Components.Terraform.BasePath)
-	terraformDirAbsPath, err := filepath.Abs(terraformBasePath)
-	if err != nil {
-		return atmosConfig, err
-	}
-	atmosConfig.TerraformDirAbsolutePath = terraformDirAbsPath
-
-	// Convert helmfile dir to absolute path
-	helmfileBasePath := filepath.Join(atmosConfig.BasePath, atmosConfig.Components.Helmfile.BasePath)
-	helmfileDirAbsPath, err := filepath.Abs(helmfileBasePath)
-	if err != nil {
-		return atmosConfig, err
-	}
-	atmosConfig.HelmfileDirAbsolutePath = helmfileDirAbsPath
-
-	if processStacks {
-		// If the specified stack name is a logical name, find all stack manifests in the provided paths
-		stackConfigFilesAbsolutePaths, stackConfigFilesRelativePaths, stackIsPhysicalPath, err := FindAllStackConfigsInPathsForStack(
-			atmosConfig,
-			configAndStacksInfo.Stack,
-			includeStackAbsPaths,
-			excludeStackAbsPaths,
-		)
-		if err != nil {
-			return atmosConfig, err
-		}
-
-		if len(stackConfigFilesAbsolutePaths) < 1 {
-			j, err := u.ConvertToYAML(includeStackAbsPaths)
-			if err != nil {
-				return atmosConfig, err
-			}
-			errorMessage := fmt.Sprintf("\nno stack manifests found in the provided "+
-				"paths:\n%s\n\nCheck if `base_path`, 'stacks.base_path', 'stacks.included_paths' and 'stacks.excluded_paths' are correctly set in CLI config "+
-				"files or ENV vars.", j)
-			return atmosConfig, errors.New(errorMessage)
-		}
-
-		atmosConfig.StackConfigFilesAbsolutePaths = stackConfigFilesAbsolutePaths
-		atmosConfig.StackConfigFilesRelativePaths = stackConfigFilesRelativePaths
-
-		if stackIsPhysicalPath {
-			u.LogTrace(fmt.Sprintf("\nThe stack '%s' matches the stack manifest %s\n",
-				configAndStacksInfo.Stack,
-				stackConfigFilesRelativePaths[0]),
-			)
-			atmosConfig.StackType = "Directory"
-		} else {
-			// The stack is a logical name
-			atmosConfig.StackType = "Logical"
-		}
-	}
-
-	atmosConfig.Initialized = true
-	return atmosConfig, nil
-}
-func readConfig(v *viper.Viper, path string, fileName string, required bool) error {
-	v.AddConfigPath(path)
-	v.SetConfigName(fileName)
-	err := v.ReadInConfig()
-	if err != nil {
-		if required {
-			return err
-		}
-		return err
-	}
-
-	return nil
-}
-
-// Helper functions
-func setDefaultConfiguration(v *viper.Viper) {
-	v.SetDefault("components.helmfile.use_eks", true)
-	v.SetDefault("components.terraform.append_user_agent",
-		fmt.Sprintf("Atmos/%s (Cloud Posse; +https://atmos.tools)", version.Version))
-	v.SetDefault("settings.inject_github_token", true)
-	v.SetDefault("logs.file", "/dev/stderr")
-	v.SetDefault("logs.level", "Info")
-
-}
-
-func readSystemConfig(v *viper.Viper) error {
-	configFilePath := ""
-	if runtime.GOOS == "windows" {
-		appDataDir := os.Getenv(WindowsAppDataEnvVar)
-		if len(appDataDir) > 0 {
-			configFilePath = appDataDir
-		}
-	} else {
-		configFilePath = SystemDirConfigFilePath
-	}
-
-	if len(configFilePath) > 0 {
-		err := readConfig(v, configFilePath, CliConfigFileName, false)
-		if err != nil {
-			return err
-		}
-	}
-	return nil
-
-}
-
-func getHomeConfigPath() string {
-	home, err := homedir.Dir()
-	if err != nil {
-		return ""
-	}
-	return filepath.Join(home, ".atmos")
-}
-
-func isRemoteConfig(path string) bool {
-	return strings.HasPrefix(path, "http://") || strings.HasPrefix(path, "https://")
-}
-
-func addRemoteConfig(v *viper.Viper, url string) error {
-	parts := strings.SplitN(url, "://", 2)
-	if len(parts) != 2 {
-		return fmt.Errorf("invalid remote config URL: %s", url)
-	}
-
-	v.AddRemoteProvider(parts[0], parts[1], "")
-	v.SetConfigType("yaml")
-	return v.ReadRemoteConfig()
-}
-
-func applyDefaultConfiguration(v *viper.Viper) error {
-	logsLevel := os.Getenv("ATMOS_LOGS_LEVEL")
-	if logsLevel == u.LogLevelDebug || logsLevel == u.LogLevelTrace {
-		var atmosConfig schema.AtmosConfiguration
-		u.PrintMessageInColor("Using default configuration...\n", theme.Colors.Info)
-		err := u.PrintAsYAMLToFileDescriptor(atmosConfig, defaultCliConfig)
-		if err != nil {
-			return err
-		}
-	}
-
-	defaultConfig, err := json.Marshal(defaultCliConfig)
-	if err != nil {
-		return err
-	}
-	return v.MergeConfig(bytes.NewReader(defaultConfig))
-}
-
-func expandPath(path string) string {
-	if strings.HasPrefix(path, "~/") {
-		if home, err := homedir.Dir(); err == nil {
-			return filepath.Join(home, path[2:])
-		}
-	}
-	return path
-}
diff --git a/pkg/config/load.go b/pkg/config/load.go
new file mode 100644
index 0000000000..398977e6d9
--- /dev/null
+++ b/pkg/config/load.go
@@ -0,0 +1,229 @@
+package config
+
+import (
+	"bytes"
+	"encoding/json"
+	"fmt"
+	"os"
+	"path/filepath"
+	"runtime"
+
+	"github.com/cloudposse/atmos/pkg/schema"
+	"github.com/cloudposse/atmos/pkg/ui/theme"
+	u "github.com/cloudposse/atmos/pkg/utils"
+	"github.com/cloudposse/atmos/pkg/version"
+	"github.com/mitchellh/go-homedir"
+	"github.com/spf13/viper"
+)
+
+type ConfigSources struct {
+	paths          string
+	atmosFileNames string
+}
+
+func LoadConfig(configAndStacksInfo schema.ConfigAndStacksInfo) (schema.AtmosConfiguration, error) {
+	v := viper.New()
+	var atmosConfig schema.AtmosConfiguration
+	v.SetConfigType("yaml")
+	v.SetTypeByDefaultValue(true)
+	setDefaultConfiguration(v)
+	err := readSystemConfig(v)
+	if err != nil {
+		return atmosConfig, err
+	}
+	err = readHomeConfig(v)
+	if err != nil {
+		return atmosConfig, err
+	}
+	err = readWorkDirConfig(v)
+	if err != nil {
+		return atmosConfig, err
+	}
+	err = readEnvAmosConfigPath(v)
+	if err != nil {
+		return atmosConfig, err
+	}
+	if configAndStacksInfo.AtmosCliConfigPath != "" {
+		configFilePath := configAndStacksInfo.AtmosCliConfigPath
+		if len(configFilePath) > 0 {
+			err := mergeConfig(v, configFilePath, CliConfigFileName)
+			switch err.(type) {
+			case viper.ConfigFileNotFoundError:
+				u.LogTrace(fmt.Sprintf("Not Found config file %s", configFilePath))
+			default:
+				return atmosConfig, err
+			}
+		}
+	}
+
+	atmosConfig.CliConfigPath = v.ConfigFileUsed()
+
+	if atmosConfig.CliConfigPath == "" {
+		// If `atmos.yaml` not found, use the default config
+		// Set `ATMOS_LOGS_LEVEL` ENV var to "Debug" to see the message about Atmos using the default CLI config
+		logsLevelEnvVar := os.Getenv("ATMOS_LOGS_LEVEL")
+		if logsLevelEnvVar == u.LogLevelDebug || logsLevelEnvVar == u.LogLevelTrace {
+			u.PrintMessageInColor("'atmos.yaml' CLI config was not found in any of the searched paths: system dir, home dir, current dir, ENV vars.\n"+
+				"Refer to https://atmos.tools/cli/configuration for details on how to configure 'atmos.yaml'.\n"+
+				"Using the default CLI config:\n\n", theme.Colors.Info)
+
+			err = u.PrintAsYAMLToFileDescriptor(atmosConfig, defaultCliConfig)
+			if err != nil {
+				return atmosConfig, err
+			}
+			fmt.Println()
+		}
+
+		j, err := json.Marshal(defaultCliConfig)
+		if err != nil {
+			return atmosConfig, err
+		}
+
+		reader := bytes.NewReader(j)
+		err = v.MergeConfig(reader)
+		if err != nil {
+			return atmosConfig, err
+		}
+	}
+	// Set the CLI config path in the atmosConfig struct
+	if !filepath.IsAbs(atmosConfig.CliConfigPath) {
+		absPath, err := filepath.Abs(atmosConfig.CliConfigPath)
+		if err != nil {
+			return atmosConfig, err
+		}
+		atmosConfig.CliConfigPath = absPath
+	}
+	// We want the editorconfig color by default to be true
+	atmosConfig.Validate.EditorConfig.Color = true
+	// https://gist.github.com/chazcheadle/45bf85b793dea2b71bd05ebaa3c28644
+	// https://sagikazarmark.hu/blog/decoding-custom-formats-with-viper/
+	err = v.Unmarshal(&atmosConfig)
+	if err != nil {
+		return atmosConfig, err
+	}
+	return atmosConfig, nil
+}
+
+// setDefaultConfiguration set default configuration for the viper instance.
+func setDefaultConfiguration(v *viper.Viper) {
+	v.SetDefault("components.helmfile.use_eks", true)
+	v.SetDefault("components.terraform.append_user_agent",
+		fmt.Sprintf("Atmos/%s (Cloud Posse; +https://atmos.tools)", version.Version))
+	v.SetDefault("settings.inject_github_token", true)
+	v.SetDefault("logs.file", "/dev/stderr")
+	v.SetDefault("logs.level", "Info")
+
+}
+
+// readSystemConfig load config from system dir
+func readSystemConfig(v *viper.Viper) error {
+	configFilePath := ""
+	if runtime.GOOS == "windows" {
+		appDataDir := os.Getenv(WindowsAppDataEnvVar)
+		if len(appDataDir) > 0 {
+			configFilePath = appDataDir
+		}
+	} else {
+		configFilePath = SystemDirConfigFilePath
+	}
+
+	if len(configFilePath) > 0 {
+		err := mergeConfig(v, configFilePath, CliConfigFileName)
+		switch err.(type) {
+		case viper.ConfigFileNotFoundError:
+			return nil
+		default:
+			return err
+		}
+	}
+	return nil
+
+}
+
+// readHomeConfig load config from user's HOME dir
+func readHomeConfig(v *viper.Viper) error {
+	home, err := homedir.Dir()
+	if err != nil {
+		return err
+	}
+	configFilePath := filepath.Join(home, ".atmos")
+	err = mergeConfig(v, configFilePath, CliConfigFileName)
+	if err != nil {
+		switch err.(type) {
+		case viper.ConfigFileNotFoundError:
+			return nil
+		default:
+			return err
+		}
+	}
+	return nil
+}
+
+// readWorkDirConfig load config from current working directory
+func readWorkDirConfig(v *viper.Viper) error {
+	wd, err := os.Getwd()
+	if err != nil {
+		return err
+	}
+	err = mergeConfig(v, wd, CliConfigFileName)
+	if err != nil {
+		switch err.(type) {
+		case viper.ConfigFileNotFoundError:
+			return nil
+		default:
+			return err
+		}
+	}
+	return nil
+}
+
+func readEnvAmosConfigPath(v *viper.Viper) error {
+	atmosPath := os.Getenv("ATMOS_CLI_CONFIG_PATH")
+	if atmosPath != "" {
+		configFilePath := filepath.Join(atmosPath, CliConfigFileName)
+		err := mergeConfig(v, configFilePath, CliConfigFileName)
+		if err != nil {
+			switch err.(type) {
+			case viper.ConfigFileNotFoundError:
+				u.LogTrace(fmt.Sprintf("Not Found ENV var ATMOS_CLI_CONFIG_PATH=%s", configFilePath))
+				return nil
+			default:
+				return err
+			}
+		}
+		u.LogTrace(fmt.Sprintf("Found ENV var ATMOS_CLI_CONFIG_PATH=%s", configFilePath))
+	}
+
+	return nil
+}
+
+// mergeConfig merge config from a specified path and file name.
+func mergeConfig(v *viper.Viper, path string, fileName string) error {
+	v.AddConfigPath(path)
+	v.SetConfigName(fileName)
+	err := v.MergeInConfig()
+	if err != nil {
+		return nil
+	}
+
+	return nil
+}
+
+// applyDefaultConfiguration apply default configuration for the atmos config.
+func applyDefaultConfiguration(v *viper.Viper) error {
+	logsLevel := os.Getenv("ATMOS_LOGS_LEVEL")
+	if logsLevel == u.LogLevelDebug || logsLevel == u.LogLevelTrace {
+		var atmosConfig schema.AtmosConfiguration
+		u.PrintMessageInColor("Using default configuration...\n", theme.Colors.Info)
+		err := u.PrintAsYAMLToFileDescriptor(atmosConfig, defaultCliConfig)
+		if err != nil {
+			return err
+		}
+	}
+
+	defaultConfig, err := json.Marshal(defaultCliConfig)
+	if err != nil {
+		return err
+	}
+	return v.MergeConfig(bytes.NewReader(defaultConfig))
+}

From 1cfec36d3cc372afb8a419f186340152ff6674e2 Mon Sep 17 00:00:00 2001
From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com>
Date: Tue, 18 Feb 2025 23:06:29 +0000
Subject: [PATCH 04/83] [autofix.ci] apply automated fixes

---
 pkg/config/load.go | 2 --
 1 file changed, 2 deletions(-)

diff --git a/pkg/config/load.go b/pkg/config/load.go
index 398977e6d9..2a1d901024 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -112,7 +112,6 @@ func setDefaultConfiguration(v *viper.Viper) {
 	v.SetDefault("settings.inject_github_token", true)
 	v.SetDefault("logs.file", "/dev/stderr")
 	v.SetDefault("logs.level", "Info")
-
 }
 
 // readSystemConfig load config from system dir
@@ -137,7 +136,6 @@ func readSystemConfig(v *viper.Viper) error {
 		}
 	}
 	return nil
-
 }
 
 // readHomeConfig load config from user's HOME dir

From 3ad2d489b0a19ecc1042588cb879da1b7b81cda8 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Wed, 19 Feb 2025 01:30:20 +0200
Subject: [PATCH 05/83] add default.go & update snapshots

---
 pkg/config/config.go                          |  91 -------------
 pkg/config/default.go                         | 125 ++++++++++++++++++
 pkg/config/load.go                            |  19 ---
 ...mmands_atmos_describe_config.stdout.golden |   2 +-
 ...tmos_describe_config_-f_yaml.stdout.golden |   2 +-
 tests/test-cases/env.yaml                     |   2 +-
 6 files changed, 128 insertions(+), 113 deletions(-)
 create mode 100644 pkg/config/default.go

diff --git a/pkg/config/config.go b/pkg/config/config.go
index 18df7af9fe..ff1228df66 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -8,102 +8,11 @@ import (
 	"github.com/pkg/errors"
 	"github.com/spf13/viper"
 
-	"github.com/cloudposse/atmos/internal/tui/templates"
 	"github.com/cloudposse/atmos/pkg/schema"
 	u "github.com/cloudposse/atmos/pkg/utils"
 	"github.com/cloudposse/atmos/pkg/version"
 )
 
-var (
-	NotFound = errors.New("\n'atmos.yaml' CLI config was not found in any of the searched paths: system dir, home dir, current dir, ENV vars." +
-		"\nYou can download a sample config and adapt it to your requirements from " +
-		"https://raw.githubusercontent.com/cloudposse/atmos/main/examples/quick-start-advanced/atmos.yaml")
-
-	defaultCliConfig = schema.AtmosConfiguration{
-		Default:  true,
-		BasePath: ".",
-		Stacks: schema.Stacks{
-			BasePath:    "stacks",
-			NamePattern: "{tenant}-{environment}-{stage}",
-			IncludedPaths: []string{
-				"orgs/**/*",
-			},
-			ExcludedPaths: []string{
-				"**/_defaults.yaml",
-			},
-		},
-		Components: schema.Components{
-			Terraform: schema.Terraform{
-				BasePath:                "components/terraform",
-				ApplyAutoApprove:        false,
-				DeployRunInit:           true,
-				InitRunReconfigure:      true,
-				AutoGenerateBackendFile: true,
-				AppendUserAgent:         fmt.Sprintf("Atmos/%s (Cloud Posse; +https://atmos.tools)", version.Version),
-			},
-			Helmfile: schema.Helmfile{
-				BasePath:              "components/helmfile",
-				KubeconfigPath:        "",
-				HelmAwsProfilePattern: "{namespace}-{tenant}-gbl-{stage}-helm",
-				ClusterNamePattern:    "{namespace}-{tenant}-{environment}-{stage}-eks-cluster",
-				UseEKS:                true,
-			},
-		},
-		Settings: schema.AtmosSettings{
-			ListMergeStrategy: "replace",
-			Terminal: schema.Terminal{
-				MaxWidth: templates.GetTerminalWidth(),
-				Pager:    true,
-				Colors:   true,
-				Unicode:  true,
-				SyntaxHighlighting: schema.SyntaxHighlighting{
-					Enabled:                true,
-					Formatter:              "terminal",
-					Theme:                  "dracula",
-					HighlightedOutputPager: true,
-					LineNumbers:            true,
-					Wrap:                   false,
-				},
-			},
-		},
-		Workflows: schema.Workflows{
-			BasePath: "stacks/workflows",
-		},
-		Logs: schema.Logs{
-			File:  "/dev/stderr",
-			Level: "Info",
-		},
-		Schemas: schema.Schemas{
-			JsonSchema: schema.JsonSchema{
-				BasePath: "stacks/schemas/jsonschema",
-			},
-			Opa: schema.Opa{
-				BasePath: "stacks/schemas/opa",
-			},
-		},
-		Templates: schema.Templates{
-			Settings: schema.TemplatesSettings{
-				Enabled: true,
-				Sprig: schema.TemplatesSettingsSprig{
-					Enabled: true,
-				},
-				Gomplate: schema.TemplatesSettingsGomplate{
-					Enabled:     true,
-					Datasources: make(map[string]schema.TemplatesSettingsGomplateDatasource),
-				},
-			},
-		},
-		Initialized: true,
-		Version: schema.Version{
-			Check: schema.VersionCheck{
-				Enabled:   true,
-				Timeout:   1000,
-				Frequency: "daily",
-			},
-		},
-	}
-)
-
 // InitCliConfig finds and merges CLI configurations in the following order: system dir, home dir, current dir, ENV vars, command-line arguments
 // https://dev.to/techschoolguru/load-config-from-file-environment-variables-in-golang-with-viper-2j2d
 // https://medium.com/@bnprashanth256/reading-configuration-files-and-environment-variables-in-go-golang-c2607f912b63
diff --git a/pkg/config/default.go b/pkg/config/default.go
new file mode 100644
index 0000000000..657ccc9a53
--- /dev/null
+++ b/pkg/config/default.go
@@ -0,0 +1,125 @@
+package config
+
+import (
+	"bytes"
+	"encoding/json"
+	"fmt"
+	"os"
+
+	"github.com/cloudposse/atmos/internal/tui/templates"
+	"github.com/cloudposse/atmos/pkg/schema"
+	"github.com/cloudposse/atmos/pkg/ui/theme"
+	u "github.com/cloudposse/atmos/pkg/utils"
+	"github.com/cloudposse/atmos/pkg/version"
+	"github.com/pkg/errors"
+	"github.com/spf13/viper"
+)
+
+var (
+	NotFound = errors.New("\n'atmos.yaml' CLI config was not found in any of the searched paths: system dir, home dir, current dir, ENV vars." +
+		"\nYou can download a sample config and adapt it to your requirements from " +
+		"https://raw.githubusercontent.com/cloudposse/atmos/main/examples/quick-start-advanced/atmos.yaml")
+
+	defaultCliConfig = schema.AtmosConfiguration{
+		Default:  true,
+		BasePath: ".",
+		Stacks: schema.Stacks{
+			BasePath:    "stacks",
+			NamePattern: "{tenant}-{environment}-{stage}",
+			IncludedPaths: []string{
+				"orgs/**/*",
+			},
+			ExcludedPaths: []string{
+				"**/_defaults.yaml",
+			},
+		},
+		Components: schema.Components{
+			Terraform: schema.Terraform{
+				BasePath:                "components/terraform",
+				ApplyAutoApprove:        false,
+				DeployRunInit:           true,
+				InitRunReconfigure:      true,
+				AutoGenerateBackendFile: true,
+				AppendUserAgent:         fmt.Sprintf("Atmos/%s (Cloud Posse; +https://atmos.tools)", version.Version),
+			},
+			Helmfile: schema.Helmfile{
+				BasePath:              "components/helmfile",
+				KubeconfigPath:        "",
+				HelmAwsProfilePattern: "{namespace}-{tenant}-gbl-{stage}-helm",
+				ClusterNamePattern:    "{namespace}-{tenant}-{environment}-{stage}-eks-cluster",
+				UseEKS:                true,
+			},
+		},
+		Settings: schema.AtmosSettings{
+			ListMergeStrategy: "replace",
+			Terminal: schema.Terminal{
+				MaxWidth: templates.GetTerminalWidth(),
+				Pager:    true,
+				Colors:   true,
+				Unicode:  true,
+				SyntaxHighlighting: schema.SyntaxHighlighting{
+					Enabled:                true,
+					Formatter:              "terminal",
+					Theme:                  "dracula",
+					HighlightedOutputPager: true,
+					LineNumbers:            true,
+					Wrap:                   false,
+				},
+			},
+		},
+		Workflows: schema.Workflows{
+			BasePath: "stacks/workflows",
+		},
+		Logs: schema.Logs{
+			File:  "/dev/stderr",
+			Level: "Info",
+		},
+		Schemas: schema.Schemas{
+			JsonSchema: schema.JsonSchema{
+				BasePath: "stacks/schemas/jsonschema",
+			},
+			Opa: schema.Opa{
+				BasePath: "stacks/schemas/opa",
+			},
+		},
+		Templates: schema.Templates{
+			Settings: schema.TemplatesSettings{
+				Enabled: true,
+				Sprig: schema.TemplatesSettingsSprig{
+					Enabled: true,
+				},
+				Gomplate: schema.TemplatesSettingsGomplate{
+					Enabled:     true,
+					Datasources: make(map[string]schema.TemplatesSettingsGomplateDatasource),
+				},
+			},
+		},
+		Initialized: true,
+		Version: schema.Version{
+			Check: schema.VersionCheck{
+				Enabled:   true,
+				Timeout:   1000,
+				Frequency: "daily",
+			},
+		},
+	}
+)
+
+// applyDefaultConfiguration apply default configuration for the atmos config.
+func applyDefaultConfiguration(v *viper.Viper) error {
+	logsLevel := os.Getenv("ATMOS_LOGS_LEVEL")
+	if logsLevel == u.LogLevelDebug || logsLevel == u.LogLevelTrace {
+		var atmosConfig schema.AtmosConfiguration
+		u.PrintMessageInColor("Using default configuration...\n", theme.Colors.Info)
+		err := u.PrintAsYAMLToFileDescriptor(atmosConfig, defaultCliConfig)
+		if err != nil {
+			return err
+		}
+	}
+
+	defaultConfig, err := json.Marshal(defaultCliConfig)
+	if err != nil {
+		return err
+	}
+	return v.MergeConfig(bytes.NewReader(defaultConfig))
+}
diff --git a/pkg/config/load.go b/pkg/config/load.go
index 2a1d901024..99eeaee320 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -206,22 +206,3 @@ func mergeConfig(v *viper.Viper, path string, fileName string) error {
 
 	return nil
 }
-
-// applyDefaultConfiguration apply default configuration for the atmos config.
-func applyDefaultConfiguration(v *viper.Viper) error {
-	logsLevel := os.Getenv("ATMOS_LOGS_LEVEL")
-	if logsLevel == u.LogLevelDebug || logsLevel == u.LogLevelTrace {
-		var atmosConfig schema.AtmosConfiguration
-		u.PrintMessageInColor("Using default configuration...\n", theme.Colors.Info)
-		err := u.PrintAsYAMLToFileDescriptor(atmosConfig, defaultCliConfig)
-		if err != nil {
-			return err
-		}
-	}
-
-	defaultConfig, err := json.Marshal(defaultCliConfig)
-	if err != nil {
-		return err
-	}
-	return v.MergeConfig(bytes.NewReader(defaultConfig))
-}
diff --git a/tests/snapshots/TestCLICommands_atmos_describe_config.stdout.golden b/tests/snapshots/TestCLICommands_atmos_describe_config.stdout.golden
index 206077f0bb..c132900a79 100644
--- a/tests/snapshots/TestCLICommands_atmos_describe_config.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_describe_config.stdout.golden
@@ -145,5 +145,5 @@
       "color": true
     }
   },
-  "cli_config_path": "/absolute/path/to/repo/examples/demo-stacks/atmos"
+  "cli_config_path": "/absolute/path/to/repo/examples/demo-stacks/atmos.yaml"
 }
diff --git a/tests/snapshots/TestCLICommands_atmos_describe_config_-f_yaml.stdout.golden b/tests/snapshots/TestCLICommands_atmos_describe_config_-f_yaml.stdout.golden
index 57872526f3..d6da4dbb08 100644
--- a/tests/snapshots/TestCLICommands_atmos_describe_config_-f_yaml.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_describe_config_-f_yaml.stdout.golden
@@ -43,5 +43,5 @@ default: false
 validate:
     editorconfig:
         color: true
-cli_config_path: /absolute/path/to/repo/examples/demo-stacks/atmos
+cli_config_path: /absolute/path/to/repo/examples/demo-stacks/atmos.yaml
 
diff --git a/tests/test-cases/env.yaml b/tests/test-cases/env.yaml
index 5f7011c190..95ec27f1b5 100644
--- a/tests/test-cases/env.yaml
+++ b/tests/test-cases/env.yaml
@@ -16,7 +16,7 @@ tests:
       diff: []
       stdout:
         - 'atmos_base_path = "./"'
-        - 'atmos_cli_config_path = ".*tests.*fixtures.*scenarios.*env.*atmos"'
+        - 'atmos_cli_config_path = ".*tests.*fixtures.*scenarios.*env.*atmos.yaml"'
       stderr:
         - "^$"
       exit_code: 0

From 263d14ab754f05968acba07c783bd099dabf6a3b Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Wed, 19 Feb 2025 01:44:31 +0200
Subject: [PATCH 06/83] resolve comments

---
 pkg/config/default.go | 25 -------------------------
 pkg/config/load.go    |  7 +------
 2 files changed, 1 insertion(+), 31 deletions(-)

diff --git a/pkg/config/default.go b/pkg/config/default.go
index 657ccc9a53..f05c35e34b 100644
--- a/pkg/config/default.go
+++ b/pkg/config/default.go
@@ -1,18 +1,12 @@
 package config
 
 import (
-	"bytes"
-	"encoding/json"
 	"fmt"
-	"os"
 
 	"github.com/cloudposse/atmos/internal/tui/templates"
 	"github.com/cloudposse/atmos/pkg/schema"
-	"github.com/cloudposse/atmos/pkg/ui/theme"
-	u "github.com/cloudposse/atmos/pkg/utils"
 	"github.com/cloudposse/atmos/pkg/version"
 	"github.com/pkg/errors"
-	"github.com/spf13/viper"
 )
 
 var (
@@ -104,22 +98,3 @@ var (
 		},
 	}
 )
-
-// applyDefaultConfiguration apply default configuration for the atmos config.
-func applyDefaultConfiguration(v *viper.Viper) error {
-	logsLevel := os.Getenv("ATMOS_LOGS_LEVEL")
-	if logsLevel == u.LogLevelDebug || logsLevel == u.LogLevelTrace {
-		var atmosConfig schema.AtmosConfiguration
-		u.PrintMessageInColor("Using default configuration...\n", theme.Colors.Info)
-		err := u.PrintAsYAMLToFileDescriptor(atmosConfig, defaultCliConfig)
-		if err != nil {
-			return err
-		}
-	}
-
-	defaultConfig, err := json.Marshal(defaultCliConfig)
-	if err != nil {
-		return err
-	}
-	return v.MergeConfig(bytes.NewReader(defaultConfig))
-}
diff --git a/pkg/config/load.go b/pkg/config/load.go
index 99eeaee320..6cfa07a1b7 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -16,11 +16,6 @@ import (
 	"github.com/spf13/viper"
 )
 
-type ConfigSources struct {
-	paths          string
-	atmosFileNames string
-}
-
 func LoadConfig(configAndStacksInfo schema.ConfigAndStacksInfo) (schema.AtmosConfiguration, error) {
 	v := viper.New()
 	var atmosConfig schema.AtmosConfiguration
@@ -201,7 +196,7 @@ func mergeConfig(v *viper.Viper, path string, fileName string) error {
 	v.SetConfigName(fileName)
 	err := v.MergeInConfig()
 	if err != nil {
-		return nil
+		return err
 	}
 
 	return nil

From 2532cfc04dfaf88f69bbfb0cbdb900f524f79b4c Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Wed, 19 Feb 2025 18:21:27 +0200
Subject: [PATCH 07/83] remove unused function processConfigFile

---
 pkg/config/config.go | 42 ------------------------------------------
 1 file changed, 42 deletions(-)

diff --git a/pkg/config/config.go b/pkg/config/config.go
index ff1228df66..9ae4c07687 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -2,11 +2,9 @@ package config
 
 import (
 	"fmt"
-	"os"
 	"path/filepath"
 
 	"github.com/pkg/errors"
-	"github.com/spf13/viper"
 
 	"github.com/cloudposse/atmos/pkg/schema"
 	u "github.com/cloudposse/atmos/pkg/utils"
@@ -17,12 +15,6 @@ import (
 // https://dev.to/techschoolguru/load-config-from-file-environment-variables-in-golang-with-viper-2j2d
 // https://medium.com/@bnprashanth256/reading-configuration-files-and-environment-variables-in-go-golang-c2607f912b63
 func InitCliConfig(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks bool) (schema.AtmosConfiguration, error) {
-	// atmosConfig is loaded from the following locations (from lower to higher priority):
-	// system dir (`/usr/local/etc/atmos` on Linux, `%LOCALAPPDATA%/atmos` on Windows)
-	// home dir (~/.atmos)
-	// current directory
-	// ENV vars
-	// Command-line arguments
 
 	atmosConfig, err := LoadConfig(configAndStacksInfo)
 	if err != nil {
@@ -142,37 +134,3 @@ func InitCliConfig(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks
 	atmosConfig.Initialized = true
 	return atmosConfig, nil
 }
-
-// https://github.com/NCAR/go-figure
-// https://github.com/spf13/viper/issues/181
-// https://medium.com/@bnprashanth256/reading-configuration-files-and-environment-variables-in-go-golang-c2607f912b63
-func processConfigFile(
-	atmosConfig schema.AtmosConfiguration,
-	path string,
-	v *viper.Viper,
-) (bool, error) {
-	// Check if the config file exists
-	configPath, fileExists := u.SearchConfigFile(path)
-	if !fileExists {
-		return false, nil
-	}
-
-	reader, err := os.Open(configPath)
-	if err != nil {
-		return false, err
-	}
-
-	defer func(reader *os.File) {
-		err := reader.Close()
-		if err != nil {
-			u.LogWarning(fmt.Sprintf("error closing file '%s'. %v", configPath, err))
-		}
-	}(reader)
-
-	err = v.MergeConfig(reader)
-	if err != nil {
-		return false, err
-	}
-
-	return true, nil
-}

From 86bf3cc45f79cde87af0f2d1ae21fc036dbf49de Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Wed, 19 Feb 2025 18:21:42 +0200
Subject: [PATCH 08/83] improve log

---
 pkg/config/load.go | 38 ++++++++++++++------------------------
 1 file changed, 14 insertions(+), 24 deletions(-)

diff --git a/pkg/config/load.go b/pkg/config/load.go
index 6cfa07a1b7..9a83de08f8 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -8,14 +8,19 @@ import (
 	"path/filepath"
 	"runtime"
 
+	"github.com/charmbracelet/log"
 	"github.com/cloudposse/atmos/pkg/schema"
-	"github.com/cloudposse/atmos/pkg/ui/theme"
-	u "github.com/cloudposse/atmos/pkg/utils"
 	"github.com/cloudposse/atmos/pkg/version"
 	"github.com/mitchellh/go-homedir"
 	"github.com/spf13/viper"
 )
 
+// LoadConfig atmosConfig is loaded from the following locations (from lower to higher priority):
+// system dir (`/usr/local/etc/atmos` on Linux, `%LOCALAPPDATA%/atmos` on Windows)
+// home dir (~/.atmos)
+// current directory
+// ENV vars
+// Command-line arguments
 func LoadConfig(configAndStacksInfo schema.ConfigAndStacksInfo) (schema.AtmosConfiguration, error) {
 	v := viper.New()
 	var atmosConfig schema.AtmosConfiguration
@@ -44,7 +49,7 @@ func LoadConfig(configAndStacksInfo schema.ConfigAndStacksInfo) (schema.AtmosCon
 			err := mergeConfig(v, configFilePath, CliConfigFileName)
 			switch err.(type) {
 			case viper.ConfigFileNotFoundError:
-				u.LogTrace(fmt.Sprintf("Not Found config file %s", configFilePath))
+				log.Debug("config not found", "file", configFilePath)
 			default:
 				return atmosConfig, err
 			}
@@ -54,26 +59,13 @@ func LoadConfig(configAndStacksInfo schema.ConfigAndStacksInfo) (schema.AtmosCon
 	atmosConfig.CliConfigPath = v.ConfigFileUsed()
 
 	if atmosConfig.CliConfigPath == "" {
-		// If `atmos.yaml` not found, use the default config
-		// Set `ATMOS_LOGS_LEVEL` ENV var to "Debug" to see the message about Atmos using the default CLI config
-		logsLevelEnvVar := os.Getenv("ATMOS_LOGS_LEVEL")
-		if logsLevelEnvVar == u.LogLevelDebug || logsLevelEnvVar == u.LogLevelTrace {
-			u.PrintMessageInColor("'atmos.yaml' CLI config was not found in any of the searched paths: system dir, home dir, current dir, ENV vars.\n"+
-				"Refer to https://atmos.tools/cli/configuration for details on how to configure 'atmos.yaml'.\n"+
-				"Using the default CLI config:\n\n", theme.Colors.Info)
-
-			err = u.PrintAsYAMLToFileDescriptor(atmosConfig, defaultCliConfig)
-			if err != nil {
-				return atmosConfig, err
-			}
-			fmt.Println()
-		}
-
+		log.Debug("'atmos.yaml' CLI config was not found", "paths", "system dir, home dir, current dir, ENV vars")
+		log.Debug("Refer to https://atmos.tools/cli/configuration for details on how to configure 'atmos.yaml'")
+		log.Debug("Using the default CLI config")
 		j, err := json.Marshal(defaultCliConfig)
 		if err != nil {
 			return atmosConfig, err
 		}
-
 		reader := bytes.NewReader(j)
 		err = v.MergeConfig(reader)
 		if err != nil {
@@ -81,7 +73,7 @@ func LoadConfig(configAndStacksInfo schema.ConfigAndStacksInfo) (schema.AtmosCon
 		}
 	}
 	// Set the CLI config path in the atmosConfig struct
-	if !filepath.IsAbs(atmosConfig.CliConfigPath) {
+	if atmosConfig.CliConfigPath != "" && !filepath.IsAbs(atmosConfig.CliConfigPath) {
 		absPath, err := filepath.Abs(atmosConfig.CliConfigPath)
 		if err != nil {
 			return atmosConfig, err
@@ -178,15 +170,14 @@ func readEnvAmosConfigPath(v *viper.Viper) error {
 		if err != nil {
 			switch err.(type) {
 			case viper.ConfigFileNotFoundError:
-				u.LogTrace(fmt.Sprintf("Not Found ENV var ATMOS_CLI_CONFIG_PATH=%s", configFilePath))
+				log.Debug("config not found ENV var ATMOS_CLI_CONFIG_PATH", "file", configFilePath)
 				return nil
 			default:
 				return err
 			}
 		}
-		u.LogTrace(fmt.Sprintf("Found ENV var ATMOS_CLI_CONFIG_PATH=%s", configFilePath))
+		log.Debug("Found config ENV", "ATMOS_CLI_CONFIG_PATH", configFilePath)
 	}
-
 	return nil
 }
 
@@ -198,6 +189,5 @@ func mergeConfig(v *viper.Viper, path string, fileName string) error {
 	if err != nil {
 		return err
 	}
-
 	return nil
 }

From 9de9d7b79397b3cc132000c27290e48f99f98c7c Mon Sep 17 00:00:00 2001
From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com>
Date: Wed, 19 Feb 2025 16:22:34 +0000
Subject: [PATCH 09/83] [autofix.ci] apply automated fixes

---
 pkg/config/config.go | 1 -
 1 file changed, 1 deletion(-)

diff --git a/pkg/config/config.go b/pkg/config/config.go
index 9ae4c07687..98e088a478 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -15,7 +15,6 @@ import (
 // https://dev.to/techschoolguru/load-config-from-file-environment-variables-in-golang-with-viper-2j2d
 // https://medium.com/@bnprashanth256/reading-configuration-files-and-environment-variables-in-go-golang-c2607f912b63
 func InitCliConfig(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks bool) (schema.AtmosConfiguration, error) {
-
 	atmosConfig, err := LoadConfig(configAndStacksInfo)
 	if err != nil {
 		return atmosConfig, err

From 037560c4de9f91f8edb40fd43cab2bbf9ad0ec23 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Fri, 21 Feb 2025 04:28:08 +0200
Subject: [PATCH 10/83] add imports

---
 pkg/config/README.md                          |  44 ++
 pkg/config/import_test.go                     | 160 +++++++
 pkg/config/imports.go                         | 395 ++++++++++++++++++
 pkg/config/load.go                            | 132 ++++--
 pkg/config/utils.go                           |  19 +
 pkg/schema/schema.go                          |   1 +
 .../scenarios/atmos-cli-imports/atmos.yaml    |   9 +
 .../atmos-cli-imports/configs.d/commands.yaml |   7 +
 .../configs.d/tools/stack.yml                 |   7 +
 .../configs.d/tools/terraform.yaml            |   7 +
 .../atmos-cli-imports/configs.d/vendor.yaml   |   9 +
 .../scenarios/atmos-cli-imports/logs.yaml     |   3 +
 .../atmos-configuration/atmos.d/commands.yaml |   6 +
 .../atmos-configuration/atmos.d/logs.yaml     |   3 +
 .../atmos.d/tools/helmfile.yml                |  17 +
 .../atmos.d/tools/stack.yaml                  |   7 +
 .../atmos.d/tools/terraform.yaml              |  23 +
 .../scenarios/atmos-configuration/atmos.yaml  |   5 +
 18 files changed, 826 insertions(+), 28 deletions(-)
 create mode 100644 pkg/config/README.md
 create mode 100644 pkg/config/import_test.go
 create mode 100644 pkg/config/imports.go
 create mode 100644 tests/fixtures/scenarios/atmos-cli-imports/atmos.yaml
 create mode 100644 tests/fixtures/scenarios/atmos-cli-imports/configs.d/commands.yaml
 create mode 100644 tests/fixtures/scenarios/atmos-cli-imports/configs.d/tools/stack.yml
 create mode 100644 tests/fixtures/scenarios/atmos-cli-imports/configs.d/tools/terraform.yaml
 create mode 100644 tests/fixtures/scenarios/atmos-cli-imports/configs.d/vendor.yaml
 create mode 100644 tests/fixtures/scenarios/atmos-cli-imports/logs.yaml
 create mode 100644 tests/fixtures/scenarios/atmos-configuration/atmos.d/commands.yaml
 create mode 100644 tests/fixtures/scenarios/atmos-configuration/atmos.d/logs.yaml
 create mode 100644 tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/helmfile.yml
 create mode 100644 tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/stack.yaml
 create mode 100644 tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/terraform.yaml
 create mode 100644 tests/fixtures/scenarios/atmos-configuration/atmos.yaml

diff --git a/pkg/config/README.md b/pkg/config/README.md
new file mode 100644
index 0000000000..6acdbb3001
--- /dev/null
+++ b/pkg/config/README.md
@@ -0,0 +1,44 @@
+### Import Config
+
+```mermaid
+flowchart TD
+    A["Load Configuration File"] --> B{"Import Section Exists?"}
+    
+    B -- Yes --> C["Process Imports in Order"]
+    C --> D{"Import Type?"}
+    D --> E["Remote URL"]
+    D --> F["Specific Path"]
+    D --> G["Wildcard Globs"]
+    
+    E --> H["Fetch Config from Remote URL"]
+    F --> I["Read Config from Filesystem"]
+    G --> I["Read Config from Filesystem"]
+    
+    H --> J["Call Load Configuration File (Recursively)"]
+    I --> J["Call Load Configuration File (Recursively)"]
+    
+    J --> L["Deep Merge with Current Config in Memory"]
+    L --> K{"More Imports to Process?"}
+    K -- Yes --> C
+    K -- No --> M["Configuration Processing Complete"]
+    
+    %% Loopback for recursion
+    J -.-> A
+
+    %% Styling for clarity
+    style A fill:#A8DADC,stroke:#1D3557,stroke-width:2px,color:#000000
+    style B fill:#F4A261,stroke:#1D3557,stroke-width:2px,color:#FFFFFF
+    style C fill:#457B9D,stroke:#1D3557,stroke-width:2px,color:#FFFFFF
+    style D fill:#A8DADC,stroke:#1D3557,stroke-width:2px,color:#000000
+    style E fill:#E63946,stroke:#1D3557,stroke-width:2px,color:#FFFFFF
+    style F fill:#E63946,stroke:#1D3557,stroke-width:2px,color:#FFFFFF
+    style G fill:#E63946,stroke:#1D3557,stroke-width:2px,color:#FFFFFF
+    style H fill:#A8DADC,stroke:#1D3557,stroke-width:2px,color:#000000
+    style I fill:#A8DADC,stroke:#1D3557,stroke-width:2px,color:#000000
+    style J fill:#F4A261,stroke:#1D3557,stroke-width:2px,color:#FFFFFF
+    style L fill:#457B9D,stroke:#1D3557,stroke-width:2px,color:#FFFFFF
+    style K fill:#F4A261,stroke:#1D3557,stroke-width:2px,color:#FFFFFF
+    style M fill:#1D3557,stroke:#1D3557,stroke-width:2px,color:#FFFFFF
+    
+    classDef recursion stroke-dasharray: 5 5;
+```
diff --git a/pkg/config/import_test.go b/pkg/config/import_test.go
new file mode 100644
index 0000000000..c25b6bcd8b
--- /dev/null
+++ b/pkg/config/import_test.go
@@ -0,0 +1,160 @@
+package config
+
+import (
+	"fmt"
+	"net/http"
+	"net/http/httptest"
+	"os"
+	"path/filepath"
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+)
+
+func setupTestFile(content, tempDir string, filename string) (string, error) {
+	filePath := filepath.Join(tempDir, filename)
+	err := os.WriteFile(filePath, []byte(content), 0o644)
+	return filePath, err
+}
+
+// Test for processImports
+func TestProcessImports(t *testing.T) {
+	// Step 1: Setup a mock HTTP server for a remote URL
+	server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+		fmt.Fprintln(w, "base_path: ./") // Mock YAML content
+	}))
+	defer server.Close()
+
+	// Step 2: Create temporary base directory and files
+	baseDir := t.TempDir()
+	defer os.Remove(baseDir)
+	// Step 2.1: Create a directory for recursive imports
+	configDir := filepath.Join(baseDir, "configs.d")
+	err := os.MkdirAll(configDir, 0o755)
+	assert.NoError(t, err)
+
+	// Create mock configuration files in the directory
+	configFile1 := filepath.Join(configDir, "config1.yaml")
+	err = os.WriteFile(configFile1, []byte("key1: value1"), 0o644)
+	assert.NoError(t, err)
+
+	configFile2 := filepath.Join(configDir, "config2.yaml")
+	err = os.WriteFile(configFile2, []byte("key2: value2"), 0o644)
+	assert.NoError(t, err)
+
+	// Step 2.2: Create a specific local file
+	localFile := filepath.Join(baseDir, "logs.yaml")
+	err = os.WriteFile(localFile, []byte("key3: value3"), 0o644)
+	assert.NoError(t, err)
+	// step 2.3
+	configDir2 := filepath.Join(baseDir, "config")
+	err = os.MkdirAll(configDir2, 0o755)
+	assert.NoError(t, err)
+	configFile3 := filepath.Join(configDir2, "config3.yaml")
+	err = os.WriteFile(configFile3, []byte("key4: value4"), 0o644)
+	assert.NoError(t, err)
+	// Step 3: Define test imports
+	imports := []string{
+		server.URL,               // Remote URL
+		"configs.d/**/*",         // Recursive directory
+		"config/**/*.yaml",       // recursive/**/*.yaml", // Recursive directory with specific pattern extension
+		"./logs.yaml",            // Specific local file
+		"http://invalid-url.com", // Invalid URL
+		"",                       // Empty import path
+		"/config/foo.yaml",       // Invalid import path
+	}
+
+	// Step 5: Run the processImports method
+	imported, err := processImports(baseDir, imports, baseDir, 0, 10)
+
+	// Step 6: Assertions
+	assert.NoError(t, err, "processImports should not return an error")
+	var resolvedPaths []string
+	for _, resolvedPath := range imported {
+		resolvedPaths = append(resolvedPaths, resolvedPath.filePath)
+	}
+
+	// Verify resolved paths contain expected files
+	expectedPaths := []string{
+		filepath.Join(baseDir, "logs.yaml"),
+		configFile1,
+		configFile2,
+		configFile3,
+	}
+	for _, expectedPath := range expectedPaths {
+		assert.Contains(t, resolvedPaths, expectedPath, fmt.Sprintf("resolvedPaths should contain %s", expectedPath))
+	}
+
+	// Ensure invalid and empty imports are handled gracefully
+	assert.NotContains(t, resolvedPaths, "http://invalid-url.com", "Invalid URL should not be resolved")
+	assert.NotContains(t, resolvedPaths, "", "Empty import path should not be resolved")
+}
+func TestProcessImportNested(t *testing.T) {
+	baseDir, err := os.MkdirTemp("", "config-test")
+	assert.NoError(t, err)
+	defer os.RemoveAll(baseDir)
+
+	// Setting up test files
+	_, err = setupTestFile(`
+import:
+ - "./nested-local.yaml"
+ `, baseDir, "local.yaml")
+	assert.NoError(t, err)
+
+	nestedLocalConfigPath, err := setupTestFile(`import: []`, baseDir, "nested-local.yaml")
+	assert.NoError(t, err)
+
+	remoteContent := `
+import:
+  - nested-local.yaml
+`
+	nestedRemoteContent := `import: []`
+	// Create an HTTP server to simulate remote imports
+	server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+		if r.URL.Path == "/config.yaml" {
+			fmt.Fprint(w, remoteContent)
+		} else if r.URL.Path == "/nested-remote.yaml" {
+			fmt.Fprint(w, nestedRemoteContent)
+		} else {
+			http.NotFound(w, r)
+		}
+	}))
+	defer server.Close()
+
+	t.Run("Test remote import processing", func(t *testing.T) {
+		tempDir, err := os.MkdirTemp("", "config-test")
+		assert.NoError(t, err)
+		defer os.RemoveAll(tempDir)
+		importPaths := []string{server.URL + "/config.yaml"}
+		resolved, err := processImports(baseDir, importPaths, tempDir, 1, 5)
+		assert.NoError(t, err)
+		assert.Len(t, resolved, 2, "should resolve main and nested remote imports")
+	})
+
+	t.Run("Test local import processing", func(t *testing.T) {
+		tempDir, err := os.MkdirTemp("", "config-test")
+		assert.NoError(t, err)
+		defer os.RemoveAll(tempDir)
+		importPaths := []string{"local.yaml"}
+		imported, err := processImports(baseDir, importPaths, tempDir, 1, 5)
+		assert.NoError(t, err)
+		var resolvedPaths []string
+		for _, resolvedPath := range imported {
+			resolvedPaths = append(resolvedPaths, resolvedPath.filePath)
+		}
+		assert.Contains(t, resolvedPaths, nestedLocalConfigPath, "should resolve nested local imports")
+	})
+
+	t.Run("Test mixed imports with depth limit", func(t *testing.T) {
+		tempDir, err := os.MkdirTemp("", "config-test")
+		assert.NoError(t, err)
+		defer os.RemoveAll(tempDir)
+		importPaths := []string{
+			"local.yaml",
+			server.URL + "/config.yaml",
+		}
+		resolved, err := processImports(baseDir, importPaths, tempDir, 11, 10)
+		assert.Error(t, err, "should return an error when maxDepth is exceeded")
+		assert.Nil(t, resolved, "no resolved paths should be returned on depth limit breach")
+	})
+}
diff --git a/pkg/config/imports.go b/pkg/config/imports.go
new file mode 100644
index 0000000000..e6287f4a8e
--- /dev/null
+++ b/pkg/config/imports.go
@@ -0,0 +1,395 @@
+package config
+
+import (
+	"context"
+	"fmt"
+	"net/url"
+	"os"
+	"path/filepath"
+	"sort"
+	"strings"
+	"time"
+
+	"github.com/charmbracelet/log"
+	"github.com/cloudposse/atmos/pkg/schema"
+	u "github.com/cloudposse/atmos/pkg/utils"
+	"github.com/hashicorp/go-getter"
+	"github.com/spf13/viper"
+)
+
+type importTypes int
+
+const (
+	LOCAL  importTypes = 0
+	REMOTE importTypes = 1
+)
+
+// import Resolved Paths
+type ResolvedPaths struct {
+	filePath    string
+	importPaths string // import path from atmos config
+	importType  importTypes
+}
+
+// processConfigImports It reads the import paths from the source configuration,
+// It processes imports from the source configuration and merges them into the destination configuration.
+func processConfigImports(source schema.AtmosConfiguration, dst *viper.Viper) error {
+	if len(source.Import) > 0 {
+		importPaths := source.Import
+		baseBath, err := filepath.Abs(source.BasePath)
+		if err != nil {
+			return err
+		}
+		tempDir, err := os.MkdirTemp("", "atmos-import-*")
+		if err != nil {
+			return err
+		}
+		defer os.RemoveAll(tempDir)
+		resolvedPaths, err := processImports(baseBath, importPaths, tempDir, 1, MaximumImportLvL)
+		if err != nil {
+			return err
+		}
+
+		for _, resolvedPath := range resolvedPaths {
+			err := MergeConfigFile(resolvedPath.filePath, dst)
+			if err != nil {
+				log.Debug("error loading config file", "import", resolvedPath.importPaths, "file_path", resolvedPath.filePath, "error", err)
+				continue
+			}
+
+			log.Debug("atmos merged config from import", "import", resolvedPath.importPaths, "file_path", resolvedPath.filePath)
+		}
+	}
+	return nil
+}
+func processImports(basePath string, importPaths []string, tempDir string, currentDepth, maxDepth int) (resolvedPaths []ResolvedPaths, err error) {
+	if basePath == "" {
+		return nil, fmt.Errorf("base_Path required to process imports")
+	}
+	if tempDir == "" {
+		return nil, fmt.Errorf("tempDir required to process imports")
+	}
+	if currentDepth > maxDepth {
+		return nil, fmt.Errorf("maximum import depth of %d exceeded", maxDepth)
+	}
+	basePath, err = filepath.Abs(basePath)
+	if err != nil {
+		return nil, fmt.Errorf("failed to resolve base path: %v", err)
+	}
+
+	for _, importPath := range importPaths {
+		if importPath == "" {
+			continue
+		}
+
+		if isRemoteImport(importPath) {
+			// Handle remote imports
+			paths, err := processRemoteImport(basePath, importPath, tempDir, currentDepth, maxDepth)
+			if err != nil {
+				log.Debug("failed to process remote import", "path", importPath, "error", err)
+				continue
+			}
+			resolvedPaths = append(resolvedPaths, paths...)
+		} else {
+			// Handle local imports
+			paths, err := processLocalImport(basePath, importPath, tempDir, currentDepth, maxDepth)
+			if err != nil {
+				log.Debug("failed to process local import", "path", importPath, "error", err)
+				continue
+			}
+			resolvedPaths = append(resolvedPaths, paths...)
+		}
+	}
+
+	return resolvedPaths, nil
+}
+
+// Helper to determine if the import is a supported remote source
+func isRemoteImport(importPath string) bool {
+	return strings.HasPrefix(importPath, "http://") || strings.HasPrefix(importPath, "https://")
+}
+
+// Process remote imports
+func processRemoteImport(basePath, importPath, tempDir string, currentDepth, maxDepth int) ([]ResolvedPaths, error) {
+	parsedURL, err := url.Parse(importPath)
+	if err != nil || (parsedURL.Scheme != "http" && parsedURL.Scheme != "https") {
+		return nil, fmt.Errorf("unsupported URL '%s': %v", importPath, err)
+	}
+
+	tempFile, err := downloadRemoteConfig(parsedURL.String(), tempDir)
+	if err != nil {
+		return nil, fmt.Errorf("failed to download remote config: %w", err)
+	}
+	v := viper.New()
+	v.SetConfigFile(tempFile)
+	err = v.ReadInConfig()
+	if err != nil {
+		log.Debug("failed to read remote config", "path", importPath, "error", err)
+		return nil, fmt.Errorf("failed to read remote config")
+	}
+
+	resolvedPaths := make([]ResolvedPaths, 0)
+	resolvedPaths = append(resolvedPaths, ResolvedPaths{
+		filePath:    tempFile,
+		importPaths: importPath,
+		importType:  REMOTE,
+	})
+	Imports := v.GetStringSlice("import")
+	importBasePath := v.GetString("base_path")
+	if importBasePath == "" {
+		importBasePath = basePath
+	}
+
+	// Recursively process imports from the remote file
+	if Imports != nil && len(Imports) > 0 {
+		nestedPaths, err := processImports(importBasePath, Imports, tempDir, currentDepth+1, maxDepth)
+		if err != nil {
+			log.Debug("failed to process nested imports", "import", importPath, "err", err)
+			return nil, fmt.Errorf("failed to process nested imports")
+		}
+		resolvedPaths = append(resolvedPaths, nestedPaths...)
+	}
+
+	return resolvedPaths, nil
+}
+
+// Process local imports
+func processLocalImport(basePath string, importPath, tempDir string, currentDepth, maxDepth int) ([]ResolvedPaths, error) {
+	if importPath == "" {
+		return nil, fmt.Errorf("import_path required to process imports")
+	}
+	if !filepath.IsAbs(importPath) {
+		importPath = filepath.Join(basePath, importPath)
+	}
+	if !strings.HasPrefix(filepath.Clean(importPath), filepath.Clean(basePath)) {
+		log.Warn("Import path is outside of base directory",
+			"importPath", importPath,
+			"basePath", basePath,
+		)
+	}
+	paths, err := SearchAtmosConfig(importPath)
+	if err != nil {
+		log.Debug("failed to resolve local import path", "path", importPath, "err", err)
+		return nil, fmt.Errorf("failed to resolve local import path")
+	}
+
+	resolvedPaths := make([]ResolvedPaths, 0)
+	// Load the local configuration file to check for further imports
+	for _, path := range paths {
+		v := viper.New()
+		v.SetConfigFile(path)
+		v.SetConfigType("yaml")
+		err := v.ReadInConfig()
+		if err != nil {
+			log.Debug("failed to load local config", "path", path, "error", err)
+			continue
+		}
+		resolvedPaths = append(resolvedPaths, ResolvedPaths{
+			filePath:    path,
+			importPaths: importPath,
+			importType:  LOCAL,
+		})
+		Imports := v.GetStringSlice("import")
+		importBasePath := v.GetString("base_path")
+		if importBasePath == "" {
+			importBasePath = basePath
+		}
+
+		// Recursively process imports from the local file
+		if Imports != nil {
+			nestedPaths, err := processImports(importBasePath, Imports, tempDir, currentDepth+1, maxDepth)
+			if err != nil {
+				log.Debug("failed to process nested imports from", "path", path, "error", err)
+				continue
+			}
+			resolvedPaths = append(resolvedPaths, nestedPaths...)
+		}
+	}
+
+	return resolvedPaths, nil
+}
+
+// SearchAtmosConfig searches for a config file in path. path is directory,file or a pattern .
+func SearchAtmosConfig(path string) ([]string, error) {
+	if stat, err := os.Stat(path); err == nil {
+		if !stat.IsDir() {
+			return []string{path}, nil
+		}
+	}
+	// Generate patterns based on whether path is a directory or a file/pattern
+	patterns, err := generatePatterns(path)
+	if err != nil {
+		return nil, fmt.Errorf("failed to generate search patterns: %w", err)
+	}
+	// Find files matching the patterns
+	atmosFilePaths, err := findMatchingFiles(patterns)
+	if err != nil {
+		return nil, fmt.Errorf("failed to find matching files: %w", err)
+	}
+	// Convert paths to absolute paths
+	atmosFilePathsABS, err := convertToAbsolutePaths(atmosFilePaths)
+	if err != nil {
+		return nil, fmt.Errorf("failed to convert paths to absolute paths: %w", err)
+	}
+	// Prioritize and sort files
+	atmosFilePathsABS = detectPriorityFiles(atmosFilePathsABS)
+	atmosFilePathsABS = sortFilesByDepth(atmosFilePathsABS)
+	return atmosFilePathsABS, nil
+}
+
+// Helper function to generate search patterns for extension yaml,yml
+func generatePatterns(path string) ([]string, error) {
+	isDir := false
+	if stat, err := os.Stat(path); err == nil && stat.IsDir() {
+		isDir = true
+	}
+	if isDir {
+		// Search for all .yaml and .yml
+		patterns := []string{
+			filepath.Join(path, "**/*.yaml"),
+			filepath.Join(path, "**/*.yml"),
+		}
+		return patterns, nil
+	}
+	ext := filepath.Ext(path)
+	if ext == "" {
+		// If no extension, append .yaml and .yml
+		patterns := []string{
+			path + ".yaml",
+			path + ".yml",
+		}
+		return patterns, nil
+	}
+	// If extension is present, use the path as-is
+	patterns := []string{path}
+
+	return patterns, nil
+}
+
+// Helper function to convert paths to absolute paths
+func convertToAbsolutePaths(filePaths []string) ([]string, error) {
+	var absPaths []string
+	for _, path := range filePaths {
+		absPath, err := filepath.Abs(path)
+		if err != nil {
+			log.Debug("Error getting absolute path for file", "path", path, "error", err)
+			continue
+		}
+		absPaths = append(absPaths, absPath)
+	}
+
+	if len(absPaths) == 0 {
+		return nil, fmt.Errorf("no valid absolute paths found")
+	}
+
+	return absPaths, nil
+}
+
+// detectPriorityFiles detects which files will have priority .  yaml win over yml if file has same path
+func detectPriorityFiles(files []string) []string {
+	// Map to store the highest priority file for each base name
+	priorityMap := make(map[string]string)
+
+	// Iterate through the list of files
+	for _, file := range files {
+		dir := filepath.Dir(file)
+		baseName := strings.TrimSuffix(filepath.Base(file), filepath.Ext(file))
+		ext := filepath.Ext(file)
+
+		// Construct a unique key for the folder + base name
+		key := filepath.Join(dir, baseName)
+
+		// Assign .yaml as priority if it exists, or fallback to .yml
+		if existingFile, exists := priorityMap[key]; exists {
+			if ext == ".yaml" {
+				priorityMap[key] = file // Replace .yml with .yaml
+			} else if ext == ".yml" && filepath.Ext(existingFile) == ".yaml" {
+				continue // Keep .yaml priority
+			}
+		} else {
+			priorityMap[key] = file // First occurrence, add file
+		}
+	}
+
+	// Collect results from the map
+	var result []string
+	for _, file := range priorityMap {
+		result = append(result, file)
+	}
+
+	return result
+}
+
+// sortFilesByDepth sorts a list of file paths by the depth of their directories.
+// Files with the same depth are sorted alphabetically by name.
+func sortFilesByDepth(files []string) []string {
+	// Precompute depths for each file path
+	type fileDepth struct {
+		path  string
+		depth int
+	}
+
+	var fileDepths []fileDepth
+	for _, file := range files {
+		cleanPath := filepath.Clean(file)
+		dir := filepath.ToSlash(filepath.Dir(cleanPath))
+		depth := len(strings.Split(dir, "/"))
+		fileDepths = append(fileDepths, fileDepth{path: file, depth: depth})
+	}
+
+	// Sort by depth, and alphabetically by name as a tiebreaker
+	sort.Slice(fileDepths, func(i, j int) bool {
+		if fileDepths[i].depth == fileDepths[j].depth {
+			// If depths are the same, compare file names alphabetically
+			return fileDepths[i].path < fileDepths[j].path
+		}
+		// Otherwise, compare by depth
+		return fileDepths[i].depth < fileDepths[j].depth
+	})
+
+	// Extract sorted paths
+	sortedFiles := make([]string, len(fileDepths))
+	for i, fd := range fileDepths {
+		sortedFiles[i] = fd.path
+	}
+
+	return sortedFiles
+}
+
+// Helper function to find files matching the patterns
+func findMatchingFiles(patterns []string) ([]string, error) {
+	var filePaths []string
+	for _, pattern := range patterns {
+		matches, err := u.GetGlobMatches(pattern)
+		if err != nil {
+			log.Debug("Error getting glob matches for path", "path", pattern, "error", err)
+			continue
+		}
+		filePaths = append(filePaths, matches...)
+	}
+
+	if len(filePaths) == 0 {
+		return nil, fmt.Errorf("no files matching patterns found")
+	}
+
+	return filePaths, nil
+}
+func downloadRemoteConfig(url string, tempDir string) (string, error) {
+	// uniq name for the temp file
+	fileName := fmt.Sprintf("atmos-import-%d.yaml", time.Now().UnixNano())
+	tempFile := filepath.Join(tempDir, fileName)
+	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
+	defer cancel()
+	client := &getter.Client{
+		Ctx:  ctx,
+		Src:  url,
+		Dst:  tempFile,
+		Mode: getter.ClientModeFile,
+	}
+	err := client.Get()
+	if err != nil {
+		os.RemoveAll(tempFile)
+		return "", fmt.Errorf("failed to download remote config: %w", err)
+	}
+	return tempFile, nil
+}
diff --git a/pkg/config/load.go b/pkg/config/load.go
index 9a83de08f8..05abea6a24 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -15,6 +15,8 @@ import (
 	"github.com/spf13/viper"
 )
 
+const MaximumImportLvL = 10
+
 // LoadConfig atmosConfig is loaded from the following locations (from lower to higher priority):
 // system dir (`/usr/local/etc/atmos` on Linux, `%LOCALAPPDATA%/atmos` on Windows)
 // home dir (~/.atmos)
@@ -31,10 +33,12 @@ func LoadConfig(configAndStacksInfo schema.ConfigAndStacksInfo) (schema.AtmosCon
 	if err != nil {
 		return atmosConfig, err
 	}
+
 	err = readHomeConfig(v)
 	if err != nil {
 		return atmosConfig, err
 	}
+
 	err = readWorkDirConfig(v)
 	if err != nil {
 		return atmosConfig, err
@@ -43,17 +47,9 @@ func LoadConfig(configAndStacksInfo schema.ConfigAndStacksInfo) (schema.AtmosCon
 	if err != nil {
 		return atmosConfig, err
 	}
-	if configAndStacksInfo.AtmosCliConfigPath != "" {
-		configFilePath := configAndStacksInfo.AtmosCliConfigPath
-		if len(configFilePath) > 0 {
-			err := mergeConfig(v, configFilePath, CliConfigFileName)
-			switch err.(type) {
-			case viper.ConfigFileNotFoundError:
-				log.Debug("config not found", "file", configFilePath)
-			default:
-				return atmosConfig, err
-			}
-		}
+	err = readAtmosConfigCli(v, configAndStacksInfo.AtmosCliConfigPath)
+	if err != nil {
+		return atmosConfig, err
 	}
 
 	atmosConfig.CliConfigPath = v.ConfigFileUsed()
@@ -114,7 +110,7 @@ func readSystemConfig(v *viper.Viper) error {
 	}
 
 	if len(configFilePath) > 0 {
-		err := mergeConfig(v, configFilePath, CliConfigFileName)
+		err := mergeConfig(v, configFilePath, CliConfigFileName, false)
 		switch err.(type) {
 		case viper.ConfigFileNotFoundError:
 			return nil
@@ -132,7 +128,7 @@ func readHomeConfig(v *viper.Viper) error {
 		return err
 	}
 	configFilePath := filepath.Join(home, ".atmos")
-	err = mergeConfig(v, configFilePath, CliConfigFileName)
+	err = mergeConfig(v, configFilePath, CliConfigFileName, true)
 	if err != nil {
 		switch err.(type) {
 		case viper.ConfigFileNotFoundError:
@@ -141,6 +137,7 @@ func readHomeConfig(v *viper.Viper) error {
 			return err
 		}
 	}
+
 	return nil
 }
 
@@ -150,7 +147,7 @@ func readWorkDirConfig(v *viper.Viper) error {
 	if err != nil {
 		return err
 	}
-	err = mergeConfig(v, wd, CliConfigFileName)
+	err = mergeConfig(v, wd, CliConfigFileName, true)
 	if err != nil {
 		switch err.(type) {
 		case viper.ConfigFileNotFoundError:
@@ -164,30 +161,109 @@ func readWorkDirConfig(v *viper.Viper) error {
 
 func readEnvAmosConfigPath(v *viper.Viper) error {
 	atmosPath := os.Getenv("ATMOS_CLI_CONFIG_PATH")
-	if atmosPath != "" {
-		configFilePath := filepath.Join(atmosPath, CliConfigFileName)
-		err := mergeConfig(v, configFilePath, CliConfigFileName)
-		if err != nil {
-			switch err.(type) {
-			case viper.ConfigFileNotFoundError:
-				log.Debug("config not found ENV var ATMOS_CLI_CONFIG_PATH", "file", configFilePath)
-				return nil
-			default:
-				return err
-			}
+	if atmosPath == "" {
+		return nil
+	}
+	configFilePath := filepath.Join(atmosPath, CliConfigFileName)
+	err := mergeConfig(v, configFilePath, CliConfigFileName, true)
+	if err != nil {
+		switch err.(type) {
+		case viper.ConfigFileNotFoundError:
+			log.Debug("config not found ENV var ATMOS_CLI_CONFIG_PATH", "file", configFilePath)
+			return nil
+		default:
+			return err
 		}
-		log.Debug("Found config ENV", "ATMOS_CLI_CONFIG_PATH", configFilePath)
 	}
+	log.Debug("Found config ENV", "ATMOS_CLI_CONFIG_PATH", configFilePath)
+
+	return nil
+}
+func readAtmosConfigCli(v *viper.Viper, atmosCliConfigPath string) error {
+	if len(atmosCliConfigPath) == 0 {
+		return nil
+	}
+	err := mergeConfig(v, atmosCliConfigPath, CliConfigFileName, true)
+	switch err.(type) {
+	case viper.ConfigFileNotFoundError:
+		log.Debug("config not found", "file", atmosCliConfigPath)
+	default:
+		return err
+	}
+
 	return nil
 }
 
-// mergeConfig merge config from a specified path and file name.
-func mergeConfig(v *viper.Viper, path string, fileName string) error {
+// mergeConfig merge config from a specified path and process imports.return error if config file not exist
+func mergeConfig(v *viper.Viper, path string, fileName string, processImports bool) error {
 	v.AddConfigPath(path)
 	v.SetConfigName(fileName)
 	err := v.MergeInConfig()
 	if err != nil {
 		return err
 	}
+	if !processImports {
+		return nil
+	}
+	if err := mergeDefaultImports(path, v); err != nil {
+		log.Debug("error process imports", "path", path, "error", err)
+	}
+	if err := mergeImports(v); err != nil {
+		log.Debug("error process imports", "file", v.ConfigFileUsed(), "error", err)
+	}
+	return nil
+}
+
+// mergeDefaultImports merges default imports (`atmos.d/`,`.atmos.d/`)
+// from a specified directory into the destination configuration.
+func mergeDefaultImports(dirPath string, dst *viper.Viper) error {
+	isDir := false
+	if stat, err := os.Stat(dirPath); err == nil && stat.IsDir() {
+		isDir = true
+	}
+	if !isDir {
+		return fmt.Errorf("atmos config directory not found path %s", dirPath)
+	}
+	var atmosFoundFilePaths []string
+	// Search for `atmos.d/` configurations
+	searchDir := filepath.Join(filepath.FromSlash(dirPath), "atmos.d/**/*")
+	foundPaths1, err := SearchAtmosConfig(searchDir)
+	if err != nil {
+		log.Debug("Failed to find atmos config file", "path", searchDir, "error", err)
+	}
+	if len(foundPaths1) > 0 {
+		atmosFoundFilePaths = append(atmosFoundFilePaths, foundPaths1...)
+	}
+	// Search for `.atmos.d` configurations
+	searchDir = filepath.Join(filepath.FromSlash(dirPath), ".atmos.d/**/*")
+	foundPaths2, err := SearchAtmosConfig(searchDir)
+	if err != nil {
+		log.Debug("Failed to find atmos config file", "path", searchDir, "error", err)
+	}
+	if len(foundPaths2) > 0 {
+		atmosFoundFilePaths = append(atmosFoundFilePaths, foundPaths2...)
+	}
+	for _, filePath := range atmosFoundFilePaths {
+		err := MergeConfigFile(filePath, dst)
+		if err != nil {
+			log.Debug("error loading config file", "path", filePath, "error", err)
+			continue
+		}
+		log.Debug("atmos merged config", "path", filePath)
+
+	}
+	return nil
+}
+
+// mergeImports processes imports from the atmos configuration and merges them into the destination configuration.
+func mergeImports(dst *viper.Viper) error {
+	var src schema.AtmosConfiguration
+	err := dst.Unmarshal(&src)
+	if err != nil {
+		return err
+	}
+	if err := processConfigImports(src, dst); err != nil {
+		return err
+	}
 	return nil
 }
diff --git a/pkg/config/utils.go b/pkg/config/utils.go
index 43a52707b3..5a31cbe061 100644
--- a/pkg/config/utils.go
+++ b/pkg/config/utils.go
@@ -1,6 +1,7 @@
 package config
 
 import (
+	"bytes"
 	"errors"
 	"fmt"
 	"os"
@@ -13,6 +14,7 @@ import (
 	"github.com/cloudposse/atmos/pkg/schema"
 	"github.com/cloudposse/atmos/pkg/store"
 	u "github.com/cloudposse/atmos/pkg/utils"
+	"github.com/spf13/viper"
 )
 
 // FindAllStackConfigsInPathsForStack finds all stack manifests in the paths specified by globs for the provided stack
@@ -779,3 +781,20 @@ func SearchConfigFile(configPath string, atmosConfig schema.AtmosConfiguration)
 
 	return "", fmt.Errorf("failed to find a match for the import '%s' ('%s' + '%s')", configPath, dir, base)
 }
+
+// MergeConfigFile merges a new configuration file with an existing config into Viper.
+func MergeConfigFile(
+	path string,
+	v *viper.Viper,
+) error {
+	content, err := os.ReadFile(path)
+	if err != nil {
+		return err
+	}
+	err = v.MergeConfig(bytes.NewReader(content))
+	if err != nil {
+		return err
+	}
+
+	return nil
+}
diff --git a/pkg/schema/schema.go b/pkg/schema/schema.go
index 020bc3ed95..070e7e33e8 100644
--- a/pkg/schema/schema.go
+++ b/pkg/schema/schema.go
@@ -38,6 +38,7 @@ type AtmosConfiguration struct {
 	// functions to be able to call stores from within hooks.
 	Stores        store.StoreRegistry `yaml:"stores_registry,omitempty" json:"stores_registry,omitempty" mapstructure:"stores_registry"`
 	CliConfigPath string              `yaml:"cli_config_path" json:"cli_config_path,omitempty" mapstructure:"cli_config_path"`
+	Import        []string            `yaml:"import" json:"import" mapstructure:"import"`
 }
 
 type Validate struct {
diff --git a/tests/fixtures/scenarios/atmos-cli-imports/atmos.yaml b/tests/fixtures/scenarios/atmos-cli-imports/atmos.yaml
new file mode 100644
index 0000000000..79b3ccd26d
--- /dev/null
+++ b/tests/fixtures/scenarios/atmos-cli-imports/atmos.yaml
@@ -0,0 +1,9 @@
+# Description: This is an example of a custom import configuration file.
+# The import configuration file is used to load configurations from multiple files and directories.
+# The configurations are merged together to create a single configuration object.
+# The configurations are loaded in the order they are defined in the import section.
+base_path: "./"
+import:
+  - "https://raw.githubusercontent.com/cloudposse/atmos/refs/heads/main/atmos.yaml"  # Load from a remote URL
+  - "configs.d/**/*"                                                                 # Recursively load configurations from a directory
+  - "./logs.yaml"                                                                    # Load a specific file
diff --git a/tests/fixtures/scenarios/atmos-cli-imports/configs.d/commands.yaml b/tests/fixtures/scenarios/atmos-cli-imports/configs.d/commands.yaml
new file mode 100644
index 0000000000..8580ae9f0c
--- /dev/null
+++ b/tests/fixtures/scenarios/atmos-cli-imports/configs.d/commands.yaml
@@ -0,0 +1,7 @@
+# Custom CLI commands
+commands:
+  - name: "test"
+    description: "Run all tests"
+    steps:
+      - atmos describe config  
+
diff --git a/tests/fixtures/scenarios/atmos-cli-imports/configs.d/tools/stack.yml b/tests/fixtures/scenarios/atmos-cli-imports/configs.d/tools/stack.yml
new file mode 100644
index 0000000000..5b2994a331
--- /dev/null
+++ b/tests/fixtures/scenarios/atmos-cli-imports/configs.d/tools/stack.yml
@@ -0,0 +1,7 @@
+stacks:
+  base_path: "stacks"
+  included_paths:
+    - "deploy/**/*"
+  excluded_paths:
+    - "**/_defaults.yaml"
+  name_pattern: "{dev}"
diff --git a/tests/fixtures/scenarios/atmos-cli-imports/configs.d/tools/terraform.yaml b/tests/fixtures/scenarios/atmos-cli-imports/configs.d/tools/terraform.yaml
new file mode 100644
index 0000000000..adf9c72c2a
--- /dev/null
+++ b/tests/fixtures/scenarios/atmos-cli-imports/configs.d/tools/terraform.yaml
@@ -0,0 +1,7 @@
+components:
+  terraform:
+    base_path: "components/terraform"
+    apply_auto_approve: true
+    deploy_run_init: true
+    init_run_reconfigure: true
+    auto_generate_backend_file: false
diff --git a/tests/fixtures/scenarios/atmos-cli-imports/configs.d/vendor.yaml b/tests/fixtures/scenarios/atmos-cli-imports/configs.d/vendor.yaml
new file mode 100644
index 0000000000..d6fe12e0c7
--- /dev/null
+++ b/tests/fixtures/scenarios/atmos-cli-imports/configs.d/vendor.yaml
@@ -0,0 +1,9 @@
+vendor:
+  # Single file
+  base_path: "./vendor.yaml"
+
+  # Directory with multiple files
+  #base_path: "./vendor"
+
+  # Absolute path
+  #base_path: "vendor.d/vendor1.yaml"
diff --git a/tests/fixtures/scenarios/atmos-cli-imports/logs.yaml b/tests/fixtures/scenarios/atmos-cli-imports/logs.yaml
new file mode 100644
index 0000000000..e389a26b82
--- /dev/null
+++ b/tests/fixtures/scenarios/atmos-cli-imports/logs.yaml
@@ -0,0 +1,3 @@
+logs:
+  file: "/dev/stderr"
+  level: Debug
diff --git a/tests/fixtures/scenarios/atmos-configuration/atmos.d/commands.yaml b/tests/fixtures/scenarios/atmos-configuration/atmos.d/commands.yaml
new file mode 100644
index 0000000000..c655ad569f
--- /dev/null
+++ b/tests/fixtures/scenarios/atmos-configuration/atmos.d/commands.yaml
@@ -0,0 +1,6 @@
+# Custom CLI commands
+commands:
+- name: "test"
+  description: "Run all tests with custom command"
+  steps:
+  - atmos describe config
diff --git a/tests/fixtures/scenarios/atmos-configuration/atmos.d/logs.yaml b/tests/fixtures/scenarios/atmos-configuration/atmos.d/logs.yaml
new file mode 100644
index 0000000000..e389a26b82
--- /dev/null
+++ b/tests/fixtures/scenarios/atmos-configuration/atmos.d/logs.yaml
@@ -0,0 +1,3 @@
+logs:
+  file: "/dev/stderr"
+  level: Debug
diff --git a/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/helmfile.yml b/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/helmfile.yml
new file mode 100644
index 0000000000..78780b1190
--- /dev/null
+++ b/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/helmfile.yml
@@ -0,0 +1,17 @@
+components:
+  helmfile:
+    # Can also be set using 'ATMOS_COMPONENTS_HELMFILE_BASE_PATH' ENV var, or '--helmfile-dir' command-line argument
+    # Supports both absolute and relative paths
+    base_path: "components/helmfile"
+    # Can also be set using 'ATMOS_COMPONENTS_HELMFILE_USE_EKS' ENV var
+    # If not specified, defaults to 'true'
+    use_eks: true
+    # Can also be set using 'ATMOS_COMPONENTS_HELMFILE_KUBECONFIG_PATH' ENV var
+    kubeconfig_path: "/dev/shm"
+    # Can also be set using 'ATMOS_COMPONENTS_HELMFILE_HELM_AWS_PROFILE_PATTERN' ENV var
+    helm_aws_profile_pattern: "{namespace}-{tenant}-gbl-{stage}-helm"
+    # Can also be set using 'ATMOS_COMPONENTS_HELMFILE_CLUSTER_NAME_PATTERN' ENV var
+    cluster_name_pattern: "{namespace}-{tenant}-{environment}-{stage}-eks-cluster"
+
+
+
diff --git a/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/stack.yaml b/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/stack.yaml
new file mode 100644
index 0000000000..5b2994a331
--- /dev/null
+++ b/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/stack.yaml
@@ -0,0 +1,7 @@
+stacks:
+  base_path: "stacks"
+  included_paths:
+    - "deploy/**/*"
+  excluded_paths:
+    - "**/_defaults.yaml"
+  name_pattern: "{dev}"
diff --git a/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/terraform.yaml b/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/terraform.yaml
new file mode 100644
index 0000000000..201d2ff8a0
--- /dev/null
+++ b/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/terraform.yaml
@@ -0,0 +1,23 @@
+components:
+  terraform:
+    # Optional `command` specifies the executable to be called by `atmos` when running Terraform commands
+    # If not defined, `terraform` is used
+    # Examples:
+    # command: terraform
+    # command: /usr/local/bin/terraform
+    # command: /usr/local/bin/terraform-1.8
+    # command: tofu
+    # command: /usr/local/bin/tofu-1.7.1
+    # Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_COMMAND' ENV var, or '--terraform-command' command-line argument
+    command: terraform
+    # Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_BASE_PATH' ENV var, or '--terraform-dir' command-line argument
+    # Supports both absolute and relative paths
+    base_path: "components/terraform"
+    # Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_APPLY_AUTO_APPROVE' ENV var
+    apply_auto_approve: false
+    # Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_DEPLOY_RUN_INIT' ENV var, or '--deploy-run-init' command-line argument
+    deploy_run_init: true
+    # Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_INIT_RUN_RECONFIGURE' ENV var, or '--init-run-reconfigure' command-line argument
+    init_run_reconfigure: true
+    # Can also be set using 'ATMOS_COMPONENTS_TERRAFORM_AUTO_GENERATE_BACKEND_FILE' ENV var, or '--auto-generate-backend-file' command-line argument
+    auto_generate_backend_file: true
diff --git a/tests/fixtures/scenarios/atmos-configuration/atmos.yaml b/tests/fixtures/scenarios/atmos-configuration/atmos.yaml
new file mode 100644
index 0000000000..063685dbc5
--- /dev/null
+++ b/tests/fixtures/scenarios/atmos-configuration/atmos.yaml
@@ -0,0 +1,5 @@
+# Description: Configuration file for the Atmos CLI
+# default import path is ./atmos.d import .yaml files from the directory and merge them
+base_path: "./"
+
+  

From 5e134f515275a3e987d1fcc9b43f958989ff7136 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Fri, 21 Feb 2025 04:36:35 +0200
Subject: [PATCH 11/83] update snapshots

---
 ...mmands_atmos_describe_config.stdout.golden |   3 +-
 ...tmos_describe_config_-f_yaml.stdout.golden |   1 +
 ...tmos_describe_config_imports.stderr.golden |  26 +++
 ...tmos_describe_config_imports.stdout.golden | 166 ++++++++++++++++++
 ...atmos_describe_configuration.stderr.golden |  18 ++
 ...atmos_describe_configuration.stdout.golden |  61 +++++++
 6 files changed, 274 insertions(+), 1 deletion(-)
 create mode 100644 tests/snapshots/TestCLICommands_atmos_describe_config_imports.stderr.golden
 create mode 100644 tests/snapshots/TestCLICommands_atmos_describe_config_imports.stdout.golden
 create mode 100644 tests/snapshots/TestCLICommands_atmos_describe_configuration.stderr.golden
 create mode 100644 tests/snapshots/TestCLICommands_atmos_describe_configuration.stdout.golden

diff --git a/tests/snapshots/TestCLICommands_atmos_describe_config.stdout.golden b/tests/snapshots/TestCLICommands_atmos_describe_config.stdout.golden
index c132900a79..afee507a13 100644
--- a/tests/snapshots/TestCLICommands_atmos_describe_config.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_describe_config.stdout.golden
@@ -145,5 +145,6 @@
       "color": true
     }
   },
-  "cli_config_path": "/absolute/path/to/repo/examples/demo-stacks/atmos.yaml"
+  "cli_config_path": "/absolute/path/to/repo/examples/demo-stacks/atmos.yaml",
+  "import": null
 }
diff --git a/tests/snapshots/TestCLICommands_atmos_describe_config_-f_yaml.stdout.golden b/tests/snapshots/TestCLICommands_atmos_describe_config_-f_yaml.stdout.golden
index d6da4dbb08..d70e4b5027 100644
--- a/tests/snapshots/TestCLICommands_atmos_describe_config_-f_yaml.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_describe_config_-f_yaml.stdout.golden
@@ -44,4 +44,5 @@ validate:
     editorconfig:
         color: true
 cli_config_path: /absolute/path/to/repo/examples/demo-stacks/atmos.yaml
+import: []
 
diff --git a/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stderr.golden b/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stderr.golden
new file mode 100644
index 0000000000..cf926f94b9
--- /dev/null
+++ b/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stderr.golden
@@ -0,0 +1,26 @@
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d' + '**/*.yaml')"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d' + '**/*.yml')"
+DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d' + '**/*.yaml')"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d' + '**/*.yml')"
+DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
+DEBU atmos merged config from import import=https://raw.githubusercontent.com/cloudposse/atmos/refs/heads/main/atmos.yaml file_path=/atmos-import/atmos-import.yaml
+DEBU atmos merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/commands.yaml
+DEBU atmos merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/vendor.yaml
+DEBU atmos merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/tools/stack.yml
+DEBU atmos merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/tools/terraform.yaml
+DEBU atmos merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/logs.yaml file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/logs.yaml
+DEBU processStoreConfig atmosConfig.StoresConfig=map[]
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d' + '**/*.yaml')"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d' + '**/*.yml')"
+DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d' + '**/*.yaml')"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d' + '**/*.yml')"
+DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
+DEBU atmos merged config from import import=https://raw.githubusercontent.com/cloudposse/atmos/refs/heads/main/atmos.yaml file_path=/atmos-import/atmos-import.yaml
+DEBU atmos merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/commands.yaml
+DEBU atmos merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/vendor.yaml
+DEBU atmos merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/tools/stack.yml
+DEBU atmos merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/tools/terraform.yaml
+DEBU atmos merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/logs.yaml file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/logs.yaml
+DEBU processStoreConfig atmosConfig.StoresConfig=map[]
diff --git a/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stdout.golden b/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stdout.golden
new file mode 100644
index 0000000000..589a22c594
--- /dev/null
+++ b/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stdout.golden
@@ -0,0 +1,166 @@
+base_path: ""
+components:
+    terraform:
+        base_path: components/terraform
+        apply_auto_approve: true
+        append_user_agent: Atmos/test (Cloud Posse; +https://atmos.tools)
+        deploy_run_init: true
+        init_run_reconfigure: true
+        auto_generate_backend_file: false
+        command: terraform
+        shell:
+            prompt: ""
+    helmfile:
+        base_path: components/helmfile
+        use_eks: true
+        kubeconfig_path: /dev/shm
+        helm_aws_profile_pattern: '{namespace}-{tenant}-gbl-{stage}-helm'
+        cluster_name_pattern: '{namespace}-{tenant}-{environment}-{stage}-eks-cluster'
+        command: ""
+stacks:
+    base_path: stacks
+    included_paths:
+        - deploy/**/*
+    excluded_paths:
+        - '**/_defaults.yaml'
+    name_pattern: '{dev}'
+    name_template: ""
+workflows:
+    base_path: stacks/workflows
+    list:
+        format: ""
+        columns: []
+logs:
+    file: /dev/stderr
+    level: Debug
+commands:
+    - name: test
+      description: Run all tests
+      env: []
+      arguments: []
+      flags: []
+      component_config:
+        component: ""
+        stack: ""
+      steps:
+        - atmos describe config
+      commands: []
+      verbose: false
+integrations:
+    atlantis:
+        path: atlantis.yaml
+        config_templates:
+            config-1:
+                version: 3
+                automerge: true
+                delete_source_branch_on_merge: true
+                parallel_plan: true
+                parallel_apply: true
+                allowed_regexp_prefixes:
+                    - dev/
+                    - staging/
+                    - prod/
+        project_templates:
+            project-1:
+                name: '{tenant}-{environment}-{stage}-{component}'
+                workspace: '{workspace}'
+                dir: '{component-path}'
+                terraform_version: v1.2
+                delete_source_branch_on_merge: true
+                autoplan:
+                    enabled: true
+                    when_modified:
+                        - '**/*.tf'
+                        - varfiles/$PROJECT_NAME.tfvars.json
+                apply_requirements:
+                    - approved
+        workflow_templates:
+            workflow-1:
+                apply:
+                    steps:
+                        - run: terraform apply $PLANFILE
+                plan:
+                    steps:
+                        - run: terraform init -input=false
+                        - run: terraform workspace select $WORKSPACE || terraform workspace new $WORKSPACE
+                        - run: terraform plan -input=false -refresh -out $PLANFILE -var-file varfiles/$PROJECT_NAME.tfvars.json
+    github:
+        gitops:
+            infracost-enabled: false
+            opentofu-version: 1.8.4
+            terraform-version: 1.9.8
+schemas:
+    jsonschema:
+        base_path: stacks/schemas/jsonschema
+    opa:
+        base_path: stacks/schemas/opa
+templates:
+    settings:
+        enabled: true
+        sprig:
+            enabled: true
+        gomplate:
+            enabled: true
+            timeout: 5
+            datasources: {}
+        evaluations: 1
+settings:
+    list_merge_strategy: replace
+    terminal:
+        max_width: 120
+        pager: true
+        colors: true
+        unicode: true
+        syntax_highlighting:
+            enabled: true
+            lexer: ""
+            formatter: terminal
+            theme: dracula
+            pager: false
+            line_numbers: true
+            wrap: false
+    markdown:
+        document:
+            color: ${colors.text}
+        heading:
+            color: ${colors.primary}
+            bold: true
+        strong:
+            color: ${colors.secondary}
+            bold: true
+        emph:
+            color: ${colors.muted}
+            italic: true
+        code_block:
+            color: ${colors.secondary}
+            margin: 1
+        link:
+            color: ${colors.primary}
+            underline: true
+    inject_github_token: true
+vendor:
+    base_path: ./vendor.yaml
+initialized: true
+stacksBaseAbsolutePath: /absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/stacks
+includeStackAbsolutePaths:
+    - /absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/stacks/deploy/**/*
+excludeStackAbsolutePaths:
+    - /absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/stacks/**/_defaults.yaml
+terraformDirAbsolutePath: /absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/components/terraform
+helmfileDirAbsolutePath: /absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/components/helmfile
+default: false
+version:
+    check:
+        enabled: true
+        timeout: 1000
+        frequency: 1h
+validate:
+    editorconfig:
+        format: default
+        color: true
+cli_config_path: /absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.yaml
+import:
+    - https:/raw.githubusercontent.com/cloudposse/atmos/refs/heads/main/atmos.yaml
+    - configs.d/**/*
+    - ./logs.yaml
+
diff --git a/tests/snapshots/TestCLICommands_atmos_describe_configuration.stderr.golden b/tests/snapshots/TestCLICommands_atmos_describe_configuration.stderr.golden
new file mode 100644
index 0000000000..ce99d782ef
--- /dev/null
+++ b/tests/snapshots/TestCLICommands_atmos_describe_configuration.stderr.golden
@@ -0,0 +1,18 @@
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d' + '**/*.yaml')"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d' + '**/*.yml')"
+DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
+DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/commands.yaml
+DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/logs.yaml
+DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/helmfile.yml
+DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/stack.yaml
+DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/terraform.yaml
+DEBU processStoreConfig atmosConfig.StoresConfig=map[]
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d' + '**/*.yaml')"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d' + '**/*.yml')"
+DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
+DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/commands.yaml
+DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/logs.yaml
+DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/helmfile.yml
+DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/stack.yaml
+DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/terraform.yaml
+DEBU processStoreConfig atmosConfig.StoresConfig=map[]
diff --git a/tests/snapshots/TestCLICommands_atmos_describe_configuration.stdout.golden b/tests/snapshots/TestCLICommands_atmos_describe_configuration.stdout.golden
new file mode 100644
index 0000000000..ec387e5761
--- /dev/null
+++ b/tests/snapshots/TestCLICommands_atmos_describe_configuration.stdout.golden
@@ -0,0 +1,61 @@
+base_path: ./
+components:
+    terraform:
+        base_path: components/terraform
+        apply_auto_approve: false
+        append_user_agent: Atmos/test (Cloud Posse; +https://atmos.tools)
+        deploy_run_init: true
+        init_run_reconfigure: true
+        auto_generate_backend_file: true
+        command: terraform
+        shell:
+            prompt: ""
+    helmfile:
+        base_path: components/helmfile
+        use_eks: true
+        kubeconfig_path: /dev/shm
+        helm_aws_profile_pattern: '{namespace}-{tenant}-gbl-{stage}-helm'
+        cluster_name_pattern: '{namespace}-{tenant}-{environment}-{stage}-eks-cluster'
+        command: ""
+stacks:
+    base_path: stacks
+    included_paths:
+        - deploy/**/*
+    excluded_paths:
+        - '**/_defaults.yaml'
+    name_pattern: '{dev}'
+    name_template: ""
+logs:
+    file: /dev/stderr
+    level: Debug
+commands:
+    - name: test
+      description: Run all tests with custom command
+      env: []
+      arguments: []
+      flags: []
+      component_config:
+        component: ""
+        stack: ""
+      steps:
+        - atmos describe config
+      commands: []
+      verbose: false
+settings:
+    list_merge_strategy: ""
+    inject_github_token: true
+initialized: true
+stacksBaseAbsolutePath: /absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/stacks
+includeStackAbsolutePaths:
+    - /absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/stacks/deploy/**/*
+excludeStackAbsolutePaths:
+    - /absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/stacks/**/_defaults.yaml
+terraformDirAbsolutePath: /absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/components/terraform
+helmfileDirAbsolutePath: /absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/components/helmfile
+default: false
+validate:
+    editorconfig:
+        color: true
+cli_config_path: /absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.yaml
+import: []
+

From 413f955a6a8c103e42a6a202111463fbb6fbd363 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Fri, 21 Feb 2025 04:36:53 +0200
Subject: [PATCH 12/83] add import config test

---
 tests/cli_test.go                       |  3 +++
 tests/test-cases/atmos-cli-imports.yaml | 28 +++++++++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100644 tests/test-cases/atmos-cli-imports.yaml

diff --git a/tests/cli_test.go b/tests/cli_test.go
index acd33b3114..9eb7ff7a81 100644
--- a/tests/cli_test.go
+++ b/tests/cli_test.go
@@ -311,6 +311,9 @@ func sanitizeOutput(output string) (string, error) {
 		fixedRemainder := collapseExtraSlashes(groups[2])
 		return groups[1] + fixedRemainder
 	})
+	// 6. Remove the random number added to file name like `atmos-import-454656846`
+	filePathRegex := regexp.MustCompile(`file_path=[^ ]+/atmos-import-\d+/atmos-import-\d+\.yaml`)
+	result = filePathRegex.ReplaceAllString(result, "file_path=/atmos-import/atmos-import.yaml")
 
 	return result, nil
 }
diff --git a/tests/test-cases/atmos-cli-imports.yaml b/tests/test-cases/atmos-cli-imports.yaml
new file mode 100644
index 0000000000..48094be9fc
--- /dev/null
+++ b/tests/test-cases/atmos-cli-imports.yaml
@@ -0,0 +1,28 @@
+# yaml-language-server: $schema=schema.json
+tests:
+  - name: atmos_describe_config_imports
+    snapshot: true
+    enabled: true
+    description: "Ensure atmos execute import configuration"
+    workdir: "fixtures/scenarios/atmos-cli-imports"
+    command: "atmos"
+    args:
+      - "describe"
+      - "config"
+      - "-f"
+      - "yaml"
+    expect:
+      exit_code: 0
+  - name: atmos_describe_configuration
+    snapshot: true
+    enabled: true
+    description: "Ensure atmos configuration"
+    workdir: "fixtures/scenarios/atmos-configuration"
+    command: "atmos"
+    args:
+      - "describe"
+      - "config"
+      - "-f"
+      - "yaml"
+    expect:
+      exit_code: 0

From eae3f972eab9a50e86e9bdf043d99dd0b15e5fa6 Mon Sep 17 00:00:00 2001
From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com>
Date: Fri, 21 Feb 2025 02:46:06 +0000
Subject: [PATCH 13/83] [autofix.ci] apply automated fixes

---
 pkg/config/import_test.go | 1 +
 pkg/config/imports.go     | 2 ++
 pkg/config/load.go        | 1 +
 3 files changed, 4 insertions(+)

diff --git a/pkg/config/import_test.go b/pkg/config/import_test.go
index c25b6bcd8b..5b3120711c 100644
--- a/pkg/config/import_test.go
+++ b/pkg/config/import_test.go
@@ -89,6 +89,7 @@ func TestProcessImports(t *testing.T) {
 	assert.NotContains(t, resolvedPaths, "http://invalid-url.com", "Invalid URL should not be resolved")
 	assert.NotContains(t, resolvedPaths, "", "Empty import path should not be resolved")
 }
+
 func TestProcessImportNested(t *testing.T) {
 	baseDir, err := os.MkdirTemp("", "config-test")
 	assert.NoError(t, err)
diff --git a/pkg/config/imports.go b/pkg/config/imports.go
index e6287f4a8e..d2458d58b5 100644
--- a/pkg/config/imports.go
+++ b/pkg/config/imports.go
@@ -62,6 +62,7 @@ func processConfigImports(source schema.AtmosConfiguration, dst *viper.Viper) er
 	}
 	return nil
 }
+
 func processImports(basePath string, importPaths []string, tempDir string, currentDepth, maxDepth int) (resolvedPaths []ResolvedPaths, err error) {
 	if basePath == "" {
 		return nil, fmt.Errorf("base_Path required to process imports")
@@ -374,6 +375,7 @@ func findMatchingFiles(patterns []string) ([]string, error) {
 
 	return filePaths, nil
 }
+
 func downloadRemoteConfig(url string, tempDir string) (string, error) {
 	// uniq name for the temp file
 	fileName := fmt.Sprintf("atmos-import-%d.yaml", time.Now().UnixNano())
diff --git a/pkg/config/load.go b/pkg/config/load.go
index 05abea6a24..f5c20749fb 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -179,6 +179,7 @@ func readEnvAmosConfigPath(v *viper.Viper) error {
 
 	return nil
 }
+
 func readAtmosConfigCli(v *viper.Viper, atmosCliConfigPath string) error {
 	if len(atmosCliConfigPath) == 0 {
 		return nil

From 6c2f1032bdba83e7e88e8cf744ef74f2369861db Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Sat, 22 Feb 2025 01:13:37 +0200
Subject: [PATCH 14/83] refactor LoadConfig  into smaller helper functions

---
 pkg/config/default.go     | 14 ++++++++
 pkg/config/import_test.go | 10 +++---
 pkg/config/imports.go     | 20 ++++++++---
 pkg/config/load.go        | 72 +++++++++++++++++++++------------------
 4 files changed, 72 insertions(+), 44 deletions(-)

diff --git a/pkg/config/default.go b/pkg/config/default.go
index f05c35e34b..7e29e7ada8 100644
--- a/pkg/config/default.go
+++ b/pkg/config/default.go
@@ -1,12 +1,15 @@
 package config
 
 import (
+	"bytes"
+	"encoding/json"
 	"fmt"
 
 	"github.com/cloudposse/atmos/internal/tui/templates"
 	"github.com/cloudposse/atmos/pkg/schema"
 	"github.com/cloudposse/atmos/pkg/version"
 	"github.com/pkg/errors"
+	"github.com/spf13/viper"
 )
 
 var (
@@ -98,3 +101,14 @@ var (
 		},
 	}
 )
+
+// mergeDefaultConfig merges the contents of defaultCliConfig into the
+// current Viper instance if no other configuration file was located.
+func mergeDefaultConfig(v *viper.Viper) error {
+	j, err := json.Marshal(defaultCliConfig)
+	if err != nil {
+		return err
+	}
+	reader := bytes.NewReader(j)
+	return v.MergeConfig(reader)
+}
diff --git a/pkg/config/import_test.go b/pkg/config/import_test.go
index 5b3120711c..9612449dcb 100644
--- a/pkg/config/import_test.go
+++ b/pkg/config/import_test.go
@@ -13,7 +13,7 @@ import (
 
 func setupTestFile(content, tempDir string, filename string) (string, error) {
 	filePath := filepath.Join(tempDir, filename)
-	err := os.WriteFile(filePath, []byte(content), 0o644)
+	err := os.WriteFile(filePath, []byte(content), 0o600)
 	return filePath, err
 }
 
@@ -35,23 +35,23 @@ func TestProcessImports(t *testing.T) {
 
 	// Create mock configuration files in the directory
 	configFile1 := filepath.Join(configDir, "config1.yaml")
-	err = os.WriteFile(configFile1, []byte("key1: value1"), 0o644)
+	err = os.WriteFile(configFile1, []byte("key1: value1"), 0o600)
 	assert.NoError(t, err)
 
 	configFile2 := filepath.Join(configDir, "config2.yaml")
-	err = os.WriteFile(configFile2, []byte("key2: value2"), 0o644)
+	err = os.WriteFile(configFile2, []byte("key2: value2"), 0o600)
 	assert.NoError(t, err)
 
 	// Step 2.2: Create a specific local file
 	localFile := filepath.Join(baseDir, "logs.yaml")
-	err = os.WriteFile(localFile, []byte("key3: value3"), 0o644)
+	err = os.WriteFile(localFile, []byte("key3: value3"), 0o600)
 	assert.NoError(t, err)
 	// step 2.3
 	configDir2 := filepath.Join(baseDir, "config")
 	err = os.MkdirAll(configDir2, 0o755)
 	assert.NoError(t, err)
 	configFile3 := filepath.Join(configDir2, "config3.yaml")
-	err = os.WriteFile(configFile3, []byte("key4: value4"), 0o644)
+	err = os.WriteFile(configFile3, []byte("key4: value4"), 0o600)
 	assert.NoError(t, err)
 	// Step 3: Define test imports
 	imports := []string{
diff --git a/pkg/config/imports.go b/pkg/config/imports.go
index d2458d58b5..54b67a31ee 100644
--- a/pkg/config/imports.go
+++ b/pkg/config/imports.go
@@ -53,10 +53,11 @@ func processConfigImports(source schema.AtmosConfiguration, dst *viper.Viper) er
 		for _, resolvedPath := range resolvedPaths {
 			err := MergeConfigFile(resolvedPath.filePath, dst)
 			if err != nil {
+				//nolint:revive
 				log.Debug("error loading config file", "import", resolvedPath.importPaths, "file_path", resolvedPath.filePath, "error", err)
 				continue
 			}
-
+			//nolint:revive
 			log.Debug("atmos merged config from import", "import", resolvedPath.importPaths, "file_path", resolvedPath.filePath)
 		}
 	}
@@ -87,6 +88,7 @@ func processImports(basePath string, importPaths []string, tempDir string, curre
 			// Handle remote imports
 			paths, err := processRemoteImport(basePath, importPath, tempDir, currentDepth, maxDepth)
 			if err != nil {
+				//nolint:revive
 				log.Debug("failed to process remote import", "path", importPath, "error", err)
 				continue
 			}
@@ -95,6 +97,7 @@ func processImports(basePath string, importPaths []string, tempDir string, curre
 			// Handle local imports
 			paths, err := processLocalImport(basePath, importPath, tempDir, currentDepth, maxDepth)
 			if err != nil {
+				//nolint:revive
 				log.Debug("failed to process local import", "path", importPath, "error", err)
 				continue
 			}
@@ -125,6 +128,7 @@ func processRemoteImport(basePath, importPath, tempDir string, currentDepth, max
 	v.SetConfigFile(tempFile)
 	err = v.ReadInConfig()
 	if err != nil {
+		//nolint:revive
 		log.Debug("failed to read remote config", "path", importPath, "error", err)
 		return nil, fmt.Errorf("failed to read remote config")
 	}
@@ -145,6 +149,7 @@ func processRemoteImport(basePath, importPath, tempDir string, currentDepth, max
 	if Imports != nil && len(Imports) > 0 {
 		nestedPaths, err := processImports(importBasePath, Imports, tempDir, currentDepth+1, maxDepth)
 		if err != nil {
+			//nolint:revive
 			log.Debug("failed to process nested imports", "import", importPath, "err", err)
 			return nil, fmt.Errorf("failed to process nested imports")
 		}
@@ -170,6 +175,7 @@ func processLocalImport(basePath string, importPath, tempDir string, currentDept
 	}
 	paths, err := SearchAtmosConfig(importPath)
 	if err != nil {
+		//nolint:revive
 		log.Debug("failed to resolve local import path", "path", importPath, "err", err)
 		return nil, fmt.Errorf("failed to resolve local import path")
 	}
@@ -182,6 +188,7 @@ func processLocalImport(basePath string, importPath, tempDir string, currentDept
 		v.SetConfigType("yaml")
 		err := v.ReadInConfig()
 		if err != nil {
+			//nolint:revive
 			log.Debug("failed to load local config", "path", path, "error", err)
 			continue
 		}
@@ -200,6 +207,7 @@ func processLocalImport(basePath string, importPath, tempDir string, currentDept
 		if Imports != nil {
 			nestedPaths, err := processImports(importBasePath, Imports, tempDir, currentDepth+1, maxDepth)
 			if err != nil {
+				//nolint:revive
 				log.Debug("failed to process nested imports from", "path", path, "error", err)
 				continue
 			}
@@ -210,7 +218,7 @@ func processLocalImport(basePath string, importPath, tempDir string, currentDept
 	return resolvedPaths, nil
 }
 
-// SearchAtmosConfig searches for a config file in path. path is directory,file or a pattern .
+// SearchAtmosConfig searches for a config file in path. The path is directory, file or a pattern.
 func SearchAtmosConfig(path string) ([]string, error) {
 	if stat, err := os.Stat(path); err == nil {
 		if !stat.IsDir() {
@@ -247,8 +255,8 @@ func generatePatterns(path string) ([]string, error) {
 	if isDir {
 		// Search for all .yaml and .yml
 		patterns := []string{
-			filepath.Join(path, "**/*.yaml"),
-			filepath.Join(path, "**/*.yml"),
+			filepath.Join(path, "**", "*.yaml"),
+			filepath.Join(path, "**", "*.yml"),
 		}
 		return patterns, nil
 	}
@@ -273,6 +281,7 @@ func convertToAbsolutePaths(filePaths []string) ([]string, error) {
 	for _, path := range filePaths {
 		absPath, err := filepath.Abs(path)
 		if err != nil {
+			//nolint:revive
 			log.Debug("Error getting absolute path for file", "path", path, "error", err)
 			continue
 		}
@@ -286,7 +295,7 @@ func convertToAbsolutePaths(filePaths []string) ([]string, error) {
 	return absPaths, nil
 }
 
-// detectPriorityFiles detects which files will have priority .  yaml win over yml if file has same path
+// detectPriorityFiles detects which files will have priority. The longer .yaml extensions win over the shorter .yml extensions, if both files exist in the same path.
 func detectPriorityFiles(files []string) []string {
 	// Map to store the highest priority file for each base name
 	priorityMap := make(map[string]string)
@@ -363,6 +372,7 @@ func findMatchingFiles(patterns []string) ([]string, error) {
 	for _, pattern := range patterns {
 		matches, err := u.GetGlobMatches(pattern)
 		if err != nil {
+			//nolint:revive
 			log.Debug("Error getting glob matches for path", "path", pattern, "error", err)
 			continue
 		}
diff --git a/pkg/config/load.go b/pkg/config/load.go
index f5c20749fb..e56ae10872 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -1,8 +1,6 @@
 package config
 
 import (
-	"bytes"
-	"encoding/json"
 	"fmt"
 	"os"
 	"path/filepath"
@@ -29,45 +27,22 @@ func LoadConfig(configAndStacksInfo schema.ConfigAndStacksInfo) (schema.AtmosCon
 	v.SetConfigType("yaml")
 	v.SetTypeByDefaultValue(true)
 	setDefaultConfiguration(v)
-	err := readSystemConfig(v)
-	if err != nil {
-		return atmosConfig, err
-	}
-
-	err = readHomeConfig(v)
-	if err != nil {
-		return atmosConfig, err
-	}
-
-	err = readWorkDirConfig(v)
-	if err != nil {
-		return atmosConfig, err
-	}
-	err = readEnvAmosConfigPath(v)
-	if err != nil {
-		return atmosConfig, err
-	}
-	err = readAtmosConfigCli(v, configAndStacksInfo.AtmosCliConfigPath)
-	if err != nil {
+	// Load configuration from different sources.
+	if err := loadConfigSources(v, configAndStacksInfo.AtmosCliConfigPath); err != nil {
 		return atmosConfig, err
 	}
-
-	atmosConfig.CliConfigPath = v.ConfigFileUsed()
-
-	if atmosConfig.CliConfigPath == "" {
+	// If no config file is used, fall back to the default CLI config.
+	if v.ConfigFileUsed() == "" {
 		log.Debug("'atmos.yaml' CLI config was not found", "paths", "system dir, home dir, current dir, ENV vars")
 		log.Debug("Refer to https://atmos.tools/cli/configuration for details on how to configure 'atmos.yaml'")
 		log.Debug("Using the default CLI config")
-		j, err := json.Marshal(defaultCliConfig)
-		if err != nil {
-			return atmosConfig, err
-		}
-		reader := bytes.NewReader(j)
-		err = v.MergeConfig(reader)
-		if err != nil {
+
+		if err := mergeDefaultConfig(v); err != nil {
 			return atmosConfig, err
 		}
 	}
+	atmosConfig.CliConfigPath = v.ConfigFileUsed()
+
 	// Set the CLI config path in the atmosConfig struct
 	if atmosConfig.CliConfigPath != "" && !filepath.IsAbs(atmosConfig.CliConfigPath) {
 		absPath, err := filepath.Abs(atmosConfig.CliConfigPath)
@@ -80,7 +55,7 @@ func LoadConfig(configAndStacksInfo schema.ConfigAndStacksInfo) (schema.AtmosCon
 	atmosConfig.Validate.EditorConfig.Color = true
 	// https://gist.github.com/chazcheadle/45bf85b793dea2b71bd05ebaa3c28644
 	// https://sagikazarmark.hu/blog/decoding-custom-formats-with-viper/
-	err = v.Unmarshal(&atmosConfig)
+	err := v.Unmarshal(&atmosConfig)
 	if err != nil {
 		return atmosConfig, err
 	}
@@ -97,6 +72,28 @@ func setDefaultConfiguration(v *viper.Viper) {
 	v.SetDefault("logs.level", "Info")
 }
 
+// loadConfigSources delegates reading configs from each source,
+// returning early if any step in the chain fails.
+func loadConfigSources(v *viper.Viper, cliConfigPath string) error {
+	if err := readSystemConfig(v); err != nil {
+		return err
+	}
+
+	if err := readHomeConfig(v); err != nil {
+		return err
+	}
+
+	if err := readWorkDirConfig(v); err != nil {
+		return err
+	}
+
+	if err := readEnvAmosConfigPath(v); err != nil {
+		return err
+	}
+
+	return readAtmosConfigCli(v, cliConfigPath)
+}
+
 // readSystemConfig load config from system dir
 func readSystemConfig(v *viper.Viper) error {
 	configFilePath := ""
@@ -169,6 +166,7 @@ func readEnvAmosConfigPath(v *viper.Viper) error {
 	if err != nil {
 		switch err.(type) {
 		case viper.ConfigFileNotFoundError:
+			//nolint:revive
 			log.Debug("config not found ENV var ATMOS_CLI_CONFIG_PATH", "file", configFilePath)
 			return nil
 		default:
@@ -187,6 +185,7 @@ func readAtmosConfigCli(v *viper.Viper, atmosCliConfigPath string) error {
 	err := mergeConfig(v, atmosCliConfigPath, CliConfigFileName, true)
 	switch err.(type) {
 	case viper.ConfigFileNotFoundError:
+		//nolint:revive
 		log.Debug("config not found", "file", atmosCliConfigPath)
 	default:
 		return err
@@ -207,9 +206,11 @@ func mergeConfig(v *viper.Viper, path string, fileName string, processImports bo
 		return nil
 	}
 	if err := mergeDefaultImports(path, v); err != nil {
+		//nolint:revive
 		log.Debug("error process imports", "path", path, "error", err)
 	}
 	if err := mergeImports(v); err != nil {
+		//nolint:revive
 		log.Debug("error process imports", "file", v.ConfigFileUsed(), "error", err)
 	}
 	return nil
@@ -239,6 +240,7 @@ func mergeDefaultImports(dirPath string, dst *viper.Viper) error {
 	searchDir = filepath.Join(filepath.FromSlash(dirPath), ".atmos.d/**/*")
 	foundPaths2, err := SearchAtmosConfig(searchDir)
 	if err != nil {
+		//nolint:revive
 		log.Debug("Failed to find atmos config file", "path", searchDir, "error", err)
 	}
 	if len(foundPaths2) > 0 {
@@ -247,9 +249,11 @@ func mergeDefaultImports(dirPath string, dst *viper.Viper) error {
 	for _, filePath := range atmosFoundFilePaths {
 		err := MergeConfigFile(filePath, dst)
 		if err != nil {
+			//nolint:revive
 			log.Debug("error loading config file", "path", filePath, "error", err)
 			continue
 		}
+		//nolint:revive
 		log.Debug("atmos merged config", "path", filePath)
 
 	}

From 0bc7b4a27fe910bbc9ca9351bcda06cfaa1b7585 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Sat, 22 Feb 2025 01:27:43 +0200
Subject: [PATCH 15/83] update Valid_Log_Level snapshots

---
 ...mands_Valid_Log_Level_in_Command_Line_Flag.stdout.golden | 2 +-
 ...CLICommands_Valid_Log_Level_in_Config_File.stderr.golden | 6 ++++++
 ...CLICommands_Valid_Log_Level_in_Config_File.stdout.golden | 2 +-
 ...ds_Valid_Log_Level_in_Environment_Variable.stderr.golden | 6 ++++++
 ...ds_Valid_Log_Level_in_Environment_Variable.stdout.golden | 2 +-
 5 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Command_Line_Flag.stdout.golden b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Command_Line_Flag.stdout.golden
index 82c26c3598..c39a129255 100644
--- a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Command_Line_Flag.stdout.golden
+++ b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Command_Line_Flag.stdout.golden
@@ -1,3 +1,3 @@
 
-👽 Atmos test on darwin/arm64
+👽 Atmos test on linux/amd64
 
diff --git a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden
index a75ad0264a..d2c242ae37 100644
--- a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden
+++ b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden
@@ -1,2 +1,8 @@
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d' + '**/*.yaml')"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d' + '**/*.yml')"
+DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d' + '**/*.yaml')"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d' + '**/*.yml')"
+DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
 DEBU processStoreConfig atmosConfig.StoresConfig=map[]
diff --git a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stdout.golden b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stdout.golden
index 82c26c3598..c39a129255 100644
--- a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stdout.golden
+++ b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stdout.golden
@@ -1,3 +1,3 @@
 
-👽 Atmos test on darwin/arm64
+👽 Atmos test on linux/amd64
 
diff --git a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stderr.golden b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stderr.golden
index 7b40edf9e4..46b3cba5e4 100644
--- a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stderr.golden
+++ b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stderr.golden
@@ -1,3 +1,9 @@
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yaml' ('/absolute/path/to/repo/atmos.d' + '**/*.yaml')"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yml' ('/absolute/path/to/repo/atmos.d' + '**/*.yml')"
+DEBU Failed to find atmos config file path=/absolute/path/to/repo/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yaml')"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yml')"
+DEBU Failed to find atmos config file path=/absolute/path/to/repo/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Found ENV var ATMOS_LOGS_LEVEL=Debug
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
 DEBU processStoreConfig atmosConfig.StoresConfig=map[]
diff --git a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stdout.golden b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stdout.golden
index 82c26c3598..c39a129255 100644
--- a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stdout.golden
+++ b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stdout.golden
@@ -1,3 +1,3 @@
 
-👽 Atmos test on darwin/arm64
+👽 Atmos test on linux/amd64
 

From f87f1e980e2075097b65f53b852b7724ed91bced Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Sat, 22 Feb 2025 01:56:04 +0200
Subject: [PATCH 16/83] update log snapshots

---
 pkg/config/imports.go                          | 18 ++++++++++++++----
 pkg/config/load.go                             |  2 +-
 ...og_Level_in_Command_Line_Flag.stdout.golden |  2 +-
 ...alid_Log_Level_in_Config_File.stderr.golden |  1 +
 ...alid_Log_Level_in_Config_File.stdout.golden |  2 +-
 ...Level_in_Environment_Variable.stdout.golden |  2 +-
 ...uld_be_priortized_over_config.stdout.golden |  7 +++++++
 ...riortized_over_env_and_config.stdout.golden |  7 +++++++
 ...uld_be_priortized_over_config.stderr.golden |  6 ++++++
 ...riortized_over_env_and_config.stderr.golden |  6 ++++++
 10 files changed, 45 insertions(+), 8 deletions(-)

diff --git a/pkg/config/imports.go b/pkg/config/imports.go
index 54b67a31ee..41cab680e1 100644
--- a/pkg/config/imports.go
+++ b/pkg/config/imports.go
@@ -14,9 +14,16 @@ import (
 	"github.com/cloudposse/atmos/pkg/schema"
 	u "github.com/cloudposse/atmos/pkg/utils"
 	"github.com/hashicorp/go-getter"
+	"github.com/pkg/errors"
 	"github.com/spf13/viper"
 )
 
+var (
+	ErrBasePath     = errors.New("base_path required to process imports")
+	ErrTempDir      = errors.New("tempDir required to process imports")
+	ErrResolveLocal = errors.New("failed to resolve local import path")
+)
+
 type importTypes int
 
 const (
@@ -33,7 +40,10 @@ type ResolvedPaths struct {
 
 // processConfigImports It reads the import paths from the source configuration,
 // It processes imports from the source configuration and merges them into the destination configuration.
-func processConfigImports(source schema.AtmosConfiguration, dst *viper.Viper) error {
+func processConfigImports(source *schema.AtmosConfiguration, dst *viper.Viper) error {
+	if source == nil || dst == nil {
+		return fmt.Errorf("source and destination cannot be nil")
+	}
 	if len(source.Import) > 0 {
 		importPaths := source.Import
 		baseBath, err := filepath.Abs(source.BasePath)
@@ -66,10 +76,10 @@ func processConfigImports(source schema.AtmosConfiguration, dst *viper.Viper) er
 
 func processImports(basePath string, importPaths []string, tempDir string, currentDepth, maxDepth int) (resolvedPaths []ResolvedPaths, err error) {
 	if basePath == "" {
-		return nil, fmt.Errorf("base_Path required to process imports")
+		return nil, ErrBasePath
 	}
 	if tempDir == "" {
-		return nil, fmt.Errorf("tempDir required to process imports")
+		return nil, ErrTempDir
 	}
 	if currentDepth > maxDepth {
 		return nil, fmt.Errorf("maximum import depth of %d exceeded", maxDepth)
@@ -177,7 +187,7 @@ func processLocalImport(basePath string, importPath, tempDir string, currentDept
 	if err != nil {
 		//nolint:revive
 		log.Debug("failed to resolve local import path", "path", importPath, "err", err)
-		return nil, fmt.Errorf("failed to resolve local import path")
+		return nil, ErrResolveLocal
 	}
 
 	resolvedPaths := make([]ResolvedPaths, 0)
diff --git a/pkg/config/load.go b/pkg/config/load.go
index e56ae10872..abaf84aae6 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -267,7 +267,7 @@ func mergeImports(dst *viper.Viper) error {
 	if err != nil {
 		return err
 	}
-	if err := processConfigImports(src, dst); err != nil {
+	if err := processConfigImports(&src, dst); err != nil {
 		return err
 	}
 	return nil
diff --git a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Command_Line_Flag.stdout.golden b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Command_Line_Flag.stdout.golden
index c39a129255..82c26c3598 100644
--- a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Command_Line_Flag.stdout.golden
+++ b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Command_Line_Flag.stdout.golden
@@ -1,3 +1,3 @@
 
-👽 Atmos test on linux/amd64
+👽 Atmos test on darwin/arm64
 
diff --git a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden
index d2c242ae37..68edbe55de 100644
--- a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden
+++ b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden
@@ -4,5 +4,6 @@ DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures
 DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d' + '**/*.yaml')"
 DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
+DEBU Found ENV var ATMOS_LOGS_LEVEL=Debug
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
 DEBU processStoreConfig atmosConfig.StoresConfig=map[]
diff --git a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stdout.golden b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stdout.golden
index c39a129255..82c26c3598 100644
--- a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stdout.golden
+++ b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stdout.golden
@@ -1,3 +1,3 @@
 
-👽 Atmos test on linux/amd64
+👽 Atmos test on darwin/arm64
 
diff --git a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stdout.golden b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stdout.golden
index c39a129255..82c26c3598 100644
--- a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stdout.golden
+++ b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stdout.golden
@@ -1,3 +1,3 @@
 
-👽 Atmos test on linux/amd64
+👽 Atmos test on darwin/arm64
 
diff --git a/tests/snapshots/TestCLICommands_Valid_log_file_in_env_should_be_priortized_over_config.stdout.golden b/tests/snapshots/TestCLICommands_Valid_log_file_in_env_should_be_priortized_over_config.stdout.golden
index ecbca1c6f1..19ab468ef4 100644
--- a/tests/snapshots/TestCLICommands_Valid_log_file_in_env_should_be_priortized_over_config.stdout.golden
+++ b/tests/snapshots/TestCLICommands_Valid_log_file_in_env_should_be_priortized_over_config.stdout.golden
@@ -1,4 +1,11 @@
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yaml' ('/absolute/path/to/repo/atmos.d' + '**/*.yaml')"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yml' ('/absolute/path/to/repo/atmos.d' + '**/*.yml')"
+DEBU Failed to find atmos config file path=/absolute/path/to/repo/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yaml')"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yml')"
+DEBU Failed to find atmos config file path=/absolute/path/to/repo/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Found ENV var ATMOS_LOGS_FILE=/dev/stdout
+DEBU Found ENV var ATMOS_LOGS_LEVEL=Debug
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
 DEBU Using command line argument '--logs-level=Debug'
 DEBU processStoreConfig atmosConfig.StoresConfig=map[]
diff --git a/tests/snapshots/TestCLICommands_Valid_log_file_in_flag_should_be_priortized_over_env_and_config.stdout.golden b/tests/snapshots/TestCLICommands_Valid_log_file_in_flag_should_be_priortized_over_env_and_config.stdout.golden
index 26c83d8db4..101d5847e4 100644
--- a/tests/snapshots/TestCLICommands_Valid_log_file_in_flag_should_be_priortized_over_env_and_config.stdout.golden
+++ b/tests/snapshots/TestCLICommands_Valid_log_file_in_flag_should_be_priortized_over_env_and_config.stdout.golden
@@ -1,4 +1,11 @@
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yaml' ('/absolute/path/to/repo/atmos.d' + '**/*.yaml')"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yml' ('/absolute/path/to/repo/atmos.d' + '**/*.yml')"
+DEBU Failed to find atmos config file path=/absolute/path/to/repo/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yaml')"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yml')"
+DEBU Failed to find atmos config file path=/absolute/path/to/repo/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Found ENV var ATMOS_LOGS_FILE=/dev/stderr
+DEBU Found ENV var ATMOS_LOGS_LEVEL=Debug
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
 DEBU Using command line argument '--logs-level=Debug'
 DEBU Using command line argument '--logs-file=/dev/stdout'
diff --git a/tests/snapshots/TestCLICommands_Valid_log_level_in_env_should_be_priortized_over_config.stderr.golden b/tests/snapshots/TestCLICommands_Valid_log_level_in_env_should_be_priortized_over_config.stderr.golden
index 7b40edf9e4..46b3cba5e4 100644
--- a/tests/snapshots/TestCLICommands_Valid_log_level_in_env_should_be_priortized_over_config.stderr.golden
+++ b/tests/snapshots/TestCLICommands_Valid_log_level_in_env_should_be_priortized_over_config.stderr.golden
@@ -1,3 +1,9 @@
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yaml' ('/absolute/path/to/repo/atmos.d' + '**/*.yaml')"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yml' ('/absolute/path/to/repo/atmos.d' + '**/*.yml')"
+DEBU Failed to find atmos config file path=/absolute/path/to/repo/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yaml')"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yml')"
+DEBU Failed to find atmos config file path=/absolute/path/to/repo/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Found ENV var ATMOS_LOGS_LEVEL=Debug
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
 DEBU processStoreConfig atmosConfig.StoresConfig=map[]
diff --git a/tests/snapshots/TestCLICommands_Valid_log_level_in_flag_should_be_priortized_over_env_and_config.stderr.golden b/tests/snapshots/TestCLICommands_Valid_log_level_in_flag_should_be_priortized_over_env_and_config.stderr.golden
index f58cd13ff0..386f735d1d 100644
--- a/tests/snapshots/TestCLICommands_Valid_log_level_in_flag_should_be_priortized_over_env_and_config.stderr.golden
+++ b/tests/snapshots/TestCLICommands_Valid_log_level_in_flag_should_be_priortized_over_env_and_config.stderr.golden
@@ -1,3 +1,9 @@
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yaml' ('/absolute/path/to/repo/atmos.d' + '**/*.yaml')"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yml' ('/absolute/path/to/repo/atmos.d' + '**/*.yml')"
+DEBU Failed to find atmos config file path=/absolute/path/to/repo/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yaml')"
+DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yml')"
+DEBU Failed to find atmos config file path=/absolute/path/to/repo/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Found ENV var ATMOS_LOGS_LEVEL=Info
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
 DEBU Using command line argument '--logs-level=Debug'

From d660739d9a6712518d6fb0e2219f583552ee755c Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Sat, 22 Feb 2025 02:06:09 +0200
Subject: [PATCH 17/83] update snapshots

---
 ...og_file_in_env_should_be_priortized_over_config.stdout.golden | 1 -
 ...n_flag_should_be_priortized_over_env_and_config.stdout.golden | 1 -
 2 files changed, 2 deletions(-)

diff --git a/tests/snapshots/TestCLICommands_Valid_log_file_in_env_should_be_priortized_over_config.stdout.golden b/tests/snapshots/TestCLICommands_Valid_log_file_in_env_should_be_priortized_over_config.stdout.golden
index 19ab468ef4..9a4e7002ab 100644
--- a/tests/snapshots/TestCLICommands_Valid_log_file_in_env_should_be_priortized_over_config.stdout.golden
+++ b/tests/snapshots/TestCLICommands_Valid_log_file_in_env_should_be_priortized_over_config.stdout.golden
@@ -5,7 +5,6 @@ DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**
 DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Found ENV var ATMOS_LOGS_FILE=/dev/stdout
-DEBU Found ENV var ATMOS_LOGS_LEVEL=Debug
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
 DEBU Using command line argument '--logs-level=Debug'
 DEBU processStoreConfig atmosConfig.StoresConfig=map[]
diff --git a/tests/snapshots/TestCLICommands_Valid_log_file_in_flag_should_be_priortized_over_env_and_config.stdout.golden b/tests/snapshots/TestCLICommands_Valid_log_file_in_flag_should_be_priortized_over_env_and_config.stdout.golden
index 101d5847e4..94dc07ed96 100644
--- a/tests/snapshots/TestCLICommands_Valid_log_file_in_flag_should_be_priortized_over_env_and_config.stdout.golden
+++ b/tests/snapshots/TestCLICommands_Valid_log_file_in_flag_should_be_priortized_over_env_and_config.stdout.golden
@@ -5,7 +5,6 @@ DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**
 DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Found ENV var ATMOS_LOGS_FILE=/dev/stderr
-DEBU Found ENV var ATMOS_LOGS_LEVEL=Debug
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
 DEBU Using command line argument '--logs-level=Debug'
 DEBU Using command line argument '--logs-file=/dev/stdout'

From 1858c2bb4d93152821793acc40cded962d147a1e Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Sat, 22 Feb 2025 02:33:52 +0200
Subject: [PATCH 18/83] update snapshots Valid_Log_Level

---
 .../TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden
index 68edbe55de..d2c242ae37 100644
--- a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden
+++ b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden
@@ -4,6 +4,5 @@ DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures
 DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d' + '**/*.yaml')"
 DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU Found ENV var ATMOS_LOGS_LEVEL=Debug
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
 DEBU processStoreConfig atmosConfig.StoresConfig=map[]

From daaa03c78739ec057109a21453192d39cca28d29 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Sat, 22 Feb 2025 02:45:55 +0200
Subject: [PATCH 19/83] remove //nolint:revive

---
 pkg/config/imports.go | 11 -----------
 pkg/config/load.go    |  7 -------
 2 files changed, 18 deletions(-)

diff --git a/pkg/config/imports.go b/pkg/config/imports.go
index 41cab680e1..c6eb7eaf66 100644
--- a/pkg/config/imports.go
+++ b/pkg/config/imports.go
@@ -63,11 +63,9 @@ func processConfigImports(source *schema.AtmosConfiguration, dst *viper.Viper) e
 		for _, resolvedPath := range resolvedPaths {
 			err := MergeConfigFile(resolvedPath.filePath, dst)
 			if err != nil {
-				//nolint:revive
 				log.Debug("error loading config file", "import", resolvedPath.importPaths, "file_path", resolvedPath.filePath, "error", err)
 				continue
 			}
-			//nolint:revive
 			log.Debug("atmos merged config from import", "import", resolvedPath.importPaths, "file_path", resolvedPath.filePath)
 		}
 	}
@@ -98,7 +96,6 @@ func processImports(basePath string, importPaths []string, tempDir string, curre
 			// Handle remote imports
 			paths, err := processRemoteImport(basePath, importPath, tempDir, currentDepth, maxDepth)
 			if err != nil {
-				//nolint:revive
 				log.Debug("failed to process remote import", "path", importPath, "error", err)
 				continue
 			}
@@ -107,7 +104,6 @@ func processImports(basePath string, importPaths []string, tempDir string, curre
 			// Handle local imports
 			paths, err := processLocalImport(basePath, importPath, tempDir, currentDepth, maxDepth)
 			if err != nil {
-				//nolint:revive
 				log.Debug("failed to process local import", "path", importPath, "error", err)
 				continue
 			}
@@ -138,7 +134,6 @@ func processRemoteImport(basePath, importPath, tempDir string, currentDepth, max
 	v.SetConfigFile(tempFile)
 	err = v.ReadInConfig()
 	if err != nil {
-		//nolint:revive
 		log.Debug("failed to read remote config", "path", importPath, "error", err)
 		return nil, fmt.Errorf("failed to read remote config")
 	}
@@ -159,7 +154,6 @@ func processRemoteImport(basePath, importPath, tempDir string, currentDepth, max
 	if Imports != nil && len(Imports) > 0 {
 		nestedPaths, err := processImports(importBasePath, Imports, tempDir, currentDepth+1, maxDepth)
 		if err != nil {
-			//nolint:revive
 			log.Debug("failed to process nested imports", "import", importPath, "err", err)
 			return nil, fmt.Errorf("failed to process nested imports")
 		}
@@ -185,7 +179,6 @@ func processLocalImport(basePath string, importPath, tempDir string, currentDept
 	}
 	paths, err := SearchAtmosConfig(importPath)
 	if err != nil {
-		//nolint:revive
 		log.Debug("failed to resolve local import path", "path", importPath, "err", err)
 		return nil, ErrResolveLocal
 	}
@@ -198,7 +191,6 @@ func processLocalImport(basePath string, importPath, tempDir string, currentDept
 		v.SetConfigType("yaml")
 		err := v.ReadInConfig()
 		if err != nil {
-			//nolint:revive
 			log.Debug("failed to load local config", "path", path, "error", err)
 			continue
 		}
@@ -217,7 +209,6 @@ func processLocalImport(basePath string, importPath, tempDir string, currentDept
 		if Imports != nil {
 			nestedPaths, err := processImports(importBasePath, Imports, tempDir, currentDepth+1, maxDepth)
 			if err != nil {
-				//nolint:revive
 				log.Debug("failed to process nested imports from", "path", path, "error", err)
 				continue
 			}
@@ -291,7 +282,6 @@ func convertToAbsolutePaths(filePaths []string) ([]string, error) {
 	for _, path := range filePaths {
 		absPath, err := filepath.Abs(path)
 		if err != nil {
-			//nolint:revive
 			log.Debug("Error getting absolute path for file", "path", path, "error", err)
 			continue
 		}
@@ -382,7 +372,6 @@ func findMatchingFiles(patterns []string) ([]string, error) {
 	for _, pattern := range patterns {
 		matches, err := u.GetGlobMatches(pattern)
 		if err != nil {
-			//nolint:revive
 			log.Debug("Error getting glob matches for path", "path", pattern, "error", err)
 			continue
 		}
diff --git a/pkg/config/load.go b/pkg/config/load.go
index abaf84aae6..081e0aa7f5 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -166,7 +166,6 @@ func readEnvAmosConfigPath(v *viper.Viper) error {
 	if err != nil {
 		switch err.(type) {
 		case viper.ConfigFileNotFoundError:
-			//nolint:revive
 			log.Debug("config not found ENV var ATMOS_CLI_CONFIG_PATH", "file", configFilePath)
 			return nil
 		default:
@@ -185,7 +184,6 @@ func readAtmosConfigCli(v *viper.Viper, atmosCliConfigPath string) error {
 	err := mergeConfig(v, atmosCliConfigPath, CliConfigFileName, true)
 	switch err.(type) {
 	case viper.ConfigFileNotFoundError:
-		//nolint:revive
 		log.Debug("config not found", "file", atmosCliConfigPath)
 	default:
 		return err
@@ -206,11 +204,9 @@ func mergeConfig(v *viper.Viper, path string, fileName string, processImports bo
 		return nil
 	}
 	if err := mergeDefaultImports(path, v); err != nil {
-		//nolint:revive
 		log.Debug("error process imports", "path", path, "error", err)
 	}
 	if err := mergeImports(v); err != nil {
-		//nolint:revive
 		log.Debug("error process imports", "file", v.ConfigFileUsed(), "error", err)
 	}
 	return nil
@@ -240,7 +236,6 @@ func mergeDefaultImports(dirPath string, dst *viper.Viper) error {
 	searchDir = filepath.Join(filepath.FromSlash(dirPath), ".atmos.d/**/*")
 	foundPaths2, err := SearchAtmosConfig(searchDir)
 	if err != nil {
-		//nolint:revive
 		log.Debug("Failed to find atmos config file", "path", searchDir, "error", err)
 	}
 	if len(foundPaths2) > 0 {
@@ -249,11 +244,9 @@ func mergeDefaultImports(dirPath string, dst *viper.Viper) error {
 	for _, filePath := range atmosFoundFilePaths {
 		err := MergeConfigFile(filePath, dst)
 		if err != nil {
-			//nolint:revive
 			log.Debug("error loading config file", "path", filePath, "error", err)
 			continue
 		}
-		//nolint:revive
 		log.Debug("atmos merged config", "path", filePath)
 
 	}

From c0db06628e14100968e17badebd5e73a9de2a455 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Sat, 22 Feb 2025 03:02:59 +0200
Subject: [PATCH 20/83] Exclude any line containing "log."

---
 .golangci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.golangci.yml b/.golangci.yml
index 719177c636..94c30c38f6 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -114,7 +114,7 @@ linters-settings:
       - name: comment-spacings
         severity: warning
         disabled: false
-        exclude: [""]
+        exclude: ["log.Debug", "log.Error", "Warn"] # Exclude any line containing ["log.Debug", "log.Error", "Warn"] from Revive checks
         arguments:
           - mypragma
           - otherpragma

From 8920e568cb03b0dde61b3acef58e3d4064fa5993 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Sat, 22 Feb 2025 04:29:42 +0200
Subject: [PATCH 21/83] fix lint revive.add-constant

---
 .golangci.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.golangci.yml b/.golangci.yml
index 94c30c38f6..907b537b47 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -104,7 +104,7 @@ linters-settings:
       - name: add-constant
         arguments:
           - maxLitCount: "3"
-            allowStrs: '""'
+            allowStrs: '"", "error", "path"'
             allowInts: "0,1,2,3,4"
             allowFloats: "0.0,0.,1.0,1.,2.0,2."
       - name: argument-limit
@@ -114,7 +114,7 @@ linters-settings:
       - name: comment-spacings
         severity: warning
         disabled: false
-        exclude: ["log.Debug", "log.Error", "Warn"] # Exclude any line containing ["log.Debug", "log.Error", "Warn"] from Revive checks
+        exclude: []
         arguments:
           - mypragma
           - otherpragma

From 09fe32dad412a92228a6989088c241b8b0fcd646 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Sat, 22 Feb 2025 04:41:32 +0200
Subject: [PATCH 22/83] update add-constant to include "error","path"

---
 .golangci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.golangci.yml b/.golangci.yml
index 907b537b47..cb5865b8c8 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -104,7 +104,7 @@ linters-settings:
       - name: add-constant
         arguments:
           - maxLitCount: "3"
-            allowStrs: '"", "error", "path"'
+            allowStrs: '"","error","path"'
             allowInts: "0,1,2,3,4"
             allowFloats: "0.0,0.,1.0,1.,2.0,2."
       - name: argument-limit

From e4b6f24f05168a732643fa071e8402e565d6a190 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Sat, 22 Feb 2025 05:02:14 +0200
Subject: [PATCH 23/83] improve code lint

---
 pkg/config/config.go  |  2 +-
 pkg/config/imports.go |  6 +++---
 pkg/config/load.go    | 29 ++++++++++++++---------------
 3 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/pkg/config/config.go b/pkg/config/config.go
index 98e088a478..764bc5e2c5 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -15,7 +15,7 @@ import (
 // https://dev.to/techschoolguru/load-config-from-file-environment-variables-in-golang-with-viper-2j2d
 // https://medium.com/@bnprashanth256/reading-configuration-files-and-environment-variables-in-go-golang-c2607f912b63
 func InitCliConfig(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks bool) (schema.AtmosConfiguration, error) {
-	atmosConfig, err := LoadConfig(configAndStacksInfo)
+	atmosConfig, err := LoadConfig(&configAndStacksInfo)
 	if err != nil {
 		return atmosConfig, err
 	}
diff --git a/pkg/config/imports.go b/pkg/config/imports.go
index c6eb7eaf66..f79c2948b5 100644
--- a/pkg/config/imports.go
+++ b/pkg/config/imports.go
@@ -199,15 +199,15 @@ func processLocalImport(basePath string, importPath, tempDir string, currentDept
 			importPaths: importPath,
 			importType:  LOCAL,
 		})
-		Imports := v.GetStringSlice("import")
+		imports := v.GetStringSlice("import")
 		importBasePath := v.GetString("base_path")
 		if importBasePath == "" {
 			importBasePath = basePath
 		}
 
 		// Recursively process imports from the local file
-		if Imports != nil {
-			nestedPaths, err := processImports(importBasePath, Imports, tempDir, currentDepth+1, maxDepth)
+		if imports != nil {
+			nestedPaths, err := processImports(importBasePath, imports, tempDir, currentDepth+1, maxDepth)
 			if err != nil {
 				log.Debug("failed to process nested imports from", "path", path, "error", err)
 				continue
diff --git a/pkg/config/load.go b/pkg/config/load.go
index 081e0aa7f5..406cc1916f 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -6,7 +6,7 @@ import (
 	"path/filepath"
 	"runtime"
 
-	"github.com/charmbracelet/log"
+	log "github.com/charmbracelet/log"
 	"github.com/cloudposse/atmos/pkg/schema"
 	"github.com/cloudposse/atmos/pkg/version"
 	"github.com/mitchellh/go-homedir"
@@ -15,13 +15,13 @@ import (
 
 const MaximumImportLvL = 10
 
-// LoadConfig atmosConfig is loaded from the following locations (from lower to higher priority):
-// system dir (`/usr/local/etc/atmos` on Linux, `%LOCALAPPDATA%/atmos` on Windows)
-// home dir (~/.atmos)
-// current directory
-// ENV vars
-// Command-line arguments
-func LoadConfig(configAndStacksInfo schema.ConfigAndStacksInfo) (schema.AtmosConfiguration, error) {
+// LoadConfig atmosConfig is loaded from the following locations (from lower to higher priority).
+// System dir (`/usr/local/etc/atmos` on Linux, `%LOCALAPPDATA%/atmos` on Windows).
+// Home dir (~/.atmos).
+// Current directory.
+// ENV vars.
+// Command-line arguments.
+func LoadConfig(configAndStacksInfo *schema.ConfigAndStacksInfo) (schema.AtmosConfiguration, error) {
 	v := viper.New()
 	var atmosConfig schema.AtmosConfiguration
 	v.SetConfigType("yaml")
@@ -94,7 +94,7 @@ func loadConfigSources(v *viper.Viper, cliConfigPath string) error {
 	return readAtmosConfigCli(v, cliConfigPath)
 }
 
-// readSystemConfig load config from system dir
+// readSystemConfig load config from system dir .
 func readSystemConfig(v *viper.Viper) error {
 	configFilePath := ""
 	if runtime.GOOS == "windows" {
@@ -118,7 +118,7 @@ func readSystemConfig(v *viper.Viper) error {
 	return nil
 }
 
-// readHomeConfig load config from user's HOME dir
+// readHomeConfig load config from user's HOME dir .
 func readHomeConfig(v *viper.Viper) error {
 	home, err := homedir.Dir()
 	if err != nil {
@@ -138,7 +138,7 @@ func readHomeConfig(v *viper.Viper) error {
 	return nil
 }
 
-// readWorkDirConfig load config from current working directory
+// readWorkDirConfig load config from current working directory .
 func readWorkDirConfig(v *viper.Viper) error {
 	wd, err := os.Getwd()
 	if err != nil {
@@ -192,7 +192,7 @@ func readAtmosConfigCli(v *viper.Viper, atmosCliConfigPath string) error {
 	return nil
 }
 
-// mergeConfig merge config from a specified path and process imports.return error if config file not exist
+// mergeConfig merge config from a specified path and process imports.return error if config file not exist .
 func mergeConfig(v *viper.Viper, path string, fileName string, processImports bool) error {
 	v.AddConfigPath(path)
 	v.SetConfigName(fileName)
@@ -224,7 +224,7 @@ func mergeDefaultImports(dirPath string, dst *viper.Viper) error {
 	}
 	var atmosFoundFilePaths []string
 	// Search for `atmos.d/` configurations
-	searchDir := filepath.Join(filepath.FromSlash(dirPath), "atmos.d/**/*")
+	searchDir := filepath.Join(filepath.FromSlash(dirPath), filepath.Join("atmos.d", "**", "*"))
 	foundPaths1, err := SearchAtmosConfig(searchDir)
 	if err != nil {
 		log.Debug("Failed to find atmos config file", "path", searchDir, "error", err)
@@ -233,7 +233,7 @@ func mergeDefaultImports(dirPath string, dst *viper.Viper) error {
 		atmosFoundFilePaths = append(atmosFoundFilePaths, foundPaths1...)
 	}
 	// Search for `.atmos.d` configurations
-	searchDir = filepath.Join(filepath.FromSlash(dirPath), ".atmos.d/**/*")
+	searchDir = filepath.Join(filepath.FromSlash(dirPath), filepath.Join(".atmos.d", "**", "*"))
 	foundPaths2, err := SearchAtmosConfig(searchDir)
 	if err != nil {
 		log.Debug("Failed to find atmos config file", "path", searchDir, "error", err)
@@ -248,7 +248,6 @@ func mergeDefaultImports(dirPath string, dst *viper.Viper) error {
 			continue
 		}
 		log.Debug("atmos merged config", "path", filePath)
-
 	}
 	return nil
 }

From da8006ab8db1f405a0446414c1c8cf2c84048319 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Sat, 22 Feb 2025 05:10:02 +0200
Subject: [PATCH 24/83] improve log

---
 pkg/config/imports.go | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pkg/config/imports.go b/pkg/config/imports.go
index f79c2948b5..385ef1d0f0 100644
--- a/pkg/config/imports.go
+++ b/pkg/config/imports.go
@@ -19,7 +19,7 @@ import (
 )
 
 var (
-	ErrBasePath     = errors.New("base_path required to process imports")
+	ErrBasePath     = errors.New("basePath required to process imports")
 	ErrTempDir      = errors.New("tempDir required to process imports")
 	ErrResolveLocal = errors.New("failed to resolve local import path")
 )
@@ -237,14 +237,14 @@ func SearchAtmosConfig(path string) ([]string, error) {
 		return nil, fmt.Errorf("failed to find matching files: %w", err)
 	}
 	// Convert paths to absolute paths
-	atmosFilePathsABS, err := convertToAbsolutePaths(atmosFilePaths)
+	atmosFilePathsAbsolute, err := convertToAbsolutePaths(atmosFilePaths)
 	if err != nil {
 		return nil, fmt.Errorf("failed to convert paths to absolute paths: %w", err)
 	}
 	// Prioritize and sort files
-	atmosFilePathsABS = detectPriorityFiles(atmosFilePathsABS)
-	atmosFilePathsABS = sortFilesByDepth(atmosFilePathsABS)
-	return atmosFilePathsABS, nil
+	atmosFilePathsAbsolute = detectPriorityFiles(atmosFilePathsAbsolute)
+	atmosFilePathsAbsolute = sortFilesByDepth(atmosFilePathsAbsolute)
+	return atmosFilePathsAbsolute, nil
 }
 
 // Helper function to generate search patterns for extension yaml,yml

From 54bb9944f4d6027f5cdea822771777c3ef3bd1a5 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Sun, 23 Feb 2025 03:59:43 +0200
Subject: [PATCH 25/83] improve log charmbracelet aliased

---
 pkg/config/imports.go | 50 ++++++++++++++++++++-----------------------
 pkg/config/load.go    | 26 +++++++++++-----------
 2 files changed, 36 insertions(+), 40 deletions(-)

diff --git a/pkg/config/imports.go b/pkg/config/imports.go
index 385ef1d0f0..30fce54025 100644
--- a/pkg/config/imports.go
+++ b/pkg/config/imports.go
@@ -10,7 +10,7 @@ import (
 	"strings"
 	"time"
 
-	"github.com/charmbracelet/log"
+	clog "github.com/charmbracelet/log"
 	"github.com/cloudposse/atmos/pkg/schema"
 	u "github.com/cloudposse/atmos/pkg/utils"
 	"github.com/hashicorp/go-getter"
@@ -63,10 +63,10 @@ func processConfigImports(source *schema.AtmosConfiguration, dst *viper.Viper) e
 		for _, resolvedPath := range resolvedPaths {
 			err := MergeConfigFile(resolvedPath.filePath, dst)
 			if err != nil {
-				log.Debug("error loading config file", "import", resolvedPath.importPaths, "file_path", resolvedPath.filePath, "error", err)
+				clog.Debug("error loading config file", "import", resolvedPath.importPaths, "file_path", resolvedPath.filePath, "error", err)
 				continue
 			}
-			log.Debug("atmos merged config from import", "import", resolvedPath.importPaths, "file_path", resolvedPath.filePath)
+			clog.Debug("atmos merged config from import", "import", resolvedPath.importPaths, "file_path", resolvedPath.filePath)
 		}
 	}
 	return nil
@@ -96,7 +96,7 @@ func processImports(basePath string, importPaths []string, tempDir string, curre
 			// Handle remote imports
 			paths, err := processRemoteImport(basePath, importPath, tempDir, currentDepth, maxDepth)
 			if err != nil {
-				log.Debug("failed to process remote import", "path", importPath, "error", err)
+				clog.Debug("failed to process remote import", "path", importPath, "error", err)
 				continue
 			}
 			resolvedPaths = append(resolvedPaths, paths...)
@@ -104,7 +104,7 @@ func processImports(basePath string, importPaths []string, tempDir string, curre
 			// Handle local imports
 			paths, err := processLocalImport(basePath, importPath, tempDir, currentDepth, maxDepth)
 			if err != nil {
-				log.Debug("failed to process local import", "path", importPath, "error", err)
+				clog.Debug("failed to process local import", "path", importPath, "error", err)
 				continue
 			}
 			resolvedPaths = append(resolvedPaths, paths...)
@@ -134,7 +134,7 @@ func processRemoteImport(basePath, importPath, tempDir string, currentDepth, max
 	v.SetConfigFile(tempFile)
 	err = v.ReadInConfig()
 	if err != nil {
-		log.Debug("failed to read remote config", "path", importPath, "error", err)
+		clog.Debug("failed to read remote config", "path", importPath, "error", err)
 		return nil, fmt.Errorf("failed to read remote config")
 	}
 
@@ -144,17 +144,17 @@ func processRemoteImport(basePath, importPath, tempDir string, currentDepth, max
 		importPaths: importPath,
 		importType:  REMOTE,
 	})
-	Imports := v.GetStringSlice("import")
+	imports := v.GetStringSlice("import")
 	importBasePath := v.GetString("base_path")
 	if importBasePath == "" {
 		importBasePath = basePath
 	}
 
 	// Recursively process imports from the remote file
-	if Imports != nil && len(Imports) > 0 {
-		nestedPaths, err := processImports(importBasePath, Imports, tempDir, currentDepth+1, maxDepth)
+	if len(imports) > 0 {
+		nestedPaths, err := processImports(importBasePath, imports, tempDir, currentDepth+1, maxDepth)
 		if err != nil {
-			log.Debug("failed to process nested imports", "import", importPath, "err", err)
+			clog.Debug("failed to process nested imports", "import", importPath, "err", err)
 			return nil, fmt.Errorf("failed to process nested imports")
 		}
 		resolvedPaths = append(resolvedPaths, nestedPaths...)
@@ -172,14 +172,14 @@ func processLocalImport(basePath string, importPath, tempDir string, currentDept
 		importPath = filepath.Join(basePath, importPath)
 	}
 	if !strings.HasPrefix(filepath.Clean(importPath), filepath.Clean(basePath)) {
-		log.Warn("Import path is outside of base directory",
+		clog.Warn("Import path is outside of base directory",
 			"importPath", importPath,
 			"basePath", basePath,
 		)
 	}
 	paths, err := SearchAtmosConfig(importPath)
 	if err != nil {
-		log.Debug("failed to resolve local import path", "path", importPath, "err", err)
+		clog.Debug("failed to resolve local import path", "path", importPath, "err", err)
 		return nil, ErrResolveLocal
 	}
 
@@ -191,7 +191,7 @@ func processLocalImport(basePath string, importPath, tempDir string, currentDept
 		v.SetConfigType("yaml")
 		err := v.ReadInConfig()
 		if err != nil {
-			log.Debug("failed to load local config", "path", path, "error", err)
+			clog.Debug("failed to load local config", "path", path, "error", err)
 			continue
 		}
 		resolvedPaths = append(resolvedPaths, ResolvedPaths{
@@ -206,10 +206,10 @@ func processLocalImport(basePath string, importPath, tempDir string, currentDept
 		}
 
 		// Recursively process imports from the local file
-		if imports != nil {
+		if len(imports) > 0 {
 			nestedPaths, err := processImports(importBasePath, imports, tempDir, currentDepth+1, maxDepth)
 			if err != nil {
-				log.Debug("failed to process nested imports from", "path", path, "error", err)
+				clog.Debug("failed to process nested imports from", "path", path, "error", err)
 				continue
 			}
 			resolvedPaths = append(resolvedPaths, nestedPaths...)
@@ -227,10 +227,8 @@ func SearchAtmosConfig(path string) ([]string, error) {
 		}
 	}
 	// Generate patterns based on whether path is a directory or a file/pattern
-	patterns, err := generatePatterns(path)
-	if err != nil {
-		return nil, fmt.Errorf("failed to generate search patterns: %w", err)
-	}
+	patterns := generatePatterns(path)
+
 	// Find files matching the patterns
 	atmosFilePaths, err := findMatchingFiles(patterns)
 	if err != nil {
@@ -248,7 +246,7 @@ func SearchAtmosConfig(path string) ([]string, error) {
 }
 
 // Helper function to generate search patterns for extension yaml,yml
-func generatePatterns(path string) ([]string, error) {
+func generatePatterns(path string) []string {
 	isDir := false
 	if stat, err := os.Stat(path); err == nil && stat.IsDir() {
 		isDir = true
@@ -259,7 +257,7 @@ func generatePatterns(path string) ([]string, error) {
 			filepath.Join(path, "**", "*.yaml"),
 			filepath.Join(path, "**", "*.yml"),
 		}
-		return patterns, nil
+		return patterns
 	}
 	ext := filepath.Ext(path)
 	if ext == "" {
@@ -268,12 +266,10 @@ func generatePatterns(path string) ([]string, error) {
 			path + ".yaml",
 			path + ".yml",
 		}
-		return patterns, nil
+		return patterns
 	}
 	// If extension is present, use the path as-is
-	patterns := []string{path}
-
-	return patterns, nil
+	return []string{path}
 }
 
 // Helper function to convert paths to absolute paths
@@ -282,7 +278,7 @@ func convertToAbsolutePaths(filePaths []string) ([]string, error) {
 	for _, path := range filePaths {
 		absPath, err := filepath.Abs(path)
 		if err != nil {
-			log.Debug("Error getting absolute path for file", "path", path, "error", err)
+			clog.Debug("Error getting absolute path for file", "path", path, "error", err)
 			continue
 		}
 		absPaths = append(absPaths, absPath)
@@ -372,7 +368,7 @@ func findMatchingFiles(patterns []string) ([]string, error) {
 	for _, pattern := range patterns {
 		matches, err := u.GetGlobMatches(pattern)
 		if err != nil {
-			log.Debug("Error getting glob matches for path", "path", pattern, "error", err)
+			clog.Debug("Error getting glob matches for path", "path", pattern, "error", err)
 			continue
 		}
 		filePaths = append(filePaths, matches...)
diff --git a/pkg/config/load.go b/pkg/config/load.go
index 406cc1916f..4506a70510 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -6,7 +6,7 @@ import (
 	"path/filepath"
 	"runtime"
 
-	log "github.com/charmbracelet/log"
+	clog "github.com/charmbracelet/log"
 	"github.com/cloudposse/atmos/pkg/schema"
 	"github.com/cloudposse/atmos/pkg/version"
 	"github.com/mitchellh/go-homedir"
@@ -33,9 +33,9 @@ func LoadConfig(configAndStacksInfo *schema.ConfigAndStacksInfo) (schema.AtmosCo
 	}
 	// If no config file is used, fall back to the default CLI config.
 	if v.ConfigFileUsed() == "" {
-		log.Debug("'atmos.yaml' CLI config was not found", "paths", "system dir, home dir, current dir, ENV vars")
-		log.Debug("Refer to https://atmos.tools/cli/configuration for details on how to configure 'atmos.yaml'")
-		log.Debug("Using the default CLI config")
+		clog.Debug("'atmos.yaml' CLI config was not found", "paths", "system dir, home dir, current dir, ENV vars")
+		clog.Debug("Refer to https://atmos.tools/cli/configuration for details on how to configure 'atmos.yaml'")
+		clog.Debug("Using the default CLI config")
 
 		if err := mergeDefaultConfig(v); err != nil {
 			return atmosConfig, err
@@ -166,13 +166,13 @@ func readEnvAmosConfigPath(v *viper.Viper) error {
 	if err != nil {
 		switch err.(type) {
 		case viper.ConfigFileNotFoundError:
-			log.Debug("config not found ENV var ATMOS_CLI_CONFIG_PATH", "file", configFilePath)
+			clog.Debug("config not found ENV var ATMOS_CLI_CONFIG_PATH", "file", configFilePath)
 			return nil
 		default:
 			return err
 		}
 	}
-	log.Debug("Found config ENV", "ATMOS_CLI_CONFIG_PATH", configFilePath)
+	clog.Debug("Found config ENV", "ATMOS_CLI_CONFIG_PATH", configFilePath)
 
 	return nil
 }
@@ -184,7 +184,7 @@ func readAtmosConfigCli(v *viper.Viper, atmosCliConfigPath string) error {
 	err := mergeConfig(v, atmosCliConfigPath, CliConfigFileName, true)
 	switch err.(type) {
 	case viper.ConfigFileNotFoundError:
-		log.Debug("config not found", "file", atmosCliConfigPath)
+		clog.Debug("config not found", "file", atmosCliConfigPath)
 	default:
 		return err
 	}
@@ -204,10 +204,10 @@ func mergeConfig(v *viper.Viper, path string, fileName string, processImports bo
 		return nil
 	}
 	if err := mergeDefaultImports(path, v); err != nil {
-		log.Debug("error process imports", "path", path, "error", err)
+		clog.Debug("error process imports", "path", path, "error", err)
 	}
 	if err := mergeImports(v); err != nil {
-		log.Debug("error process imports", "file", v.ConfigFileUsed(), "error", err)
+		clog.Debug("error process imports", "file", v.ConfigFileUsed(), "error", err)
 	}
 	return nil
 }
@@ -227,7 +227,7 @@ func mergeDefaultImports(dirPath string, dst *viper.Viper) error {
 	searchDir := filepath.Join(filepath.FromSlash(dirPath), filepath.Join("atmos.d", "**", "*"))
 	foundPaths1, err := SearchAtmosConfig(searchDir)
 	if err != nil {
-		log.Debug("Failed to find atmos config file", "path", searchDir, "error", err)
+		clog.Debug("Failed to find atmos config file", "path", searchDir, "error", err)
 	}
 	if len(foundPaths1) > 0 {
 		atmosFoundFilePaths = append(atmosFoundFilePaths, foundPaths1...)
@@ -236,7 +236,7 @@ func mergeDefaultImports(dirPath string, dst *viper.Viper) error {
 	searchDir = filepath.Join(filepath.FromSlash(dirPath), filepath.Join(".atmos.d", "**", "*"))
 	foundPaths2, err := SearchAtmosConfig(searchDir)
 	if err != nil {
-		log.Debug("Failed to find atmos config file", "path", searchDir, "error", err)
+		clog.Debug("Failed to find atmos config file", "path", searchDir, "error", err)
 	}
 	if len(foundPaths2) > 0 {
 		atmosFoundFilePaths = append(atmosFoundFilePaths, foundPaths2...)
@@ -244,10 +244,10 @@ func mergeDefaultImports(dirPath string, dst *viper.Viper) error {
 	for _, filePath := range atmosFoundFilePaths {
 		err := MergeConfigFile(filePath, dst)
 		if err != nil {
-			log.Debug("error loading config file", "path", filePath, "error", err)
+			clog.Debug("error loading config file", "path", filePath, "error", err)
 			continue
 		}
-		log.Debug("atmos merged config", "path", filePath)
+		clog.Debug("atmos merged config", "path", filePath)
 	}
 	return nil
 }

From 36ab8e8bb5d9d26bf43a1378a5b14539739b27e2 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Mon, 24 Feb 2025 18:22:07 +0200
Subject: [PATCH 26/83] Preprocess  Atmos config with custom functions

---
 pkg/config/imports.go |  2 +-
 pkg/config/load.go    | 88 ++++++++++++++++++++++++++++++++++++++++++-
 pkg/config/utils.go   |  8 +++-
 3 files changed, 94 insertions(+), 4 deletions(-)

diff --git a/pkg/config/imports.go b/pkg/config/imports.go
index 30fce54025..e4d8fcc0f9 100644
--- a/pkg/config/imports.go
+++ b/pkg/config/imports.go
@@ -61,7 +61,7 @@ func processConfigImports(source *schema.AtmosConfiguration, dst *viper.Viper) e
 		}
 
 		for _, resolvedPath := range resolvedPaths {
-			err := MergeConfigFile(resolvedPath.filePath, dst)
+			err := mergeConfigFile(resolvedPath.filePath, dst)
 			if err != nil {
 				clog.Debug("error loading config file", "import", resolvedPath.importPaths, "file_path", resolvedPath.filePath, "error", err)
 				continue
diff --git a/pkg/config/load.go b/pkg/config/load.go
index 4506a70510..1b9c7803bb 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -11,6 +11,7 @@ import (
 	"github.com/cloudposse/atmos/pkg/version"
 	"github.com/mitchellh/go-homedir"
 	"github.com/spf13/viper"
+	"gopkg.in/yaml.v3"
 )
 
 const MaximumImportLvL = 10
@@ -200,6 +201,15 @@ func mergeConfig(v *viper.Viper, path string, fileName string, processImports bo
 	if err != nil {
 		return err
 	}
+	content, err := os.ReadFile(v.ConfigFileUsed())
+	if err != nil {
+		return err
+	}
+	err = preprocessAtmosYamlFunc(content, v)
+	if err != nil {
+		return err
+	}
+
 	if !processImports {
 		return nil
 	}
@@ -242,7 +252,7 @@ func mergeDefaultImports(dirPath string, dst *viper.Viper) error {
 		atmosFoundFilePaths = append(atmosFoundFilePaths, foundPaths2...)
 	}
 	for _, filePath := range atmosFoundFilePaths {
-		err := MergeConfigFile(filePath, dst)
+		err := mergeConfigFile(filePath, dst)
 		if err != nil {
 			clog.Debug("error loading config file", "path", filePath, "error", err)
 			continue
@@ -264,3 +274,79 @@ func mergeImports(dst *viper.Viper) error {
 	}
 	return nil
 }
+
+// PreprocessYAML processes the given YAML content, replacing specific directives
+// (such as !env) with their corresponding values .
+// It parses the YAML content into a tree structure, processes each node recursively,
+// and updates the provided Viper instance with resolved values.
+//
+// Parameters:
+// - yamlContent: The raw YAML content as a byte slice.
+// - v: A pointer to a Viper instance where processed values will be stored.
+//
+// Returns:
+// - An error if the YAML content cannot be parsed.
+func preprocessAtmosYamlFunc(yamlContent []byte, v *viper.Viper) error {
+	var rootNode yaml.Node
+	if err := yaml.Unmarshal(yamlContent, &rootNode); err != nil {
+		return fmt.Errorf("failed to parse YAML: %v", err)
+	}
+	processNode(&rootNode, v, "")
+	return nil
+}
+
+// processNode recursively traverses a YAML node tree and processes special directives
+// (such as !env). If a directive is found, it replaces the corresponding value in Viper
+// using values retrieved from Atmos custom functions.
+//
+// Parameters:
+// - node: A pointer to the current YAML node being processed.
+// - v: A pointer to a Viper instance where processed values will be stored.
+// - currentPath: The hierarchical key path used to track nested YAML structures.
+func processNode(node *yaml.Node, v *viper.Viper, currentPath string) {
+	if node == nil {
+		return
+	}
+
+	var AllowedDirectives = []string{AtmosYamlFuncEnv}
+
+	// If this node is a key-value pair in a mapping
+	if node.Kind == yaml.MappingNode {
+		for i := 0; i < len(node.Content); i += 2 {
+			keyNode := node.Content[i]
+			valueNode := node.Content[i+1]
+			newPath := keyNode.Value // Extracting the key name
+
+			if currentPath != "" {
+				newPath = currentPath + "." + newPath
+			}
+
+			processNode(valueNode, v, newPath)
+		}
+	}
+
+	// If it's a scalar node with a directive tag
+	if node.Kind == yaml.ScalarNode && node.Tag != "" {
+		for _, directive := range AllowedDirectives {
+			if node.Tag == directive {
+				arg := node.Value
+				switch directive {
+				case "!env":
+					envValue := os.Getenv(arg)
+					if envValue != "" {
+						node.Value = envValue
+					}
+					fmt.Println("Setting Viper key:", currentPath, "with value:", node.Value)
+					v.Set(currentPath, node.Value) // Store the value to Viper
+				}
+				node.Tag = ""
+				break
+			}
+		}
+	}
+
+	// Process children nodes (for sequences/lists)
+	for _, child := range node.Content {
+		processNode(child, v, currentPath)
+	}
+}
diff --git a/pkg/config/utils.go b/pkg/config/utils.go
index 5a31cbe061..c3291aa922 100644
--- a/pkg/config/utils.go
+++ b/pkg/config/utils.go
@@ -782,8 +782,8 @@ func SearchConfigFile(configPath string, atmosConfig schema.AtmosConfiguration)
 	return "", fmt.Errorf("failed to find a match for the import '%s' ('%s' + '%s')", configPath, dir, base)
 }
 
-// MergeConfigFile merges a new configuration file with an existing config into Viper.
-func MergeConfigFile(
+// mergeConfigFile merges a new configuration file with an existing config into Viper.
+func mergeConfigFile(
 	path string,
 	v *viper.Viper,
 ) error {
@@ -795,6 +795,10 @@ func MergeConfigFile(
 	if err != nil {
 		return err
 	}
+	err = preprocessAtmosYamlFunc(content, v)
+	if err != nil {
+		return err
+	}
 
 	return nil
 }

From e42aa946a9919ecb60bba0d44a8cdc8eaf543890 Mon Sep 17 00:00:00 2001
From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com>
Date: Mon, 24 Feb 2025 16:23:06 +0000
Subject: [PATCH 27/83] [autofix.ci] apply automated fixes

---
 pkg/config/load.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg/config/load.go b/pkg/config/load.go
index 1b9c7803bb..7385ca6157 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -308,7 +308,7 @@ func processNode(node *yaml.Node, v *viper.Viper, currentPath string) {
 		return
 	}
 
-	var AllowedDirectives = []string{AtmosYamlFuncEnv}
+	AllowedDirectives := []string{AtmosYamlFuncEnv}
 
 	// If this node is a key-value pair in a mapping
 	if node.Kind == yaml.MappingNode {

From 19136b06750d97fbf2b4932adc82139210624dcc Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Mon, 24 Feb 2025 18:42:22 +0200
Subject: [PATCH 28/83] remove print line

---
 pkg/config/load.go | 1 -
 1 file changed, 1 deletion(-)

diff --git a/pkg/config/load.go b/pkg/config/load.go
index 7385ca6157..35ddca1d06 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -336,7 +336,6 @@ func processNode(node *yaml.Node, v *viper.Viper, currentPath string) {
 					if envValue != "" {
 						node.Value = envValue
 					}
-					fmt.Println("Setting Viper key:", currentPath, "with value:", node.Value)
 					v.Set(currentPath, node.Value) // Store the value to Viper
 				}
 				node.Tag = ""

From 0c95ad99c91075f8d51acda6dad6bf2cbdcf48b1 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Mon, 24 Feb 2025 19:25:48 +0200
Subject: [PATCH 29/83] improve logs

---
 pkg/config/imports.go                         | 30 +++++++--------
 pkg/config/load.go                            | 37 +++++++++----------
 .../atmos-cli-imports/configs.d/commands.yaml |  3 +-
 .../atmos.d/tools/helmfile.yml                |  3 --
 .../scenarios/atmos-configuration/atmos.yaml  |  2 -
 5 files changed, 34 insertions(+), 41 deletions(-)

diff --git a/pkg/config/imports.go b/pkg/config/imports.go
index e4d8fcc0f9..2b9f3b396f 100644
--- a/pkg/config/imports.go
+++ b/pkg/config/imports.go
@@ -10,7 +10,7 @@ import (
 	"strings"
 	"time"
 
-	clog "github.com/charmbracelet/log"
+	log "github.com/charmbracelet/log"
 	"github.com/cloudposse/atmos/pkg/schema"
 	u "github.com/cloudposse/atmos/pkg/utils"
 	"github.com/hashicorp/go-getter"
@@ -19,8 +19,8 @@ import (
 )
 
 var (
-	ErrBasePath     = errors.New("basePath required to process imports")
-	ErrTempDir      = errors.New("tempDir required to process imports")
+	ErrBasePath     = errors.New("base path required to process imports")
+	ErrTempDir      = errors.New("temporary directory required to process imports")
 	ErrResolveLocal = errors.New("failed to resolve local import path")
 )
 
@@ -63,10 +63,10 @@ func processConfigImports(source *schema.AtmosConfiguration, dst *viper.Viper) e
 		for _, resolvedPath := range resolvedPaths {
 			err := mergeConfigFile(resolvedPath.filePath, dst)
 			if err != nil {
-				clog.Debug("error loading config file", "import", resolvedPath.importPaths, "file_path", resolvedPath.filePath, "error", err)
+				log.Debug("error loading config file", "import", resolvedPath.importPaths, "file_path", resolvedPath.filePath, "error", err)
 				continue
 			}
-			clog.Debug("atmos merged config from import", "import", resolvedPath.importPaths, "file_path", resolvedPath.filePath)
+			log.Debug("merged config from import", "import", resolvedPath.importPaths, "file_path", resolvedPath.filePath)
 		}
 	}
 	return nil
@@ -96,7 +96,7 @@ func processImports(basePath string, importPaths []string, tempDir string, curre
 			// Handle remote imports
 			paths, err := processRemoteImport(basePath, importPath, tempDir, currentDepth, maxDepth)
 			if err != nil {
-				clog.Debug("failed to process remote import", "path", importPath, "error", err)
+				log.Debug("failed to process remote import", "path", importPath, "error", err)
 				continue
 			}
 			resolvedPaths = append(resolvedPaths, paths...)
@@ -104,7 +104,7 @@ func processImports(basePath string, importPaths []string, tempDir string, curre
 			// Handle local imports
 			paths, err := processLocalImport(basePath, importPath, tempDir, currentDepth, maxDepth)
 			if err != nil {
-				clog.Debug("failed to process local import", "path", importPath, "error", err)
+				log.Debug("failed to process local import", "path", importPath, "error", err)
 				continue
 			}
 			resolvedPaths = append(resolvedPaths, paths...)
@@ -134,7 +134,7 @@ func processRemoteImport(basePath, importPath, tempDir string, currentDepth, max
 	v.SetConfigFile(tempFile)
 	err = v.ReadInConfig()
 	if err != nil {
-		clog.Debug("failed to read remote config", "path", importPath, "error", err)
+		log.Debug("failed to read remote config", "path", importPath, "error", err)
 		return nil, fmt.Errorf("failed to read remote config")
 	}
 
@@ -154,7 +154,7 @@ func processRemoteImport(basePath, importPath, tempDir string, currentDepth, max
 	if len(imports) > 0 {
 		nestedPaths, err := processImports(importBasePath, imports, tempDir, currentDepth+1, maxDepth)
 		if err != nil {
-			clog.Debug("failed to process nested imports", "import", importPath, "err", err)
+			log.Debug("failed to process nested imports", "import", importPath, "err", err)
 			return nil, fmt.Errorf("failed to process nested imports")
 		}
 		resolvedPaths = append(resolvedPaths, nestedPaths...)
@@ -172,14 +172,14 @@ func processLocalImport(basePath string, importPath, tempDir string, currentDept
 		importPath = filepath.Join(basePath, importPath)
 	}
 	if !strings.HasPrefix(filepath.Clean(importPath), filepath.Clean(basePath)) {
-		clog.Warn("Import path is outside of base directory",
+		log.Warn("Import path is outside of base directory",
 			"importPath", importPath,
 			"basePath", basePath,
 		)
 	}
 	paths, err := SearchAtmosConfig(importPath)
 	if err != nil {
-		clog.Debug("failed to resolve local import path", "path", importPath, "err", err)
+		log.Debug("failed to resolve local import path", "path", importPath, "err", err)
 		return nil, ErrResolveLocal
 	}
 
@@ -191,7 +191,7 @@ func processLocalImport(basePath string, importPath, tempDir string, currentDept
 		v.SetConfigType("yaml")
 		err := v.ReadInConfig()
 		if err != nil {
-			clog.Debug("failed to load local config", "path", path, "error", err)
+			log.Debug("failed to load local config", "path", path, "error", err)
 			continue
 		}
 		resolvedPaths = append(resolvedPaths, ResolvedPaths{
@@ -209,7 +209,7 @@ func processLocalImport(basePath string, importPath, tempDir string, currentDept
 		if len(imports) > 0 {
 			nestedPaths, err := processImports(importBasePath, imports, tempDir, currentDepth+1, maxDepth)
 			if err != nil {
-				clog.Debug("failed to process nested imports from", "path", path, "error", err)
+				log.Debug("failed to process nested imports from", "path", path, "error", err)
 				continue
 			}
 			resolvedPaths = append(resolvedPaths, nestedPaths...)
@@ -278,7 +278,7 @@ func convertToAbsolutePaths(filePaths []string) ([]string, error) {
 	for _, path := range filePaths {
 		absPath, err := filepath.Abs(path)
 		if err != nil {
-			clog.Debug("Error getting absolute path for file", "path", path, "error", err)
+			log.Debug("Error getting absolute path for file", "path", path, "error", err)
 			continue
 		}
 		absPaths = append(absPaths, absPath)
@@ -368,7 +368,7 @@ func findMatchingFiles(patterns []string) ([]string, error) {
 	for _, pattern := range patterns {
 		matches, err := u.GetGlobMatches(pattern)
 		if err != nil {
-			clog.Debug("Error getting glob matches for path", "path", pattern, "error", err)
+			log.Debug("no matches found for glob pattern", "path", pattern, "error", err)
 			continue
 		}
 		filePaths = append(filePaths, matches...)
diff --git a/pkg/config/load.go b/pkg/config/load.go
index 35ddca1d06..ff74fb146c 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -6,7 +6,7 @@ import (
 	"path/filepath"
 	"runtime"
 
-	clog "github.com/charmbracelet/log"
+	log "github.com/charmbracelet/log"
 	"github.com/cloudposse/atmos/pkg/schema"
 	"github.com/cloudposse/atmos/pkg/version"
 	"github.com/mitchellh/go-homedir"
@@ -16,12 +16,11 @@ import (
 
 const MaximumImportLvL = 10
 
-// LoadConfig atmosConfig is loaded from the following locations (from lower to higher priority).
-// System dir (`/usr/local/etc/atmos` on Linux, `%LOCALAPPDATA%/atmos` on Windows).
-// Home dir (~/.atmos).
-// Current directory.
-// ENV vars.
-// Command-line arguments.
+// * System dir (`/usr/local/etc/atmos` on Linux, `%LOCALAPPDATA%/atmos` on Windows).
+// * Home directory (~/.atmos).
+// * Current working directory.
+// * ENV vars.
+// * Command-line arguments.
 func LoadConfig(configAndStacksInfo *schema.ConfigAndStacksInfo) (schema.AtmosConfiguration, error) {
 	v := viper.New()
 	var atmosConfig schema.AtmosConfiguration
@@ -34,9 +33,9 @@ func LoadConfig(configAndStacksInfo *schema.ConfigAndStacksInfo) (schema.AtmosCo
 	}
 	// If no config file is used, fall back to the default CLI config.
 	if v.ConfigFileUsed() == "" {
-		clog.Debug("'atmos.yaml' CLI config was not found", "paths", "system dir, home dir, current dir, ENV vars")
-		clog.Debug("Refer to https://atmos.tools/cli/configuration for details on how to configure 'atmos.yaml'")
-		clog.Debug("Using the default CLI config")
+		log.Debug("'atmos.yaml' CLI config was not found", "paths", "system dir, home dir, current dir, ENV vars")
+		log.Debug("Refer to https://atmos.tools/cli/configuration for details on how to configure 'atmos.yaml'")
+		log.Debug("Using the default CLI config")
 
 		if err := mergeDefaultConfig(v); err != nil {
 			return atmosConfig, err
@@ -167,13 +166,13 @@ func readEnvAmosConfigPath(v *viper.Viper) error {
 	if err != nil {
 		switch err.(type) {
 		case viper.ConfigFileNotFoundError:
-			clog.Debug("config not found ENV var ATMOS_CLI_CONFIG_PATH", "file", configFilePath)
+			log.Debug("config not found ENV var ATMOS_CLI_CONFIG_PATH", "file", configFilePath)
 			return nil
 		default:
 			return err
 		}
 	}
-	clog.Debug("Found config ENV", "ATMOS_CLI_CONFIG_PATH", configFilePath)
+	log.Debug("Found config ENV", "ATMOS_CLI_CONFIG_PATH", configFilePath)
 
 	return nil
 }
@@ -185,7 +184,7 @@ func readAtmosConfigCli(v *viper.Viper, atmosCliConfigPath string) error {
 	err := mergeConfig(v, atmosCliConfigPath, CliConfigFileName, true)
 	switch err.(type) {
 	case viper.ConfigFileNotFoundError:
-		clog.Debug("config not found", "file", atmosCliConfigPath)
+		log.Debug("config not found", "file", atmosCliConfigPath)
 	default:
 		return err
 	}
@@ -214,10 +213,10 @@ func mergeConfig(v *viper.Viper, path string, fileName string, processImports bo
 		return nil
 	}
 	if err := mergeDefaultImports(path, v); err != nil {
-		clog.Debug("error process imports", "path", path, "error", err)
+		log.Debug("error process imports", "path", path, "error", err)
 	}
 	if err := mergeImports(v); err != nil {
-		clog.Debug("error process imports", "file", v.ConfigFileUsed(), "error", err)
+		log.Debug("error process imports", "file", v.ConfigFileUsed(), "error", err)
 	}
 	return nil
 }
@@ -237,7 +236,7 @@ func mergeDefaultImports(dirPath string, dst *viper.Viper) error {
 	searchDir := filepath.Join(filepath.FromSlash(dirPath), filepath.Join("atmos.d", "**", "*"))
 	foundPaths1, err := SearchAtmosConfig(searchDir)
 	if err != nil {
-		clog.Debug("Failed to find atmos config file", "path", searchDir, "error", err)
+		log.Debug("Failed to find atmos config file", "path", searchDir, "error", err)
 	}
 	if len(foundPaths1) > 0 {
 		atmosFoundFilePaths = append(atmosFoundFilePaths, foundPaths1...)
@@ -246,7 +245,7 @@ func mergeDefaultImports(dirPath string, dst *viper.Viper) error {
 	searchDir = filepath.Join(filepath.FromSlash(dirPath), filepath.Join(".atmos.d", "**", "*"))
 	foundPaths2, err := SearchAtmosConfig(searchDir)
 	if err != nil {
-		clog.Debug("Failed to find atmos config file", "path", searchDir, "error", err)
+		log.Debug("Failed to find atmos config file", "path", searchDir, "error", err)
 	}
 	if len(foundPaths2) > 0 {
 		atmosFoundFilePaths = append(atmosFoundFilePaths, foundPaths2...)
@@ -254,10 +253,10 @@ func mergeDefaultImports(dirPath string, dst *viper.Viper) error {
 	for _, filePath := range atmosFoundFilePaths {
 		err := mergeConfigFile(filePath, dst)
 		if err != nil {
-			clog.Debug("error loading config file", "path", filePath, "error", err)
+			log.Debug("error loading config file", "path", filePath, "error", err)
 			continue
 		}
-		clog.Debug("atmos merged config", "path", filePath)
+		log.Debug("atmos merged config", "path", filePath)
 	}
 	return nil
 }
diff --git a/tests/fixtures/scenarios/atmos-cli-imports/configs.d/commands.yaml b/tests/fixtures/scenarios/atmos-cli-imports/configs.d/commands.yaml
index 8580ae9f0c..b48b127dfe 100644
--- a/tests/fixtures/scenarios/atmos-cli-imports/configs.d/commands.yaml
+++ b/tests/fixtures/scenarios/atmos-cli-imports/configs.d/commands.yaml
@@ -3,5 +3,4 @@ commands:
   - name: "test"
     description: "Run all tests"
     steps:
-      - atmos describe config  
-
+      - atmos describe config
diff --git a/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/helmfile.yml b/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/helmfile.yml
index 78780b1190..ff8186eef9 100644
--- a/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/helmfile.yml
+++ b/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/helmfile.yml
@@ -12,6 +12,3 @@ components:
     helm_aws_profile_pattern: "{namespace}-{tenant}-gbl-{stage}-helm"
     # Can also be set using 'ATMOS_COMPONENTS_HELMFILE_CLUSTER_NAME_PATTERN' ENV var
     cluster_name_pattern: "{namespace}-{tenant}-{environment}-{stage}-eks-cluster"
-
-
-
diff --git a/tests/fixtures/scenarios/atmos-configuration/atmos.yaml b/tests/fixtures/scenarios/atmos-configuration/atmos.yaml
index 063685dbc5..feae6a42e1 100644
--- a/tests/fixtures/scenarios/atmos-configuration/atmos.yaml
+++ b/tests/fixtures/scenarios/atmos-configuration/atmos.yaml
@@ -1,5 +1,3 @@
 # Description: Configuration file for the Atmos CLI
 # default import path is ./atmos.d import .yaml files from the directory and merge them
 base_path: "./"
-
-  

From b2669c7c19ea5b3621cd37622aae93363bba4c74 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Mon, 24 Feb 2025 19:33:46 +0200
Subject: [PATCH 30/83] refactor processScalarNode

---
 pkg/config/load.go | 42 ++++++++++++++++++++++++------------------
 1 file changed, 24 insertions(+), 18 deletions(-)

diff --git a/pkg/config/load.go b/pkg/config/load.go
index ff74fb146c..3f734228a0 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -306,9 +306,6 @@ func processNode(node *yaml.Node, v *viper.Viper, currentPath string) {
 	if node == nil {
 		return
 	}
-
-	AllowedDirectives := []string{AtmosYamlFuncEnv}
-
 	// If this node is a key-value pair in a mapping
 	if node.Kind == yaml.MappingNode {
 		for i := 0; i < len(node.Content); i += 2 {
@@ -326,21 +323,8 @@ func processNode(node *yaml.Node, v *viper.Viper, currentPath string) {
 
 	// If it's a scalar node with a directive tag
 	if node.Kind == yaml.ScalarNode && node.Tag != "" {
-		for _, directive := range AllowedDirectives {
-			if node.Tag == directive {
-				arg := node.Value
-				switch directive {
-				case "!env":
-					envValue := os.Getenv(arg)
-					if envValue != "" {
-						node.Value = envValue
-					}
-					v.Set(currentPath, node.Value) // Store the value to Viper
-				}
-				node.Tag = ""
-				break
-			}
-		}
+		processScalarNode(node, v, currentPath)
+
 	}
 
 	// Process children nodes (for sequences/lists)
@@ -348,3 +332,25 @@ func processNode(node *yaml.Node, v *viper.Viper, currentPath string) {
 		processNode(child, v, currentPath)
 	}
 }
+func processScalarNode(node *yaml.Node, v *viper.Viper, currentPath string) {
+	if node.Tag == "" {
+		return
+	}
+	allowedDirectives := []string{AtmosYamlFuncEnv}
+
+	for _, directive := range allowedDirectives {
+		if node.Tag == directive {
+			arg := node.Value
+			switch directive {
+			case "!env":
+				envValue := os.Getenv(arg)
+				if envValue != "" {
+					node.Value = envValue
+				}
+				v.Set(currentPath, node.Value) // Store the value to Viper
+			}
+			node.Tag = ""
+			break
+		}
+	}
+}

From ab18aabaee2f181f07f0e25fbea7144cbe786e5d Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Mon, 24 Feb 2025 19:57:54 +0200
Subject: [PATCH 31/83] improve logs

---
 .golangci.yml         |  2 +-
 pkg/config/imports.go | 17 ++++++++++-------
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/.golangci.yml b/.golangci.yml
index cb5865b8c8..e0ceb6688e 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -104,7 +104,7 @@ linters-settings:
       - name: add-constant
         arguments:
           - maxLitCount: "3"
-            allowStrs: '"","error","path"'
+            allowStrs: '"","error","path","import"'
             allowInts: "0,1,2,3,4"
             allowFloats: "0.0,0.,1.0,1.,2.0,2."
       - name: argument-limit
diff --git a/pkg/config/imports.go b/pkg/config/imports.go
index 2b9f3b396f..74c42350a2 100644
--- a/pkg/config/imports.go
+++ b/pkg/config/imports.go
@@ -42,7 +42,7 @@ type ResolvedPaths struct {
 // It processes imports from the source configuration and merges them into the destination configuration.
 func processConfigImports(source *schema.AtmosConfiguration, dst *viper.Viper) error {
 	if source == nil || dst == nil {
-		return fmt.Errorf("source and destination cannot be nil")
+		return errors.New("source and destination cannot be nil")
 	}
 	if len(source.Import) > 0 {
 		importPaths := source.Import
@@ -80,11 +80,12 @@ func processImports(basePath string, importPaths []string, tempDir string, curre
 		return nil, ErrTempDir
 	}
 	if currentDepth > maxDepth {
-		return nil, fmt.Errorf("maximum import depth of %d exceeded", maxDepth)
+		return nil, errors.New("maximum import depth reached")
 	}
 	basePath, err = filepath.Abs(basePath)
 	if err != nil {
-		return nil, fmt.Errorf("failed to resolve base path: %v", err)
+		log.Debug("failed to get absolute path for base path", "path", basePath, "error", err)
+		return nil, err
 	}
 
 	for _, importPath := range importPaths {
@@ -123,19 +124,21 @@ func isRemoteImport(importPath string) bool {
 func processRemoteImport(basePath, importPath, tempDir string, currentDepth, maxDepth int) ([]ResolvedPaths, error) {
 	parsedURL, err := url.Parse(importPath)
 	if err != nil || (parsedURL.Scheme != "http" && parsedURL.Scheme != "https") {
-		return nil, fmt.Errorf("unsupported URL '%s': %v", importPath, err)
+		log.Debug("unsupported URL", "URL", importPath, "error", err)
+		return nil, err
 	}
 
 	tempFile, err := downloadRemoteConfig(parsedURL.String(), tempDir)
 	if err != nil {
-		return nil, fmt.Errorf("failed to download remote config: %w", err)
+		log.Debug("failed to download remote config", "path", importPath, "error", err)
+		return nil, err
 	}
 	v := viper.New()
 	v.SetConfigFile(tempFile)
 	err = v.ReadInConfig()
 	if err != nil {
 		log.Debug("failed to read remote config", "path", importPath, "error", err)
-		return nil, fmt.Errorf("failed to read remote config")
+		return nil, err
 	}
 
 	resolvedPaths := make([]ResolvedPaths, 0)
@@ -155,7 +158,7 @@ func processRemoteImport(basePath, importPath, tempDir string, currentDepth, max
 		nestedPaths, err := processImports(importBasePath, imports, tempDir, currentDepth+1, maxDepth)
 		if err != nil {
 			log.Debug("failed to process nested imports", "import", importPath, "err", err)
-			return nil, fmt.Errorf("failed to process nested imports")
+			return nil, err
 		}
 		resolvedPaths = append(resolvedPaths, nestedPaths...)
 	}

From 0a9353adb5ec7aeab0bc828d9b1db49ba93c2a10 Mon Sep 17 00:00:00 2001
From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com>
Date: Mon, 24 Feb 2025 18:00:12 +0000
Subject: [PATCH 32/83] [autofix.ci] apply automated fixes

---
 pkg/config/load.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg/config/load.go b/pkg/config/load.go
index 3f734228a0..38554e4b0c 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -324,7 +324,6 @@ func processNode(node *yaml.Node, v *viper.Viper, currentPath string) {
 	// If it's a scalar node with a directive tag
 	if node.Kind == yaml.ScalarNode && node.Tag != "" {
 		processScalarNode(node, v, currentPath)
-
 	}
 
 	// Process children nodes (for sequences/lists)
@@ -332,6 +331,7 @@ func processNode(node *yaml.Node, v *viper.Viper, currentPath string) {
 		processNode(child, v, currentPath)
 	}
 }
+
 func processScalarNode(node *yaml.Node, v *viper.Viper, currentPath string) {
 	if node.Tag == "" {
 		return

From 462b5bf5b49b53c23d1fb279e682cb5a3ff97aa6 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Mon, 24 Feb 2025 20:17:13 +0200
Subject: [PATCH 33/83] fix linter error

---
 pkg/config/imports.go | 12 ++++++------
 pkg/config/load.go    | 16 ++++++++--------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/pkg/config/imports.go b/pkg/config/imports.go
index 74c42350a2..24913447fd 100644
--- a/pkg/config/imports.go
+++ b/pkg/config/imports.go
@@ -38,7 +38,7 @@ type ResolvedPaths struct {
 	importType  importTypes
 }
 
-// processConfigImports It reads the import paths from the source configuration,
+// processConfigImports It reads the import paths from the source configuration.
 // It processes imports from the source configuration and merges them into the destination configuration.
 func processConfigImports(source *schema.AtmosConfiguration, dst *viper.Viper) error {
 	if source == nil || dst == nil {
@@ -115,12 +115,12 @@ func processImports(basePath string, importPaths []string, tempDir string, curre
 	return resolvedPaths, nil
 }
 
-// Helper to determine if the import is a supported remote source
+// Helper to determine if the import is a supported remote source.
 func isRemoteImport(importPath string) bool {
 	return strings.HasPrefix(importPath, "http://") || strings.HasPrefix(importPath, "https://")
 }
 
-// Process remote imports
+// Process remote imports.
 func processRemoteImport(basePath, importPath, tempDir string, currentDepth, maxDepth int) ([]ResolvedPaths, error) {
 	parsedURL, err := url.Parse(importPath)
 	if err != nil || (parsedURL.Scheme != "http" && parsedURL.Scheme != "https") {
@@ -166,7 +166,7 @@ func processRemoteImport(basePath, importPath, tempDir string, currentDepth, max
 	return resolvedPaths, nil
 }
 
-// Process local imports
+// Process local imports.
 func processLocalImport(basePath string, importPath, tempDir string, currentDepth, maxDepth int) ([]ResolvedPaths, error) {
 	if importPath == "" {
 		return nil, fmt.Errorf("import_path required to process imports")
@@ -248,7 +248,7 @@ func SearchAtmosConfig(path string) ([]string, error) {
 	return atmosFilePathsAbsolute, nil
 }
 
-// Helper function to generate search patterns for extension yaml,yml
+// Helper function to generate search patterns for extension yaml,yml.
 func generatePatterns(path string) []string {
 	isDir := false
 	if stat, err := os.Stat(path); err == nil && stat.IsDir() {
@@ -275,7 +275,7 @@ func generatePatterns(path string) []string {
 	return []string{path}
 }
 
-// Helper function to convert paths to absolute paths
+// Helper function to convert paths to absolute paths.
 func convertToAbsolutePaths(filePaths []string) ([]string, error) {
 	var absPaths []string
 	for _, path := range filePaths {
diff --git a/pkg/config/load.go b/pkg/config/load.go
index 38554e4b0c..76b91c793b 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -107,7 +107,7 @@ func readSystemConfig(v *viper.Viper) error {
 	}
 
 	if len(configFilePath) > 0 {
-		err := mergeConfig(v, configFilePath, CliConfigFileName, false)
+		err := mergeConfig(v, configFilePath, false)
 		switch err.(type) {
 		case viper.ConfigFileNotFoundError:
 			return nil
@@ -125,7 +125,7 @@ func readHomeConfig(v *viper.Viper) error {
 		return err
 	}
 	configFilePath := filepath.Join(home, ".atmos")
-	err = mergeConfig(v, configFilePath, CliConfigFileName, true)
+	err = mergeConfig(v, configFilePath, true)
 	if err != nil {
 		switch err.(type) {
 		case viper.ConfigFileNotFoundError:
@@ -144,7 +144,7 @@ func readWorkDirConfig(v *viper.Viper) error {
 	if err != nil {
 		return err
 	}
-	err = mergeConfig(v, wd, CliConfigFileName, true)
+	err = mergeConfig(v, wd, true)
 	if err != nil {
 		switch err.(type) {
 		case viper.ConfigFileNotFoundError:
@@ -162,7 +162,7 @@ func readEnvAmosConfigPath(v *viper.Viper) error {
 		return nil
 	}
 	configFilePath := filepath.Join(atmosPath, CliConfigFileName)
-	err := mergeConfig(v, configFilePath, CliConfigFileName, true)
+	err := mergeConfig(v, configFilePath, true)
 	if err != nil {
 		switch err.(type) {
 		case viper.ConfigFileNotFoundError:
@@ -181,7 +181,7 @@ func readAtmosConfigCli(v *viper.Viper, atmosCliConfigPath string) error {
 	if len(atmosCliConfigPath) == 0 {
 		return nil
 	}
-	err := mergeConfig(v, atmosCliConfigPath, CliConfigFileName, true)
+	err := mergeConfig(v, atmosCliConfigPath, true)
 	switch err.(type) {
 	case viper.ConfigFileNotFoundError:
 		log.Debug("config not found", "file", atmosCliConfigPath)
@@ -192,10 +192,10 @@ func readAtmosConfigCli(v *viper.Viper, atmosCliConfigPath string) error {
 	return nil
 }
 
-// mergeConfig merge config from a specified path and process imports.return error if config file not exist .
-func mergeConfig(v *viper.Viper, path string, fileName string, processImports bool) error {
+// mergeConfig merge config from a specified path directory and process imports.return error if config file not exist .
+func mergeConfig(v *viper.Viper, path string, processImports bool) error {
 	v.AddConfigPath(path)
-	v.SetConfigName(fileName)
+	v.SetConfigName(CliConfigFileName)
 	err := v.MergeInConfig()
 	if err != nil {
 		return err

From 55a9b05a02d6b5326058665f14fb4d0bb6ad2bfe Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Mon, 24 Feb 2025 20:46:15 +0200
Subject: [PATCH 34/83] fix linter errors

---
 pkg/config/imports.go | 67 +++++++++++++++++++++++--------------------
 pkg/config/load.go    |  8 ++++--
 2 files changed, 42 insertions(+), 33 deletions(-)

diff --git a/pkg/config/imports.go b/pkg/config/imports.go
index 24913447fd..516c8ea780 100644
--- a/pkg/config/imports.go
+++ b/pkg/config/imports.go
@@ -19,9 +19,12 @@ import (
 )
 
 var (
-	ErrBasePath     = errors.New("base path required to process imports")
-	ErrTempDir      = errors.New("temporary directory required to process imports")
-	ErrResolveLocal = errors.New("failed to resolve local import path")
+	ErrBasePath           = errors.New("base path required to process imports")
+	ErrTempDir            = errors.New("temporary directory required to process imports")
+	ErrResolveLocal       = errors.New("failed to resolve local import path")
+	ErrSourceDestination  = errors.New("source and destination cannot be nil")
+	ErrImportPathRequired = errors.New("import path required to process imports")
+	ErrNOFileMatchPattern = errors.New("no files matching patterns found")
 )
 
 type importTypes int
@@ -31,7 +34,7 @@ const (
 	REMOTE importTypes = 1
 )
 
-// import Resolved Paths
+// import Resolved Paths.
 type ResolvedPaths struct {
 	filePath    string
 	importPaths string // import path from atmos config
@@ -42,33 +45,35 @@ type ResolvedPaths struct {
 // It processes imports from the source configuration and merges them into the destination configuration.
 func processConfigImports(source *schema.AtmosConfiguration, dst *viper.Viper) error {
 	if source == nil || dst == nil {
-		return errors.New("source and destination cannot be nil")
+		return ErrSourceDestination
+	}
+	if len(source.Import) == 0 {
+		return nil
+	}
+	importPaths := source.Import
+	baseBath, err := filepath.Abs(source.BasePath)
+	if err != nil {
+		return err
+	}
+	tempDir, err := os.MkdirTemp("", "atmos-import-*")
+	if err != nil {
+		return err
+	}
+	defer os.RemoveAll(tempDir)
+	resolvedPaths, err := processImports(baseBath, importPaths, tempDir, 1, MaximumImportLvL)
+	if err != nil {
+		return err
 	}
-	if len(source.Import) > 0 {
-		importPaths := source.Import
-		baseBath, err := filepath.Abs(source.BasePath)
-		if err != nil {
-			return err
-		}
-		tempDir, err := os.MkdirTemp("", "atmos-import-*")
-		if err != nil {
-			return err
-		}
-		defer os.RemoveAll(tempDir)
-		resolvedPaths, err := processImports(baseBath, importPaths, tempDir, 1, MaximumImportLvL)
-		if err != nil {
-			return err
-		}
 
-		for _, resolvedPath := range resolvedPaths {
-			err := mergeConfigFile(resolvedPath.filePath, dst)
-			if err != nil {
-				log.Debug("error loading config file", "import", resolvedPath.importPaths, "file_path", resolvedPath.filePath, "error", err)
-				continue
-			}
-			log.Debug("merged config from import", "import", resolvedPath.importPaths, "file_path", resolvedPath.filePath)
+	for _, resolvedPath := range resolvedPaths {
+		err := mergeConfigFile(resolvedPath.filePath, dst)
+		if err != nil {
+			log.Debug("error loading config file", "import", resolvedPath.importPaths, "file_path", resolvedPath.filePath, "error", err)
+			continue
 		}
+		log.Debug("merged config from import", "import", resolvedPath.importPaths, "file_path", resolvedPath.filePath)
 	}
+
 	return nil
 }
 
@@ -169,7 +174,7 @@ func processRemoteImport(basePath, importPath, tempDir string, currentDepth, max
 // Process local imports.
 func processLocalImport(basePath string, importPath, tempDir string, currentDepth, maxDepth int) ([]ResolvedPaths, error) {
 	if importPath == "" {
-		return nil, fmt.Errorf("import_path required to process imports")
+		return nil, ErrImportPathRequired
 	}
 	if !filepath.IsAbs(importPath) {
 		importPath = filepath.Join(basePath, importPath)
@@ -288,7 +293,7 @@ func convertToAbsolutePaths(filePaths []string) ([]string, error) {
 	}
 
 	if len(absPaths) == 0 {
-		return nil, fmt.Errorf("no valid absolute paths found")
+		return nil, errors.New("no valid absolute paths found")
 	}
 
 	return absPaths, nil
@@ -365,7 +370,7 @@ func sortFilesByDepth(files []string) []string {
 	return sortedFiles
 }
 
-// Helper function to find files matching the patterns
+// Helper function to find files matching the patterns.
 func findMatchingFiles(patterns []string) ([]string, error) {
 	var filePaths []string
 	for _, pattern := range patterns {
@@ -378,7 +383,7 @@ func findMatchingFiles(patterns []string) ([]string, error) {
 	}
 
 	if len(filePaths) == 0 {
-		return nil, fmt.Errorf("no files matching patterns found")
+		return nil, ErrNOFileMatchPattern
 	}
 
 	return filePaths, nil
diff --git a/pkg/config/load.go b/pkg/config/load.go
index 76b91c793b..8b6a250215 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -1,6 +1,7 @@
 package config
 
 import (
+	"errors"
 	"fmt"
 	"os"
 	"path/filepath"
@@ -16,6 +17,8 @@ import (
 
 const MaximumImportLvL = 10
 
+var ErrAtmosDIrConfigNotFound = errors.New("atmos config directory not found")
+
 // * System dir (`/usr/local/etc/atmos` on Linux, `%LOCALAPPDATA%/atmos` on Windows).
 // * Home directory (~/.atmos).
 // * Current working directory.
@@ -229,7 +232,7 @@ func mergeDefaultImports(dirPath string, dst *viper.Viper) error {
 		isDir = true
 	}
 	if !isDir {
-		return fmt.Errorf("atmos config directory not found path %s", dirPath)
+		return ErrAtmosDIrConfigNotFound
 	}
 	var atmosFoundFilePaths []string
 	// Search for `atmos.d/` configurations
@@ -288,7 +291,8 @@ func mergeImports(dst *viper.Viper) error {
 func preprocessAtmosYamlFunc(yamlContent []byte, v *viper.Viper) error {
 	var rootNode yaml.Node
 	if err := yaml.Unmarshal(yamlContent, &rootNode); err != nil {
-		return fmt.Errorf("failed to parse YAML: %v", err)
+		log.Debug("failed to parse YAML", "content", yamlContent, "error", err)
+		return err
 	}
 	processNode(&rootNode, v, "")
 	return nil

From 115006b38a35c0a19012772d6737f00361e0076b Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Mon, 24 Feb 2025 21:16:43 +0200
Subject: [PATCH 35/83] update snapshots

---
 ...g_Level_in_Command_Line_Flag.stdout.golden |  2 +-
 ...lid_Log_Level_in_Config_File.stderr.golden |  8 ++--
 ...lid_Log_Level_in_Config_File.stdout.golden |  2 +-
 ...ld_be_priortized_over_config.stdout.golden | 10 ++---
 ...iortized_over_env_and_config.stdout.golden | 10 ++---
 ...iortized_over_env_and_config.stderr.golden |  8 ++--
 ...iortized_over_env_and_config.stdout.golden |  2 +-
 ...tmos_describe_config_imports.stderr.golden | 40 +++++++++----------
 ...atmos_describe_configuration.stderr.golden |  8 ++--
 9 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Command_Line_Flag.stdout.golden b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Command_Line_Flag.stdout.golden
index 82c26c3598..c39a129255 100644
--- a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Command_Line_Flag.stdout.golden
+++ b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Command_Line_Flag.stdout.golden
@@ -1,3 +1,3 @@
 
-👽 Atmos test on darwin/arm64
+👽 Atmos test on linux/amd64
 
diff --git a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden
index d2c242ae37..915f8c6a5e 100644
--- a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden
+++ b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden
@@ -1,8 +1,8 @@
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d' + '**/*.yaml')"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d' + '**/*.yml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d' + '**/*.yaml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d' + '**/*.yaml')"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d' + '**/*.yml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d' + '**/*.yaml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
 DEBU processStoreConfig atmosConfig.StoresConfig=map[]
diff --git a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stdout.golden b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stdout.golden
index 82c26c3598..c39a129255 100644
--- a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stdout.golden
+++ b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stdout.golden
@@ -1,3 +1,3 @@
 
-👽 Atmos test on darwin/arm64
+👽 Atmos test on linux/amd64
 
diff --git a/tests/snapshots/TestCLICommands_Valid_log_file_in_env_should_be_priortized_over_config.stdout.golden b/tests/snapshots/TestCLICommands_Valid_log_file_in_env_should_be_priortized_over_config.stdout.golden
index 9a4e7002ab..d83b307e54 100644
--- a/tests/snapshots/TestCLICommands_Valid_log_file_in_env_should_be_priortized_over_config.stdout.golden
+++ b/tests/snapshots/TestCLICommands_Valid_log_file_in_env_should_be_priortized_over_config.stdout.golden
@@ -1,13 +1,13 @@
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yaml' ('/absolute/path/to/repo/atmos.d' + '**/*.yaml')"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yml' ('/absolute/path/to/repo/atmos.d' + '**/*.yml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yaml' ('/absolute/path/to/repo/atmos.d' + '**/*.yaml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yml' ('/absolute/path/to/repo/atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yaml')"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yaml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Found ENV var ATMOS_LOGS_FILE=/dev/stdout
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
 DEBU Using command line argument '--logs-level=Debug'
 DEBU processStoreConfig atmosConfig.StoresConfig=map[]
 
-👽 Atmos test on darwin/arm64
+👽 Atmos test on linux/amd64
 
diff --git a/tests/snapshots/TestCLICommands_Valid_log_file_in_flag_should_be_priortized_over_env_and_config.stdout.golden b/tests/snapshots/TestCLICommands_Valid_log_file_in_flag_should_be_priortized_over_env_and_config.stdout.golden
index 94dc07ed96..55641114ab 100644
--- a/tests/snapshots/TestCLICommands_Valid_log_file_in_flag_should_be_priortized_over_env_and_config.stdout.golden
+++ b/tests/snapshots/TestCLICommands_Valid_log_file_in_flag_should_be_priortized_over_env_and_config.stdout.golden
@@ -1,8 +1,8 @@
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yaml' ('/absolute/path/to/repo/atmos.d' + '**/*.yaml')"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yml' ('/absolute/path/to/repo/atmos.d' + '**/*.yml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yaml' ('/absolute/path/to/repo/atmos.d' + '**/*.yaml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yml' ('/absolute/path/to/repo/atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yaml')"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yaml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Found ENV var ATMOS_LOGS_FILE=/dev/stderr
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
@@ -10,5 +10,5 @@ DEBU Using command line argument '--logs-level=Debug'
 DEBU Using command line argument '--logs-file=/dev/stdout'
 DEBU processStoreConfig atmosConfig.StoresConfig=map[]
 
-👽 Atmos test on darwin/arm64
+👽 Atmos test on linux/amd64
 
diff --git a/tests/snapshots/TestCLICommands_Valid_log_level_in_flag_should_be_priortized_over_env_and_config.stderr.golden b/tests/snapshots/TestCLICommands_Valid_log_level_in_flag_should_be_priortized_over_env_and_config.stderr.golden
index 386f735d1d..0832f4bad8 100644
--- a/tests/snapshots/TestCLICommands_Valid_log_level_in_flag_should_be_priortized_over_env_and_config.stderr.golden
+++ b/tests/snapshots/TestCLICommands_Valid_log_level_in_flag_should_be_priortized_over_env_and_config.stderr.golden
@@ -1,8 +1,8 @@
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yaml' ('/absolute/path/to/repo/atmos.d' + '**/*.yaml')"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yml' ('/absolute/path/to/repo/atmos.d' + '**/*.yml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yaml' ('/absolute/path/to/repo/atmos.d' + '**/*.yaml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yml' ('/absolute/path/to/repo/atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yaml')"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yaml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Found ENV var ATMOS_LOGS_LEVEL=Info
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
diff --git a/tests/snapshots/TestCLICommands_Valid_log_level_in_flag_should_be_priortized_over_env_and_config.stdout.golden b/tests/snapshots/TestCLICommands_Valid_log_level_in_flag_should_be_priortized_over_env_and_config.stdout.golden
index 82c26c3598..c39a129255 100644
--- a/tests/snapshots/TestCLICommands_Valid_log_level_in_flag_should_be_priortized_over_env_and_config.stdout.golden
+++ b/tests/snapshots/TestCLICommands_Valid_log_level_in_flag_should_be_priortized_over_env_and_config.stdout.golden
@@ -1,3 +1,3 @@
 
-👽 Atmos test on darwin/arm64
+👽 Atmos test on linux/amd64
 
diff --git a/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stderr.golden b/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stderr.golden
index cf926f94b9..889a57cb6c 100644
--- a/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stderr.golden
+++ b/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stderr.golden
@@ -1,26 +1,26 @@
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d' + '**/*.yaml')"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d' + '**/*.yml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d' + '**/*.yaml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d' + '**/*.yaml')"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d' + '**/*.yml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d' + '**/*.yaml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU atmos merged config from import import=https://raw.githubusercontent.com/cloudposse/atmos/refs/heads/main/atmos.yaml file_path=/atmos-import/atmos-import.yaml
-DEBU atmos merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/commands.yaml
-DEBU atmos merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/vendor.yaml
-DEBU atmos merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/tools/stack.yml
-DEBU atmos merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/tools/terraform.yaml
-DEBU atmos merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/logs.yaml file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/logs.yaml
+DEBU merged config from import import=https://raw.githubusercontent.com/cloudposse/atmos/refs/heads/main/atmos.yaml file_path=/atmos-import/atmos-import.yaml
+DEBU merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/commands.yaml
+DEBU merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/vendor.yaml
+DEBU merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/tools/stack.yml
+DEBU merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/tools/terraform.yaml
+DEBU merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/logs.yaml file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/logs.yaml
 DEBU processStoreConfig atmosConfig.StoresConfig=map[]
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d' + '**/*.yaml')"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d' + '**/*.yml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d' + '**/*.yaml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d' + '**/*.yaml')"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d' + '**/*.yml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d' + '**/*.yaml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU atmos merged config from import import=https://raw.githubusercontent.com/cloudposse/atmos/refs/heads/main/atmos.yaml file_path=/atmos-import/atmos-import.yaml
-DEBU atmos merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/commands.yaml
-DEBU atmos merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/vendor.yaml
-DEBU atmos merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/tools/stack.yml
-DEBU atmos merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/tools/terraform.yaml
-DEBU atmos merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/logs.yaml file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/logs.yaml
+DEBU merged config from import import=https://raw.githubusercontent.com/cloudposse/atmos/refs/heads/main/atmos.yaml file_path=/atmos-import/atmos-import.yaml
+DEBU merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/commands.yaml
+DEBU merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/vendor.yaml
+DEBU merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/tools/stack.yml
+DEBU merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/tools/terraform.yaml
+DEBU merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/logs.yaml file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/logs.yaml
 DEBU processStoreConfig atmosConfig.StoresConfig=map[]
diff --git a/tests/snapshots/TestCLICommands_atmos_describe_configuration.stderr.golden b/tests/snapshots/TestCLICommands_atmos_describe_configuration.stderr.golden
index ce99d782ef..b8b0ea0298 100644
--- a/tests/snapshots/TestCLICommands_atmos_describe_configuration.stderr.golden
+++ b/tests/snapshots/TestCLICommands_atmos_describe_configuration.stderr.golden
@@ -1,5 +1,5 @@
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d' + '**/*.yaml')"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d' + '**/*.yml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d' + '**/*.yaml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/commands.yaml
 DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/logs.yaml
@@ -7,8 +7,8 @@ DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/at
 DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/stack.yaml
 DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/terraform.yaml
 DEBU processStoreConfig atmosConfig.StoresConfig=map[]
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d' + '**/*.yaml')"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d' + '**/*.yml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d' + '**/*.yaml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/commands.yaml
 DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/logs.yaml

From 6180ff5f064ce66ffe7ac5ce6fbe57cac72dad86 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Mon, 24 Feb 2025 21:35:28 +0200
Subject: [PATCH 36/83] fix linter errors

---
 pkg/config/import_test.go | 9 +++++----
 pkg/config/load.go        | 3 +--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/pkg/config/import_test.go b/pkg/config/import_test.go
index 9612449dcb..f6c6a3d2b0 100644
--- a/pkg/config/import_test.go
+++ b/pkg/config/import_test.go
@@ -17,7 +17,7 @@ func setupTestFile(content, tempDir string, filename string) (string, error) {
 	return filePath, err
 }
 
-// Test for processImports
+// Test for processImports.
 func TestProcessImports(t *testing.T) {
 	// Step 1: Setup a mock HTTP server for a remote URL
 	server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@@ -112,11 +112,12 @@ import:
 	nestedRemoteContent := `import: []`
 	// Create an HTTP server to simulate remote imports
 	server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
-		if r.URL.Path == "/config.yaml" {
+		switch r.URL.Path {
+		case "/config.yaml":
 			fmt.Fprint(w, remoteContent)
-		} else if r.URL.Path == "/nested-remote.yaml" {
+		case "/nested-remote.yaml":
 			fmt.Fprint(w, nestedRemoteContent)
-		} else {
+		default:
 			http.NotFound(w, r)
 		}
 	}))
diff --git a/pkg/config/load.go b/pkg/config/load.go
index 8b6a250215..c442706d87 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -345,8 +345,7 @@ func processScalarNode(node *yaml.Node, v *viper.Viper, currentPath string) {
 	for _, directive := range allowedDirectives {
 		if node.Tag == directive {
 			arg := node.Value
-			switch directive {
-			case "!env":
+			if directive == AtmosYamlFuncEnv {
 				envValue := os.Getenv(arg)
 				if envValue != "" {
 					node.Value = envValue

From 6f5d329e572d693265f57c90af1a4bfbbe5b2213 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Mon, 24 Feb 2025 21:44:24 +0200
Subject: [PATCH 37/83] fix linter

---
 pkg/config/load.go  | 22 ++++++++++++++++++++++
 pkg/config/utils.go | 23 -----------------------
 2 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/pkg/config/load.go b/pkg/config/load.go
index c442706d87..ef925bff06 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -1,6 +1,7 @@
 package config
 
 import (
+	"bytes"
 	"errors"
 	"fmt"
 	"os"
@@ -357,3 +358,24 @@ func processScalarNode(node *yaml.Node, v *viper.Viper, currentPath string) {
 		}
 	}
 }
+
+// mergeConfigFile merges a new configuration file with an existing config into Viper.
+func mergeConfigFile(
+	path string,
+	v *viper.Viper,
+) error {
+	content, err := os.ReadFile(path)
+	if err != nil {
+		return err
+	}
+	err = v.MergeConfig(bytes.NewReader(content))
+	if err != nil {
+		return err
+	}
+	err = preprocessAtmosYamlFunc(content, v)
+	if err != nil {
+		return err
+	}
+
+	return nil
+}
diff --git a/pkg/config/utils.go b/pkg/config/utils.go
index c3291aa922..43a52707b3 100644
--- a/pkg/config/utils.go
+++ b/pkg/config/utils.go
@@ -1,7 +1,6 @@
 package config
 
 import (
-	"bytes"
 	"errors"
 	"fmt"
 	"os"
@@ -14,7 +13,6 @@ import (
 	"github.com/cloudposse/atmos/pkg/schema"
 	"github.com/cloudposse/atmos/pkg/store"
 	u "github.com/cloudposse/atmos/pkg/utils"
-	"github.com/spf13/viper"
 )
 
 // FindAllStackConfigsInPathsForStack finds all stack manifests in the paths specified by globs for the provided stack
@@ -781,24 +779,3 @@ func SearchConfigFile(configPath string, atmosConfig schema.AtmosConfiguration)
 
 	return "", fmt.Errorf("failed to find a match for the import '%s' ('%s' + '%s')", configPath, dir, base)
 }
-
-// mergeConfigFile merges a new configuration file with an existing config into Viper.
-func mergeConfigFile(
-	path string,
-	v *viper.Viper,
-) error {
-	content, err := os.ReadFile(path)
-	if err != nil {
-		return err
-	}
-	err = v.MergeConfig(bytes.NewReader(content))
-	if err != nil {
-		return err
-	}
-	err = preprocessAtmosYamlFunc(content, v)
-	if err != nil {
-		return err
-	}
-
-	return nil
-}

From 21ae927bb35d8c4727070b6efa0b34d1f3d1d60d Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 25 Feb 2025 20:10:14 +0200
Subject: [PATCH 38/83] add global --base-path ,--config ,--config-path

---
 cmd/root.go            |  4 +++-
 internal/exec/utils.go | 13 ++++++++++++-
 pkg/schema/schema.go   |  2 ++
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/cmd/root.go b/cmd/root.go
index e7074a5778..03c9df7b88 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -251,7 +251,9 @@ func init() {
 
 	RootCmd.PersistentFlags().String("logs-level", "Info", "Logs level. Supported log levels are Trace, Debug, Info, Warning, Off. If the log level is set to Off, Atmos will not log any messages")
 	RootCmd.PersistentFlags().String("logs-file", "/dev/stderr", "The file to write Atmos logs to. Logs can be written to any file or any standard file descriptor, including '/dev/stdout', '/dev/stderr' and '/dev/null'")
-
+	RootCmd.PersistentFlags().String("base-path", "", "Base path for Atmos project")
+	RootCmd.PersistentFlags().StringSlice("config", []string{}, "Paths to configuration file")
+	RootCmd.PersistentFlags().StringSlice("config-path", []string{}, "Path to configuration directory")
 	// Set custom usage template
 	err := templates.SetCustomUsageFunc(RootCmd)
 	if err != nil {
diff --git a/internal/exec/utils.go b/internal/exec/utils.go
index 7caafc3f7a..cb7003cd90 100644
--- a/internal/exec/utils.go
+++ b/internal/exec/utils.go
@@ -205,6 +205,18 @@ func ProcessCommandLineArgs(
 		return configAndStacksInfo, err
 	}
 
+	configAndStacksInfo.BasePath, err = cmd.Flags().GetString("base-path")
+	if err != nil {
+		return configAndStacksInfo, err
+	}
+	configAndStacksInfo.AtmosConfigFilesFromArg, err = cmd.Flags().GetStringSlice("config")
+	if err != nil {
+		return configAndStacksInfo, err
+	}
+	configAndStacksInfo.AtmosConfigDirsFromArg, err = cmd.Flags().GetStringSlice("config-path")
+	if err != nil {
+		return configAndStacksInfo, err
+	}
 	finalAdditionalArgsAndFlags := argsAndFlagsInfo.AdditionalArgsAndFlags
 	if len(additionalArgsAndFlags) > 0 {
 		finalAdditionalArgsAndFlags = append(finalAdditionalArgsAndFlags, additionalArgsAndFlags...)
@@ -216,7 +228,6 @@ func ProcessCommandLineArgs(
 	configAndStacksInfo.ComponentType = componentType
 	configAndStacksInfo.ComponentFromArg = argsAndFlagsInfo.ComponentFromArg
 	configAndStacksInfo.GlobalOptions = argsAndFlagsInfo.GlobalOptions
-	configAndStacksInfo.BasePath = argsAndFlagsInfo.BasePath
 	configAndStacksInfo.TerraformCommand = argsAndFlagsInfo.TerraformCommand
 	configAndStacksInfo.TerraformDir = argsAndFlagsInfo.TerraformDir
 	configAndStacksInfo.HelmfileCommand = argsAndFlagsInfo.HelmfileCommand
diff --git a/pkg/schema/schema.go b/pkg/schema/schema.go
index 070e7e33e8..e6340d0695 100644
--- a/pkg/schema/schema.go
+++ b/pkg/schema/schema.go
@@ -293,6 +293,8 @@ type ConfigAndStacksInfo struct {
 	LogsFile                      string
 	SettingsListMergeStrategy     string
 	Query                         string
+	AtmosConfigFilesFromArg       []string
+	AtmosConfigDirsFromArg        []string
 }
 
 // Workflows

From 982d33fb371b678f448dd2d67b14932c9b3ccb37 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 25 Feb 2025 20:10:53 +0200
Subject: [PATCH 39/83] add embed atmos config

---
 pkg/config/atmos.yaml |  8 +++++++
 pkg/config/load.go    | 54 ++++++++++++++++++++++++++++++++++---------
 2 files changed, 51 insertions(+), 11 deletions(-)
 create mode 100644 pkg/config/atmos.yaml

diff --git a/pkg/config/atmos.yaml b/pkg/config/atmos.yaml
new file mode 100644
index 0000000000..cc7367214c
--- /dev/null
+++ b/pkg/config/atmos.yaml
@@ -0,0 +1,8 @@
+logs:
+  # Can also be set using 'ATMOS_LOGS_FILE' ENV var, or '--logs-file' command-line argument
+  # File or standard file descriptor to write logs to
+  # Logs can be written to any file or any standard file descriptor, including `/dev/stdout`, `/dev/stderr` and `/dev/null`
+  file: "/dev/stderr"
+  # Supported log levels: Trace, Debug, Info, Warning, Off
+  # Can also be set using 'ATMOS_LOGS_LEVEL' ENV var, or '--logs-level' command-line argument
+  level: Info
diff --git a/pkg/config/load.go b/pkg/config/load.go
index ef925bff06..42ff07e022 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -2,6 +2,7 @@ package config
 
 import (
 	"bytes"
+	_ "embed"
 	"errors"
 	"fmt"
 	"os"
@@ -16,10 +17,16 @@ import (
 	"gopkg.in/yaml.v3"
 )
 
+//go:embed atmos.yaml
+var embeddedConfigData []byte
+
 const MaximumImportLvL = 10
 
-var ErrAtmosDIrConfigNotFound = errors.New("atmos config directory not found")
+var (
+	ErrAtmosDIrConfigNotFound = errors.New("atmos config directory not found")
+)
 
+// * Embedded atmos.yaml (`atmos/pkg/config/atmos.yaml`)
 // * System dir (`/usr/local/etc/atmos` on Linux, `%LOCALAPPDATA%/atmos` on Windows).
 // * Home directory (~/.atmos).
 // * Current working directory.
@@ -31,8 +38,19 @@ func LoadConfig(configAndStacksInfo *schema.ConfigAndStacksInfo) (schema.AtmosCo
 	v.SetConfigType("yaml")
 	v.SetTypeByDefaultValue(true)
 	setDefaultConfiguration(v)
+	// Load embed atmos.yaml
+	if err := loadEmbeddedConfig(v); err != nil {
+		return atmosConfig, err
+	}
+	if len(configAndStacksInfo.AtmosConfigFilesFromArg) > 0 || len(configAndStacksInfo.AtmosConfigDirsFromArg) > 0 {
+		err := loadConfigFromCLIArgs(v, configAndStacksInfo, &atmosConfig)
+		if err != nil {
+			return atmosConfig, err
+		}
+		return atmosConfig, nil
+	}
 	// Load configuration from different sources.
-	if err := loadConfigSources(v, configAndStacksInfo.AtmosCliConfigPath); err != nil {
+	if err := loadConfigSources(v, configAndStacksInfo); err != nil {
 		return atmosConfig, err
 	}
 	// If no config file is used, fall back to the default CLI config.
@@ -78,7 +96,8 @@ func setDefaultConfiguration(v *viper.Viper) {
 
 // loadConfigSources delegates reading configs from each source,
 // returning early if any step in the chain fails.
-func loadConfigSources(v *viper.Viper, cliConfigPath string) error {
+func loadConfigSources(v *viper.Viper, configAndStacksInfo *schema.ConfigAndStacksInfo) error {
+	// Check if --config flag is provided
 	if err := readSystemConfig(v); err != nil {
 		return err
 	}
@@ -95,7 +114,7 @@ func loadConfigSources(v *viper.Viper, cliConfigPath string) error {
 		return err
 	}
 
-	return readAtmosConfigCli(v, cliConfigPath)
+	return readAtmosConfigCli(v, configAndStacksInfo.AtmosCliConfigPath)
 }
 
 // readSystemConfig load config from system dir .
@@ -111,7 +130,7 @@ func readSystemConfig(v *viper.Viper) error {
 	}
 
 	if len(configFilePath) > 0 {
-		err := mergeConfig(v, configFilePath, false)
+		err := mergeConfig(v, configFilePath, CliConfigFileName, false)
 		switch err.(type) {
 		case viper.ConfigFileNotFoundError:
 			return nil
@@ -129,7 +148,7 @@ func readHomeConfig(v *viper.Viper) error {
 		return err
 	}
 	configFilePath := filepath.Join(home, ".atmos")
-	err = mergeConfig(v, configFilePath, true)
+	err = mergeConfig(v, configFilePath, CliConfigFileName, true)
 	if err != nil {
 		switch err.(type) {
 		case viper.ConfigFileNotFoundError:
@@ -148,7 +167,7 @@ func readWorkDirConfig(v *viper.Viper) error {
 	if err != nil {
 		return err
 	}
-	err = mergeConfig(v, wd, true)
+	err = mergeConfig(v, wd, CliConfigFileName, true)
 	if err != nil {
 		switch err.(type) {
 		case viper.ConfigFileNotFoundError:
@@ -166,7 +185,7 @@ func readEnvAmosConfigPath(v *viper.Viper) error {
 		return nil
 	}
 	configFilePath := filepath.Join(atmosPath, CliConfigFileName)
-	err := mergeConfig(v, configFilePath, true)
+	err := mergeConfig(v, configFilePath, CliConfigFileName, true)
 	if err != nil {
 		switch err.(type) {
 		case viper.ConfigFileNotFoundError:
@@ -185,7 +204,7 @@ func readAtmosConfigCli(v *viper.Viper, atmosCliConfigPath string) error {
 	if len(atmosCliConfigPath) == 0 {
 		return nil
 	}
-	err := mergeConfig(v, atmosCliConfigPath, true)
+	err := mergeConfig(v, atmosCliConfigPath, CliConfigFileName, true)
 	switch err.(type) {
 	case viper.ConfigFileNotFoundError:
 		log.Debug("config not found", "file", atmosCliConfigPath)
@@ -197,9 +216,9 @@ func readAtmosConfigCli(v *viper.Viper, atmosCliConfigPath string) error {
 }
 
 // mergeConfig merge config from a specified path directory and process imports.return error if config file not exist .
-func mergeConfig(v *viper.Viper, path string, processImports bool) error {
+func mergeConfig(v *viper.Viper, path string, fileName string, processImports bool) error {
 	v.AddConfigPath(path)
-	v.SetConfigName(CliConfigFileName)
+	v.SetConfigName(fileName)
 	err := v.MergeInConfig()
 	if err != nil {
 		return err
@@ -379,3 +398,16 @@ func mergeConfigFile(
 
 	return nil
 }
+
+// loadEmbeddedConfig loads the embedded atmos.yaml configuration.
+func loadEmbeddedConfig(v *viper.Viper) error {
+	// Create a reader from the embedded YAML data
+	reader := bytes.NewReader(embeddedConfigData)
+
+	// Merge the embedded configuration into Viper
+	if err := v.MergeConfig(reader); err != nil {
+		return fmt.Errorf("failed to merge embedded config: %w", err)
+	}
+
+	return nil
+}

From d5c437365592dbc3b99ec2fb485d75179e82302d Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 25 Feb 2025 20:11:01 +0200
Subject: [PATCH 40/83] add global --base-path ,--config ,--config-path

---
 pkg/config/const.go            |   4 +-
 pkg/config/load_config_args.go | 150 +++++++++++++++++++++++++++++++++
 2 files changed, 153 insertions(+), 1 deletion(-)
 create mode 100644 pkg/config/load_config_args.go

diff --git a/pkg/config/const.go b/pkg/config/const.go
index 1445140c6d..62929869fb 100644
--- a/pkg/config/const.go
+++ b/pkg/config/const.go
@@ -1,7 +1,9 @@
 package config
 
 const (
-	CliConfigFileName       = "atmos"
+	CliConfigFileName    = "atmos"
+	DotCliConfigFileName = ".atmos"
+
 	SystemDirConfigFilePath = "/usr/local/etc/atmos"
 	WindowsAppDataEnvVar    = "LOCALAPPDATA"
 
diff --git a/pkg/config/load_config_args.go b/pkg/config/load_config_args.go
new file mode 100644
index 0000000000..f73c9ce901
--- /dev/null
+++ b/pkg/config/load_config_args.go
@@ -0,0 +1,150 @@
+package config
+
+import (
+	"errors"
+	"os"
+
+	log "github.com/charmbracelet/log"
+	"github.com/cloudposse/atmos/pkg/schema"
+	"github.com/spf13/viper"
+)
+
+var (
+	ErrExpectedDirOrPattern   = errors.New("--config-path expected directory found file")
+	ErrFileNotFound           = errors.New("file not found")
+	ErrExpectedFile           = errors.New("--config expected file found directory")
+	ErrAtmosArgConfigNotFound = errors.New("atmos configuration not found")
+)
+
+// loadConfigFromCLIArgs handles the loading of configurations provided via --config-path.
+func loadConfigFromCLIArgs(v *viper.Viper, configAndStacksInfo *schema.ConfigAndStacksInfo, atmosConfig *schema.AtmosConfiguration) error {
+	log.Debug("loading config from command line arguments")
+	configFilesArgs := configAndStacksInfo.AtmosConfigFilesFromArg
+	configDirsArgs := configAndStacksInfo.AtmosConfigDirsFromArg
+	var configPaths []string
+	//merge all config from --config files
+	if len(configFilesArgs) > 0 {
+		err := mergeFiles(v, configFilesArgs)
+		if err != nil {
+			return err
+		}
+		configPaths = append(configPaths, configFilesArgs...)
+	}
+	// merge config from -config-path directors
+	if len(configDirsArgs) > 0 {
+		paths, err := mergeConfigFromDirectories(v, configDirsArgs)
+		if err != nil {
+			return err
+		}
+		configPaths = append(configPaths, paths...)
+	}
+
+	// check if any config files were found from command line arguments
+	if len(configPaths) == 0 {
+		log.Debug("no config files found from command line arguments")
+		return ErrAtmosArgConfigNotFound
+	}
+	err := v.Unmarshal(atmosConfig)
+	if err != nil {
+		return err
+	}
+	atmosConfig.CliConfigPath = connectPaths(configPaths)
+	return nil
+}
+
+// mergeFiles merges config files from the provided paths.
+func mergeFiles(v *viper.Viper, configFilePaths []string) error {
+	err := validatedIsFiles(configFilePaths)
+	if err != nil {
+		return err
+	}
+	for _, configPath := range configFilePaths {
+		err := mergeConfigFile(configPath, v)
+		if err != nil {
+			log.Debug("error loading config file", "path", configPath, "error", err)
+			return err
+		}
+		log.Debug("config file merged", "path", configPath)
+		if err := mergeDefaultImports(configPath, v); err != nil {
+			log.Debug("error process imports", "path", configPath, "error", err)
+		}
+		if err := mergeImports(v); err != nil {
+			log.Debug("error process imports", "file", configPath, "error", err)
+		}
+	}
+	return nil
+}
+
+// mergeConfigFromDirectories merges config files from the provided directories.
+func mergeConfigFromDirectories(v *viper.Viper, dirPaths []string) ([]string, error) {
+	if err := validatedIsDirs(dirPaths); err != nil {
+		return nil, err
+	}
+	var configPaths []string
+	for _, confDirPath := range dirPaths {
+		err := mergeConfig(v, confDirPath, CliConfigFileName, true)
+		if err != nil {
+			log.Debug("Failed to find atmos config", "path", confDirPath, "error", err)
+			switch err.(type) {
+			case viper.ConfigFileNotFoundError:
+				log.Debug("Failed to found atmos config", "file", v.ConfigFileUsed())
+			default:
+				return nil, err
+			}
+		}
+		if err == nil {
+			log.Debug("atmos config file merged", "path", v.ConfigFileUsed())
+			configPaths = append(configPaths, confDirPath)
+			continue
+		}
+		err = mergeConfig(v, confDirPath, DotCliConfigFileName, true)
+		if err != nil {
+			log.Debug("Failed to found .atmos config", "path", confDirPath, "error", err)
+			return nil, ErrAtmosArgConfigNotFound
+		}
+		log.Debug(".atmos config file merged", "path", v.ConfigFileUsed())
+		configPaths = append(configPaths, confDirPath)
+
+	}
+
+	return configPaths, nil
+}
+func validatedIsDirs(dirPaths []string) error {
+	for _, dirPath := range dirPaths {
+		stat, err := os.Stat(dirPath)
+		if err != nil {
+			log.Debug("--config-path directory not found", "path", dirPath)
+			return err
+		}
+		if !stat.IsDir() {
+			log.Debug("--config-path expected directory found file", "path", dirPath)
+			return ErrAtmosDIrConfigNotFound
+		}
+	}
+	return nil
+}
+func validatedIsFiles(files []string) error {
+	for _, filePath := range files {
+		stat, err := os.Stat(filePath)
+		if err != nil {
+			log.Debug("--config file not found", "path", filePath)
+			return ErrFileNotFound
+		}
+		if stat.IsDir() {
+			log.Debug("--config expected file found directors", "path", filePath)
+			return ErrExpectedFile
+		}
+	}
+	return nil
+}
+func connectPaths(paths []string) string {
+	if len(paths) == 1 {
+		return paths[0]
+	}
+	var result string
+	for _, path := range paths {
+		result += path + ";"
+	}
+	return result
+
+}

From 6a09b6583b89c5a6a943709940f4b88a32ebf3d4 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 25 Feb 2025 20:16:03 +0200
Subject: [PATCH 41/83] enhance code

---
 pkg/config/load_config_args.go | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/pkg/config/load_config_args.go b/pkg/config/load_config_args.go
index f73c9ce901..f8d60fa020 100644
--- a/pkg/config/load_config_args.go
+++ b/pkg/config/load_config_args.go
@@ -19,18 +19,20 @@ var (
 // loadConfigFromCLIArgs handles the loading of configurations provided via --config-path.
 func loadConfigFromCLIArgs(v *viper.Viper, configAndStacksInfo *schema.ConfigAndStacksInfo, atmosConfig *schema.AtmosConfiguration) error {
 	log.Debug("loading config from command line arguments")
+
 	configFilesArgs := configAndStacksInfo.AtmosConfigFilesFromArg
 	configDirsArgs := configAndStacksInfo.AtmosConfigDirsFromArg
 	var configPaths []string
-	//merge all config from --config files
+
+	// Merge all config from --config files
 	if len(configFilesArgs) > 0 {
-		err := mergeFiles(v, configFilesArgs)
-		if err != nil {
+		if err := mergeFiles(v, configFilesArgs); err != nil {
 			return err
 		}
 		configPaths = append(configPaths, configFilesArgs...)
 	}
-	// merge config from -config-path directors
+
+	// Merge config from --config-path directories
 	if len(configDirsArgs) > 0 {
 		paths, err := mergeConfigFromDirectories(v, configDirsArgs)
 		if err != nil {
@@ -39,15 +41,16 @@ func loadConfigFromCLIArgs(v *viper.Viper, configAndStacksInfo *schema.ConfigAnd
 		configPaths = append(configPaths, paths...)
 	}
 
-	// check if any config files were found from command line arguments
+	// Check if any config files were found from command line arguments
 	if len(configPaths) == 0 {
 		log.Debug("no config files found from command line arguments")
 		return ErrAtmosArgConfigNotFound
 	}
-	err := v.Unmarshal(atmosConfig)
-	if err != nil {
+
+	if err := v.Unmarshal(atmosConfig); err != nil {
 		return err
 	}
+
 	atmosConfig.CliConfigPath = connectPaths(configPaths)
 	return nil
 }

From 0b4f71dbd03652b0b234dae53495a748079e63dc Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 25 Feb 2025 20:26:28 +0200
Subject: [PATCH 42/83] go format file

---
 pkg/config/load_config_args.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pkg/config/load_config_args.go b/pkg/config/load_config_args.go
index f8d60fa020..c54d66e57e 100644
--- a/pkg/config/load_config_args.go
+++ b/pkg/config/load_config_args.go
@@ -107,11 +107,10 @@ func mergeConfigFromDirectories(v *viper.Viper, dirPaths []string) ([]string, er
 		}
 		log.Debug(".atmos config file merged", "path", v.ConfigFileUsed())
 		configPaths = append(configPaths, confDirPath)
-
 	}
-
 	return configPaths, nil
 }
+
 func validatedIsDirs(dirPaths []string) error {
 	for _, dirPath := range dirPaths {
 		stat, err := os.Stat(dirPath)
@@ -126,6 +125,7 @@ func validatedIsDirs(dirPaths []string) error {
 	}
 	return nil
 }
+
 func validatedIsFiles(files []string) error {
 	for _, filePath := range files {
 		stat, err := os.Stat(filePath)
@@ -140,6 +140,7 @@ func validatedIsFiles(files []string) error {
 	}
 	return nil
 }
+
 func connectPaths(paths []string) string {
 	if len(paths) == 1 {
 		return paths[0]
@@ -149,5 +150,4 @@ func connectPaths(paths []string) string {
 		result += path + ";"
 	}
 	return result
-
 }

From 8afa42043ff3a12b1a9bafa9586974e15cceaf3a Mon Sep 17 00:00:00 2001
From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com>
Date: Tue, 25 Feb 2025 18:39:14 +0000
Subject: [PATCH 43/83] [autofix.ci] apply automated fixes

---
 pkg/config/load.go | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/pkg/config/load.go b/pkg/config/load.go
index 42ff07e022..0c0fe4e1a7 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -22,9 +22,7 @@ var embeddedConfigData []byte
 
 const MaximumImportLvL = 10
 
-var (
-	ErrAtmosDIrConfigNotFound = errors.New("atmos config directory not found")
-)
+var ErrAtmosDIrConfigNotFound = errors.New("atmos config directory not found")
 
 // * Embedded atmos.yaml (`atmos/pkg/config/atmos.yaml`)
 // * System dir (`/usr/local/etc/atmos` on Linux, `%LOCALAPPDATA%/atmos` on Windows).

From 1cb9623f564c2b429adeb58bee3822ba8e49ebb6 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 25 Feb 2025 22:14:37 +0200
Subject: [PATCH 44/83] disable atmos_vendor_pull

---
 tests/test-cases/demo-stacks.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/test-cases/demo-stacks.yaml b/tests/test-cases/demo-stacks.yaml
index 3fc5c07a3c..4040e1966f 100644
--- a/tests/test-cases/demo-stacks.yaml
+++ b/tests/test-cases/demo-stacks.yaml
@@ -150,7 +150,7 @@ tests:
         - "^$"
       exit_code: 0
   - name: atmos_vendor_pull
-    enabled: true
+    enabled: false # disabled until tests/fixtures/scenarios/vendor/vendor.yaml component: "my-vpc1" works correctly
     description: "Ensure atmos vendor pull command executes without errors and files are present."
     workdir: "fixtures/scenarios/vendor"
     command: "atmos"

From d4f763032aaeefe35fe6927cd80b22006e9d2202 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 25 Feb 2025 22:28:41 +0200
Subject: [PATCH 45/83] update snapshots
 Valid_Log_Level_in_Environment_Variable

---
 ..._Valid_Log_Level_in_Environment_Variable.stderr.golden | 8 ++++----
 ..._Valid_Log_Level_in_Environment_Variable.stdout.golden | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stderr.golden b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stderr.golden
index 46b3cba5e4..d3e7f0a544 100644
--- a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stderr.golden
+++ b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stderr.golden
@@ -1,8 +1,8 @@
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yaml' ('/absolute/path/to/repo/atmos.d' + '**/*.yaml')"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yml' ('/absolute/path/to/repo/atmos.d' + '**/*.yml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yaml' ('/absolute/path/to/repo/atmos.d' + '**/*.yaml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yml' ('/absolute/path/to/repo/atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yaml')"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yaml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Found ENV var ATMOS_LOGS_LEVEL=Debug
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
diff --git a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stdout.golden b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stdout.golden
index 82c26c3598..c39a129255 100644
--- a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stdout.golden
+++ b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stdout.golden
@@ -1,3 +1,3 @@
 
-👽 Atmos test on darwin/arm64
+👽 Atmos test on linux/amd64
 

From ea71b2fa10abca35cd7d911a9b09c2bfdc8a6900 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 25 Feb 2025 22:44:54 +0200
Subject: [PATCH 46/83] update snapshots

---
 ..._in_env_should_be_priortized_over_config.stderr.golden | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/snapshots/TestCLICommands_Valid_log_level_in_env_should_be_priortized_over_config.stderr.golden b/tests/snapshots/TestCLICommands_Valid_log_level_in_env_should_be_priortized_over_config.stderr.golden
index 46b3cba5e4..d3e7f0a544 100644
--- a/tests/snapshots/TestCLICommands_Valid_log_level_in_env_should_be_priortized_over_config.stderr.golden
+++ b/tests/snapshots/TestCLICommands_Valid_log_level_in_env_should_be_priortized_over_config.stderr.golden
@@ -1,8 +1,8 @@
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yaml' ('/absolute/path/to/repo/atmos.d' + '**/*.yaml')"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yml' ('/absolute/path/to/repo/atmos.d' + '**/*.yml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yaml' ('/absolute/path/to/repo/atmos.d' + '**/*.yaml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yml' ('/absolute/path/to/repo/atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yaml')"
-DEBU Error getting glob matches for path path=/absolute/path/to/repo/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yaml')"
+DEBU no matches found for glob pattern path=/absolute/path/to/repo/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Found ENV var ATMOS_LOGS_LEVEL=Debug
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false

From 483782e034c1afb93ae781064bfd3a68660a7123 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 25 Feb 2025 23:39:06 +0200
Subject: [PATCH 47/83] updates snapshots

---
 ...TestCLICommands_atmos_--help.stdout.golden | 43 +++++-----
 ...ICommands_atmos_about_--help.stdout.golden | 40 ++++++----
 ...mmands_atmos_atlantis_--help.stdout.golden | 40 ++++++----
 ...mos_atlantis_generate_--help.stdout.golden | 46 +++++++----
 ...atmos_atlantis_generate_help.stdout.golden | 46 +++++++----
 ..._generate_repo-config_--help.stdout.golden | 78 +++++++++++--------
 ...is_generate_repo-config_help.stdout.golden | 78 +++++++++++--------
 ...Commands_atmos_atlantis_help.stdout.golden | 40 ++++++----
 ...mmands_atmos_helmfile_--help.stdout.golden | 40 ++++++----
 ...ds_atmos_helmfile_apply_help.stdout.golden | 50 +++++++-----
 ...mands_atmos_terraform_--help.stdout.golden | 37 +++++----
 ...-help_alias_subcommand_check.stdout.golden | 39 ++++++----
 ...atmos_terraform_apply_--help.stdout.golden | 12 +++
 ...s_atmos_terraform_apply_help.stdout.golden | 12 +++
 ...ommands_atmos_terraform_help.stdout.golden | 37 +++++----
 ...validate_editorconfig_--help.stdout.golden | 37 +++++----
 ...s_validate_editorconfig_help.stdout.golden | 37 +++++----
 17 files changed, 441 insertions(+), 271 deletions(-)

diff --git a/tests/snapshots/TestCLICommands_atmos_--help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_--help.stdout.golden
index 203e5d92c4..40ca120649 100644
--- a/tests/snapshots/TestCLICommands_atmos_--help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_--help.stdout.golden
@@ -34,24 +34,31 @@ Subcommand Aliases:
 
 Flags:
 
-    -h, --help                      help for atmos (default "false")
-
-        --logs-file string          The file to write Atmos logs to. Logs can be
-                                    written to any file or any standard file
-                                    descriptor, including '/dev/stdout',
-                                    '/dev/stderr' and '/dev/null' (default
-                                    "/dev/stderr")
-
-        --logs-level string         Logs level. Supported log levels are Trace,
-                                    Debug, Info, Warning, Off. If the log level
-                                    is set to Off, Atmos will not log any
-                                    messages (default "Info")
-
-        --redirect-stderr string    File descriptor to redirect 'stderr' to.
-                                    Errors can be redirected to any file or any
-                                    standard file descriptor (including
-                                    '/dev/null'): atmos <command>
-                                    --redirect-stderr /dev/stdout
+        --base-path string           Base path for Atmos project
+
+        --config stringSlice         Paths to configuration file (default "[]")
+
+        --config-path stringSlice    Path to configuration directory (default
+                                     "[]")
+
+    -h, --help                       help for atmos (default "false")
+
+        --logs-file string           The file to write Atmos logs to. Logs can
+                                     be written to any file or any standard file
+                                     descriptor, including '/dev/stdout',
+                                     '/dev/stderr' and '/dev/null' (default
+                                     "/dev/stderr")
+
+        --logs-level string          Logs level. Supported log levels are Trace,
+                                     Debug, Info, Warning, Off. If the log level
+                                     is set to Off, Atmos will not log any
+                                     messages (default "Info")
+
+        --redirect-stderr string     File descriptor to redirect 'stderr' to.
+                                     Errors can be redirected to any file or any
+                                     standard file descriptor (including
+                                     '/dev/null'): atmos <command>
+                                     --redirect-stderr /dev/stdout
 
 
 Use atmos [subcommand] --help for more information about a command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
diff --git a/tests/snapshots/TestCLICommands_atmos_about_--help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_about_--help.stdout.golden
index 0322346e55..30b6bf56a9 100644
--- a/tests/snapshots/TestCLICommands_atmos_about_--help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_about_--help.stdout.golden
@@ -13,24 +13,36 @@ Flags:
 
 Global Flags:
 
-        --logs-file string          The file to write Atmos logs to. Logs can be
-                                    written to any file or any standard file
-                                    descriptor, including '/dev/stdout',
-                                    '/dev/stderr' and '/dev/null' (default
-                                    "/dev/stderr")
+        --base-path string           Base path for Atmos project
 
-        --logs-level string         Logs level. Supported log levels are Trace,
-                                    Debug, Info, Warning, Off. If the log level
-                                    is set to Off, Atmos will not log any
-                                    messages (default "Info")
+        --config stringSlice         Paths to configuration file (default "[]")
 
-        --redirect-stderr string    File descriptor to redirect 'stderr' to.
-                                    Errors can be redirected to any file or any
-                                    standard file descriptor (including
-                                    '/dev/null'): atmos <command>
-                                    --redirect-stderr /dev/stdout
+        --config-path stringSlice    Path to configuration directory (default
+                                     "[]")
+
+        --logs-file string           The file to write Atmos logs to. Logs can
+                                     be written to any file or any standard file
+                                     descriptor, including '/dev/stdout',
+                                     '/dev/stderr' and '/dev/null' (default
+                                     "/dev/stderr")
+
+        --logs-level string          Logs level. Supported log levels are Trace,
+                                     Debug, Info, Warning, Off. If the log level
+                                     is set to Off, Atmos will not log any
+                                     messages (default "Info")
+
+        --redirect-stderr string     File descriptor to redirect 'stderr' to.
+                                     Errors can be redirected to any file or any
+                                     standard file descriptor (including
+                                     '/dev/null'): atmos <command>
+                                     --redirect-stderr /dev/stdout
 
 
 Use atmos about --help for more information about a command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
 
 
+╭──────────────────────────────────────────────────────────────╮
+│               Update available! test » 1.163.0               │
+│ Atmos Releases: https://github.com/cloudposse/atmos/releases │
+│          Install Atmos: https://atmos.tools/install          │
+╰──────────────────────────────────────────────────────────────╯
diff --git a/tests/snapshots/TestCLICommands_atmos_atlantis_--help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_atlantis_--help.stdout.golden
index 94601cead5..106f002adc 100644
--- a/tests/snapshots/TestCLICommands_atmos_atlantis_--help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_atlantis_--help.stdout.golden
@@ -21,24 +21,36 @@ Flags:
 
 Global Flags:
 
-        --logs-file string          The file to write Atmos logs to. Logs can be
-                                    written to any file or any standard file
-                                    descriptor, including '/dev/stdout',
-                                    '/dev/stderr' and '/dev/null' (default
-                                    "/dev/stderr")
+        --base-path string           Base path for Atmos project
 
-        --logs-level string         Logs level. Supported log levels are Trace,
-                                    Debug, Info, Warning, Off. If the log level
-                                    is set to Off, Atmos will not log any
-                                    messages (default "Info")
+        --config stringSlice         Paths to configuration file (default "[]")
 
-        --redirect-stderr string    File descriptor to redirect 'stderr' to.
-                                    Errors can be redirected to any file or any
-                                    standard file descriptor (including
-                                    '/dev/null'): atmos <command>
-                                    --redirect-stderr /dev/stdout
+        --config-path stringSlice    Path to configuration directory (default
+                                     "[]")
+
+        --logs-file string           The file to write Atmos logs to. Logs can
+                                     be written to any file or any standard file
+                                     descriptor, including '/dev/stdout',
+                                     '/dev/stderr' and '/dev/null' (default
+                                     "/dev/stderr")
+
+        --logs-level string          Logs level. Supported log levels are Trace,
+                                     Debug, Info, Warning, Off. If the log level
+                                     is set to Off, Atmos will not log any
+                                     messages (default "Info")
+
+        --redirect-stderr string     File descriptor to redirect 'stderr' to.
+                                     Errors can be redirected to any file or any
+                                     standard file descriptor (including
+                                     '/dev/null'): atmos <command>
+                                     --redirect-stderr /dev/stdout
 
 
 Use atmos atlantis [subcommand] --help for more information about a command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
 
 
+╭──────────────────────────────────────────────────────────────╮
+│               Update available! test » 1.163.0               │
+│ Atmos Releases: https://github.com/cloudposse/atmos/releases │
+│          Install Atmos: https://atmos.tools/install          │
+╰──────────────────────────────────────────────────────────────╯
diff --git a/tests/snapshots/TestCLICommands_atmos_atlantis_generate_--help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_atlantis_generate_--help.stdout.golden
index d0e592907c..7a3ffc64e8 100644
--- a/tests/snapshots/TestCLICommands_atmos_atlantis_generate_--help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_atlantis_generate_--help.stdout.golden
@@ -29,28 +29,40 @@ Flags:
 
 Global Flags:
 
-        --                          Use double dashes to separate Atmos-specific
-                                    options from native arguments and flags for
-                                    the command.
+        --                           Use double dashes to separate
+                                     Atmos-specific options from native
+                                     arguments and flags for the command.
 
-        --logs-file string          The file to write Atmos logs to. Logs can be
-                                    written to any file or any standard file
-                                    descriptor, including '/dev/stdout',
-                                    '/dev/stderr' and '/dev/null' (default
-                                    "/dev/stderr")
+        --base-path string           Base path for Atmos project
 
-        --logs-level string         Logs level. Supported log levels are Trace,
-                                    Debug, Info, Warning, Off. If the log level
-                                    is set to Off, Atmos will not log any
-                                    messages (default "Info")
+        --config stringSlice         Paths to configuration file (default "[]")
 
-        --redirect-stderr string    File descriptor to redirect 'stderr' to.
-                                    Errors can be redirected to any file or any
-                                    standard file descriptor (including
-                                    '/dev/null'): atmos <command>
-                                    --redirect-stderr /dev/stdout
+        --config-path stringSlice    Path to configuration directory (default
+                                     "[]")
+
+        --logs-file string           The file to write Atmos logs to. Logs can
+                                     be written to any file or any standard file
+                                     descriptor, including '/dev/stdout',
+                                     '/dev/stderr' and '/dev/null' (default
+                                     "/dev/stderr")
+
+        --logs-level string          Logs level. Supported log levels are Trace,
+                                     Debug, Info, Warning, Off. If the log level
+                                     is set to Off, Atmos will not log any
+                                     messages (default "Info")
+
+        --redirect-stderr string     File descriptor to redirect 'stderr' to.
+                                     Errors can be redirected to any file or any
+                                     standard file descriptor (including
+                                     '/dev/null'): atmos <command>
+                                     --redirect-stderr /dev/stdout
 
 
 Use atmos atlantis generate [subcommand] --help for more information about a command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
 
 
+╭──────────────────────────────────────────────────────────────╮
+│               Update available! test » 1.163.0               │
+│ Atmos Releases: https://github.com/cloudposse/atmos/releases │
+│          Install Atmos: https://atmos.tools/install          │
+╰──────────────────────────────────────────────────────────────╯
diff --git a/tests/snapshots/TestCLICommands_atmos_atlantis_generate_help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_atlantis_generate_help.stdout.golden
index d0e592907c..7a3ffc64e8 100644
--- a/tests/snapshots/TestCLICommands_atmos_atlantis_generate_help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_atlantis_generate_help.stdout.golden
@@ -29,28 +29,40 @@ Flags:
 
 Global Flags:
 
-        --                          Use double dashes to separate Atmos-specific
-                                    options from native arguments and flags for
-                                    the command.
+        --                           Use double dashes to separate
+                                     Atmos-specific options from native
+                                     arguments and flags for the command.
 
-        --logs-file string          The file to write Atmos logs to. Logs can be
-                                    written to any file or any standard file
-                                    descriptor, including '/dev/stdout',
-                                    '/dev/stderr' and '/dev/null' (default
-                                    "/dev/stderr")
+        --base-path string           Base path for Atmos project
 
-        --logs-level string         Logs level. Supported log levels are Trace,
-                                    Debug, Info, Warning, Off. If the log level
-                                    is set to Off, Atmos will not log any
-                                    messages (default "Info")
+        --config stringSlice         Paths to configuration file (default "[]")
 
-        --redirect-stderr string    File descriptor to redirect 'stderr' to.
-                                    Errors can be redirected to any file or any
-                                    standard file descriptor (including
-                                    '/dev/null'): atmos <command>
-                                    --redirect-stderr /dev/stdout
+        --config-path stringSlice    Path to configuration directory (default
+                                     "[]")
+
+        --logs-file string           The file to write Atmos logs to. Logs can
+                                     be written to any file or any standard file
+                                     descriptor, including '/dev/stdout',
+                                     '/dev/stderr' and '/dev/null' (default
+                                     "/dev/stderr")
+
+        --logs-level string          Logs level. Supported log levels are Trace,
+                                     Debug, Info, Warning, Off. If the log level
+                                     is set to Off, Atmos will not log any
+                                     messages (default "Info")
+
+        --redirect-stderr string     File descriptor to redirect 'stderr' to.
+                                     Errors can be redirected to any file or any
+                                     standard file descriptor (including
+                                     '/dev/null'): atmos <command>
+                                     --redirect-stderr /dev/stdout
 
 
 Use atmos atlantis generate [subcommand] --help for more information about a command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
 
 
+╭──────────────────────────────────────────────────────────────╮
+│               Update available! test » 1.163.0               │
+│ Atmos Releases: https://github.com/cloudposse/atmos/releases │
+│          Install Atmos: https://atmos.tools/install          │
+╰──────────────────────────────────────────────────────────────╯
diff --git a/tests/snapshots/TestCLICommands_atmos_atlantis_generate_repo-config_--help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_atlantis_generate_repo-config_--help.stdout.golden
index 639252dcdc..97167808b2 100644
--- a/tests/snapshots/TestCLICommands_atmos_atlantis_generate_repo-config_--help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_atlantis_generate_repo-config_--help.stdout.golden
@@ -103,41 +103,53 @@ Flags:
 
 Global Flags:
 
-        --                          Use double dashes to separate Atmos-specific
-                                    options from native arguments and flags for
-                                    the command.
-
-        --clone-target-ref          Clone the target reference with which to
-                                    compare the current branch: atmos atlantis
-                                    generate repo-config --affected-only=true
-                                    --clone-target-ref=true
-                                    The flag is only used when
-                                    '--affected-only=true'
-                                    If set to 'false' (default), the target
-                                    reference will be checked out instead
-                                    This requires that the target reference is
-                                    already cloned by Git, and the information
-                                    about it exists in the '.git' directory
-                                    (default "false")
-
-        --logs-file string          The file to write Atmos logs to. Logs can be
-                                    written to any file or any standard file
-                                    descriptor, including '/dev/stdout',
-                                    '/dev/stderr' and '/dev/null' (default
-                                    "/dev/stderr")
-
-        --logs-level string         Logs level. Supported log levels are Trace,
-                                    Debug, Info, Warning, Off. If the log level
-                                    is set to Off, Atmos will not log any
-                                    messages (default "Info")
-
-        --redirect-stderr string    File descriptor to redirect 'stderr' to.
-                                    Errors can be redirected to any file or any
-                                    standard file descriptor (including
-                                    '/dev/null'): atmos <command>
-                                    --redirect-stderr /dev/stdout
+        --                           Use double dashes to separate
+                                     Atmos-specific options from native
+                                     arguments and flags for the command.
+
+        --base-path string           Base path for Atmos project
+
+        --clone-target-ref           Clone the target reference with which to
+                                     compare the current branch: atmos atlantis
+                                     generate repo-config --affected-only=true
+                                     --clone-target-ref=true
+                                     The flag is only used when
+                                     '--affected-only=true'
+                                     If set to 'false' (default), the target
+                                     reference will be checked out instead
+                                     This requires that the target reference is
+                                     already cloned by Git, and the information
+                                     about it exists in the '.git' directory
+                                     (default "false")
+
+        --config stringSlice         Paths to configuration file (default "[]")
+
+        --config-path stringSlice    Path to configuration directory (default
+                                     "[]")
+
+        --logs-file string           The file to write Atmos logs to. Logs can
+                                     be written to any file or any standard file
+                                     descriptor, including '/dev/stdout',
+                                     '/dev/stderr' and '/dev/null' (default
+                                     "/dev/stderr")
+
+        --logs-level string          Logs level. Supported log levels are Trace,
+                                     Debug, Info, Warning, Off. If the log level
+                                     is set to Off, Atmos will not log any
+                                     messages (default "Info")
+
+        --redirect-stderr string     File descriptor to redirect 'stderr' to.
+                                     Errors can be redirected to any file or any
+                                     standard file descriptor (including
+                                     '/dev/null'): atmos <command>
+                                     --redirect-stderr /dev/stdout
 
 
 Use atmos atlantis generate repo-config --help for more information about a command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
 
 
+╭──────────────────────────────────────────────────────────────╮
+│               Update available! test » 1.163.0               │
+│ Atmos Releases: https://github.com/cloudposse/atmos/releases │
+│          Install Atmos: https://atmos.tools/install          │
+╰──────────────────────────────────────────────────────────────╯
diff --git a/tests/snapshots/TestCLICommands_atmos_atlantis_generate_repo-config_help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_atlantis_generate_repo-config_help.stdout.golden
index 639252dcdc..97167808b2 100644
--- a/tests/snapshots/TestCLICommands_atmos_atlantis_generate_repo-config_help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_atlantis_generate_repo-config_help.stdout.golden
@@ -103,41 +103,53 @@ Flags:
 
 Global Flags:
 
-        --                          Use double dashes to separate Atmos-specific
-                                    options from native arguments and flags for
-                                    the command.
-
-        --clone-target-ref          Clone the target reference with which to
-                                    compare the current branch: atmos atlantis
-                                    generate repo-config --affected-only=true
-                                    --clone-target-ref=true
-                                    The flag is only used when
-                                    '--affected-only=true'
-                                    If set to 'false' (default), the target
-                                    reference will be checked out instead
-                                    This requires that the target reference is
-                                    already cloned by Git, and the information
-                                    about it exists in the '.git' directory
-                                    (default "false")
-
-        --logs-file string          The file to write Atmos logs to. Logs can be
-                                    written to any file or any standard file
-                                    descriptor, including '/dev/stdout',
-                                    '/dev/stderr' and '/dev/null' (default
-                                    "/dev/stderr")
-
-        --logs-level string         Logs level. Supported log levels are Trace,
-                                    Debug, Info, Warning, Off. If the log level
-                                    is set to Off, Atmos will not log any
-                                    messages (default "Info")
-
-        --redirect-stderr string    File descriptor to redirect 'stderr' to.
-                                    Errors can be redirected to any file or any
-                                    standard file descriptor (including
-                                    '/dev/null'): atmos <command>
-                                    --redirect-stderr /dev/stdout
+        --                           Use double dashes to separate
+                                     Atmos-specific options from native
+                                     arguments and flags for the command.
+
+        --base-path string           Base path for Atmos project
+
+        --clone-target-ref           Clone the target reference with which to
+                                     compare the current branch: atmos atlantis
+                                     generate repo-config --affected-only=true
+                                     --clone-target-ref=true
+                                     The flag is only used when
+                                     '--affected-only=true'
+                                     If set to 'false' (default), the target
+                                     reference will be checked out instead
+                                     This requires that the target reference is
+                                     already cloned by Git, and the information
+                                     about it exists in the '.git' directory
+                                     (default "false")
+
+        --config stringSlice         Paths to configuration file (default "[]")
+
+        --config-path stringSlice    Path to configuration directory (default
+                                     "[]")
+
+        --logs-file string           The file to write Atmos logs to. Logs can
+                                     be written to any file or any standard file
+                                     descriptor, including '/dev/stdout',
+                                     '/dev/stderr' and '/dev/null' (default
+                                     "/dev/stderr")
+
+        --logs-level string          Logs level. Supported log levels are Trace,
+                                     Debug, Info, Warning, Off. If the log level
+                                     is set to Off, Atmos will not log any
+                                     messages (default "Info")
+
+        --redirect-stderr string     File descriptor to redirect 'stderr' to.
+                                     Errors can be redirected to any file or any
+                                     standard file descriptor (including
+                                     '/dev/null'): atmos <command>
+                                     --redirect-stderr /dev/stdout
 
 
 Use atmos atlantis generate repo-config --help for more information about a command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
 
 
+╭──────────────────────────────────────────────────────────────╮
+│               Update available! test » 1.163.0               │
+│ Atmos Releases: https://github.com/cloudposse/atmos/releases │
+│          Install Atmos: https://atmos.tools/install          │
+╰──────────────────────────────────────────────────────────────╯
diff --git a/tests/snapshots/TestCLICommands_atmos_atlantis_help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_atlantis_help.stdout.golden
index 94601cead5..106f002adc 100644
--- a/tests/snapshots/TestCLICommands_atmos_atlantis_help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_atlantis_help.stdout.golden
@@ -21,24 +21,36 @@ Flags:
 
 Global Flags:
 
-        --logs-file string          The file to write Atmos logs to. Logs can be
-                                    written to any file or any standard file
-                                    descriptor, including '/dev/stdout',
-                                    '/dev/stderr' and '/dev/null' (default
-                                    "/dev/stderr")
+        --base-path string           Base path for Atmos project
 
-        --logs-level string         Logs level. Supported log levels are Trace,
-                                    Debug, Info, Warning, Off. If the log level
-                                    is set to Off, Atmos will not log any
-                                    messages (default "Info")
+        --config stringSlice         Paths to configuration file (default "[]")
 
-        --redirect-stderr string    File descriptor to redirect 'stderr' to.
-                                    Errors can be redirected to any file or any
-                                    standard file descriptor (including
-                                    '/dev/null'): atmos <command>
-                                    --redirect-stderr /dev/stdout
+        --config-path stringSlice    Path to configuration directory (default
+                                     "[]")
+
+        --logs-file string           The file to write Atmos logs to. Logs can
+                                     be written to any file or any standard file
+                                     descriptor, including '/dev/stdout',
+                                     '/dev/stderr' and '/dev/null' (default
+                                     "/dev/stderr")
+
+        --logs-level string          Logs level. Supported log levels are Trace,
+                                     Debug, Info, Warning, Off. If the log level
+                                     is set to Off, Atmos will not log any
+                                     messages (default "Info")
+
+        --redirect-stderr string     File descriptor to redirect 'stderr' to.
+                                     Errors can be redirected to any file or any
+                                     standard file descriptor (including
+                                     '/dev/null'): atmos <command>
+                                     --redirect-stderr /dev/stdout
 
 
 Use atmos atlantis [subcommand] --help for more information about a command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
 
 
+╭──────────────────────────────────────────────────────────────╮
+│               Update available! test » 1.163.0               │
+│ Atmos Releases: https://github.com/cloudposse/atmos/releases │
+│          Install Atmos: https://atmos.tools/install          │
+╰──────────────────────────────────────────────────────────────╯
diff --git a/tests/snapshots/TestCLICommands_atmos_helmfile_--help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_helmfile_--help.stdout.golden
index 86591cb0c2..a9d766eef2 100644
--- a/tests/snapshots/TestCLICommands_atmos_helmfile_--help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_helmfile_--help.stdout.golden
@@ -32,24 +32,36 @@ Flags:
 
 Global Flags:
 
-        --logs-file string          The file to write Atmos logs to. Logs can be
-                                    written to any file or any standard file
-                                    descriptor, including '/dev/stdout',
-                                    '/dev/stderr' and '/dev/null' (default
-                                    "/dev/stderr")
+        --base-path string           Base path for Atmos project
 
-        --logs-level string         Logs level. Supported log levels are Trace,
-                                    Debug, Info, Warning, Off. If the log level
-                                    is set to Off, Atmos will not log any
-                                    messages (default "Info")
+        --config stringSlice         Paths to configuration file (default "[]")
 
-        --redirect-stderr string    File descriptor to redirect 'stderr' to.
-                                    Errors can be redirected to any file or any
-                                    standard file descriptor (including
-                                    '/dev/null'): atmos <command>
-                                    --redirect-stderr /dev/stdout
+        --config-path stringSlice    Path to configuration directory (default
+                                     "[]")
+
+        --logs-file string           The file to write Atmos logs to. Logs can
+                                     be written to any file or any standard file
+                                     descriptor, including '/dev/stdout',
+                                     '/dev/stderr' and '/dev/null' (default
+                                     "/dev/stderr")
+
+        --logs-level string          Logs level. Supported log levels are Trace,
+                                     Debug, Info, Warning, Off. If the log level
+                                     is set to Off, Atmos will not log any
+                                     messages (default "Info")
+
+        --redirect-stderr string     File descriptor to redirect 'stderr' to.
+                                     Errors can be redirected to any file or any
+                                     standard file descriptor (including
+                                     '/dev/null'): atmos <command>
+                                     --redirect-stderr /dev/stdout
 
 
 Use atmos helmfile [subcommand] --help for more information about a command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
 
 
+╭──────────────────────────────────────────────────────────────╮
+│               Update available! test » 1.163.0               │
+│ Atmos Releases: https://github.com/cloudposse/atmos/releases │
+│          Install Atmos: https://atmos.tools/install          │
+╰──────────────────────────────────────────────────────────────╯
diff --git a/tests/snapshots/TestCLICommands_atmos_helmfile_apply_help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_helmfile_apply_help.stdout.golden
index 1517f59d80..2eafb458a8 100644
--- a/tests/snapshots/TestCLICommands_atmos_helmfile_apply_help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_helmfile_apply_help.stdout.golden
@@ -14,31 +14,43 @@ Flags:
 
 Global Flags:
 
-        --                          Use double dashes to separate Atmos-specific
-                                    options from native arguments and flags for
-                                    the command.
+        --                           Use double dashes to separate
+                                     Atmos-specific options from native
+                                     arguments and flags for the command.
 
-        --logs-file string          The file to write Atmos logs to. Logs can be
-                                    written to any file or any standard file
-                                    descriptor, including '/dev/stdout',
-                                    '/dev/stderr' and '/dev/null' (default
-                                    "/dev/stderr")
+        --base-path string           Base path for Atmos project
 
-        --logs-level string         Logs level. Supported log levels are Trace,
-                                    Debug, Info, Warning, Off. If the log level
-                                    is set to Off, Atmos will not log any
-                                    messages (default "Info")
+        --config stringSlice         Paths to configuration file (default "[]")
 
-        --redirect-stderr string    File descriptor to redirect 'stderr' to.
-                                    Errors can be redirected to any file or any
-                                    standard file descriptor (including
-                                    '/dev/null'): atmos <command>
-                                    --redirect-stderr /dev/stdout
+        --config-path stringSlice    Path to configuration directory (default
+                                     "[]")
 
-    -s, --stack string              atmos helmfile <helmfile_command>
-                                    <component> -s <stack>
+        --logs-file string           The file to write Atmos logs to. Logs can
+                                     be written to any file or any standard file
+                                     descriptor, including '/dev/stdout',
+                                     '/dev/stderr' and '/dev/null' (default
+                                     "/dev/stderr")
+
+        --logs-level string          Logs level. Supported log levels are Trace,
+                                     Debug, Info, Warning, Off. If the log level
+                                     is set to Off, Atmos will not log any
+                                     messages (default "Info")
+
+        --redirect-stderr string     File descriptor to redirect 'stderr' to.
+                                     Errors can be redirected to any file or any
+                                     standard file descriptor (including
+                                     '/dev/null'): atmos <command>
+                                     --redirect-stderr /dev/stdout
+
+    -s, --stack string               atmos helmfile <helmfile_command>
+                                     <component> -s <stack>
 
 
 Use atmos helmfile apply --help for more information about a command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
 
 
+╭──────────────────────────────────────────────────────────────╮
+│               Update available! test » 1.163.0               │
+│ Atmos Releases: https://github.com/cloudposse/atmos/releases │
+│          Install Atmos: https://atmos.tools/install          │
+╰──────────────────────────────────────────────────────────────╯
diff --git a/tests/snapshots/TestCLICommands_atmos_terraform_--help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_terraform_--help.stdout.golden
index 477fda3ae7..5c38fce67c 100644
--- a/tests/snapshots/TestCLICommands_atmos_terraform_--help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_terraform_--help.stdout.golden
@@ -72,22 +72,29 @@ Flags:
 
 Global Flags:
 
-        --logs-file string          The file to write Atmos logs to. Logs can be
-                                    written to any file or any standard file
-                                    descriptor, including '/dev/stdout',
-                                    '/dev/stderr' and '/dev/null' (default
-                                    "/dev/stderr")
+        --base-path string           Base path for Atmos project
 
-        --logs-level string         Logs level. Supported log levels are Trace,
-                                    Debug, Info, Warning, Off. If the log level
-                                    is set to Off, Atmos will not log any
-                                    messages (default "Info")
+        --config stringSlice         Paths to configuration file (default "[]")
 
-        --redirect-stderr string    File descriptor to redirect 'stderr' to.
-                                    Errors can be redirected to any file or any
-                                    standard file descriptor (including
-                                    '/dev/null'): atmos <command>
-                                    --redirect-stderr /dev/stdout
+        --config-path stringSlice    Path to configuration directory (default
+                                     "[]")
+
+        --logs-file string           The file to write Atmos logs to. Logs can
+                                     be written to any file or any standard file
+                                     descriptor, including '/dev/stdout',
+                                     '/dev/stderr' and '/dev/null' (default
+                                     "/dev/stderr")
+
+        --logs-level string          Logs level. Supported log levels are Trace,
+                                     Debug, Info, Warning, Off. If the log level
+                                     is set to Off, Atmos will not log any
+                                     messages (default "Info")
+
+        --redirect-stderr string     File descriptor to redirect 'stderr' to.
+                                     Errors can be redirected to any file or any
+                                     standard file descriptor (including
+                                     '/dev/null'): atmos <command>
+                                     --redirect-stderr /dev/stdout
 
 
 Examples:
@@ -100,7 +107,7 @@ Use atmos terraform [subcommand] --help for more information about a command.
 
 
 ╭──────────────────────────────────────────────────────────────╮
-│               Update available! test » 1.161.0               │
+│               Update available! test » 1.163.0               │
 │ Atmos Releases: https://github.com/cloudposse/atmos/releases │
 │          Install Atmos: https://atmos.tools/install          │
 ╰──────────────────────────────────────────────────────────────╯
diff --git a/tests/snapshots/TestCLICommands_atmos_terraform_--help_alias_subcommand_check.stdout.golden b/tests/snapshots/TestCLICommands_atmos_terraform_--help_alias_subcommand_check.stdout.golden
index c08724b291..953db6a568 100644
--- a/tests/snapshots/TestCLICommands_atmos_terraform_--help_alias_subcommand_check.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_terraform_--help_alias_subcommand_check.stdout.golden
@@ -77,22 +77,29 @@ Flags:
 
 Global Flags:
 
-        --logs-file string          The file to write Atmos logs to. Logs can be
-                                    written to any file or any standard file
-                                    descriptor, including '/dev/stdout',
-                                    '/dev/stderr' and '/dev/null' (default
-                                    "/dev/stderr")
-
-        --logs-level string         Logs level. Supported log levels are Trace,
-                                    Debug, Info, Warning, Off. If the log level
-                                    is set to Off, Atmos will not log any
-                                    messages (default "Info")
-
-        --redirect-stderr string    File descriptor to redirect 'stderr' to.
-                                    Errors can be redirected to any file or any
-                                    standard file descriptor (including
-                                    '/dev/null'): atmos <command>
-                                    --redirect-stderr /dev/stdout
+        --base-path string           Base path for Atmos project
+
+        --config stringSlice         Paths to configuration file (default "[]")
+
+        --config-path stringSlice    Path to configuration directory (default
+                                     "[]")
+
+        --logs-file string           The file to write Atmos logs to. Logs can
+                                     be written to any file or any standard file
+                                     descriptor, including '/dev/stdout',
+                                     '/dev/stderr' and '/dev/null' (default
+                                     "/dev/stderr")
+
+        --logs-level string          Logs level. Supported log levels are Trace,
+                                     Debug, Info, Warning, Off. If the log level
+                                     is set to Off, Atmos will not log any
+                                     messages (default "Info")
+
+        --redirect-stderr string     File descriptor to redirect 'stderr' to.
+                                     Errors can be redirected to any file or any
+                                     standard file descriptor (including
+                                     '/dev/null'): atmos <command>
+                                     --redirect-stderr /dev/stdout
 
 
 Examples:
diff --git a/tests/snapshots/TestCLICommands_atmos_terraform_apply_--help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_terraform_apply_--help.stdout.golden
index 7cc55866ed..e77cdce191 100644
--- a/tests/snapshots/TestCLICommands_atmos_terraform_apply_--help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_terraform_apply_--help.stdout.golden
@@ -29,6 +29,13 @@ Global Flags:
                                       +https://atmos.tools)'. This flag works
                                       with almost all commands.
 
+        --base-path string            Base path for Atmos project
+
+        --config stringSlice          Paths to configuration file (default "[]")
+
+        --config-path stringSlice     Path to configuration directory (default
+                                      "[]")
+
         --logs-file string            The file to write Atmos logs to. Logs can
                                       be written to any file or any standard
                                       file descriptor, including '/dev/stdout',
@@ -62,3 +69,8 @@ Examples:
 Use atmos terraform apply --help for more information about a command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
 
 
+╭──────────────────────────────────────────────────────────────╮
+│               Update available! test » 1.163.0               │
+│ Atmos Releases: https://github.com/cloudposse/atmos/releases │
+│          Install Atmos: https://atmos.tools/install          │
+╰──────────────────────────────────────────────────────────────╯
diff --git a/tests/snapshots/TestCLICommands_atmos_terraform_apply_help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_terraform_apply_help.stdout.golden
index 7cc55866ed..e77cdce191 100644
--- a/tests/snapshots/TestCLICommands_atmos_terraform_apply_help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_terraform_apply_help.stdout.golden
@@ -29,6 +29,13 @@ Global Flags:
                                       +https://atmos.tools)'. This flag works
                                       with almost all commands.
 
+        --base-path string            Base path for Atmos project
+
+        --config stringSlice          Paths to configuration file (default "[]")
+
+        --config-path stringSlice     Path to configuration directory (default
+                                      "[]")
+
         --logs-file string            The file to write Atmos logs to. Logs can
                                       be written to any file or any standard
                                       file descriptor, including '/dev/stdout',
@@ -62,3 +69,8 @@ Examples:
 Use atmos terraform apply --help for more information about a command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
 
 
+╭──────────────────────────────────────────────────────────────╮
+│               Update available! test » 1.163.0               │
+│ Atmos Releases: https://github.com/cloudposse/atmos/releases │
+│          Install Atmos: https://atmos.tools/install          │
+╰──────────────────────────────────────────────────────────────╯
diff --git a/tests/snapshots/TestCLICommands_atmos_terraform_help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_terraform_help.stdout.golden
index 477fda3ae7..5c38fce67c 100644
--- a/tests/snapshots/TestCLICommands_atmos_terraform_help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_terraform_help.stdout.golden
@@ -72,22 +72,29 @@ Flags:
 
 Global Flags:
 
-        --logs-file string          The file to write Atmos logs to. Logs can be
-                                    written to any file or any standard file
-                                    descriptor, including '/dev/stdout',
-                                    '/dev/stderr' and '/dev/null' (default
-                                    "/dev/stderr")
+        --base-path string           Base path for Atmos project
 
-        --logs-level string         Logs level. Supported log levels are Trace,
-                                    Debug, Info, Warning, Off. If the log level
-                                    is set to Off, Atmos will not log any
-                                    messages (default "Info")
+        --config stringSlice         Paths to configuration file (default "[]")
 
-        --redirect-stderr string    File descriptor to redirect 'stderr' to.
-                                    Errors can be redirected to any file or any
-                                    standard file descriptor (including
-                                    '/dev/null'): atmos <command>
-                                    --redirect-stderr /dev/stdout
+        --config-path stringSlice    Path to configuration directory (default
+                                     "[]")
+
+        --logs-file string           The file to write Atmos logs to. Logs can
+                                     be written to any file or any standard file
+                                     descriptor, including '/dev/stdout',
+                                     '/dev/stderr' and '/dev/null' (default
+                                     "/dev/stderr")
+
+        --logs-level string          Logs level. Supported log levels are Trace,
+                                     Debug, Info, Warning, Off. If the log level
+                                     is set to Off, Atmos will not log any
+                                     messages (default "Info")
+
+        --redirect-stderr string     File descriptor to redirect 'stderr' to.
+                                     Errors can be redirected to any file or any
+                                     standard file descriptor (including
+                                     '/dev/null'): atmos <command>
+                                     --redirect-stderr /dev/stdout
 
 
 Examples:
@@ -100,7 +107,7 @@ Use atmos terraform [subcommand] --help for more information about a command.
 
 
 ╭──────────────────────────────────────────────────────────────╮
-│               Update available! test » 1.161.0               │
+│               Update available! test » 1.163.0               │
 │ Atmos Releases: https://github.com/cloudposse/atmos/releases │
 │          Install Atmos: https://atmos.tools/install          │
 ╰──────────────────────────────────────────────────────────────╯
diff --git a/tests/snapshots/TestCLICommands_atmos_validate_editorconfig_--help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_validate_editorconfig_--help.stdout.golden
index ad02aeb19f..cc079e4e73 100644
--- a/tests/snapshots/TestCLICommands_atmos_validate_editorconfig_--help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_validate_editorconfig_--help.stdout.golden
@@ -55,22 +55,27 @@ Flags:
 
 Global Flags:
 
-        --logs-file string          The file to write Atmos logs to. Logs can be
-                                    written to any file or any standard file
-                                    descriptor, including '/dev/stdout',
-                                    '/dev/stderr' and '/dev/null' (default
-                                    "/dev/stderr")
-
-        --logs-level string         Logs level. Supported log levels are Trace,
-                                    Debug, Info, Warning, Off. If the log level
-                                    is set to Off, Atmos will not log any
-                                    messages (default "Info")
-
-        --redirect-stderr string    File descriptor to redirect 'stderr' to.
-                                    Errors can be redirected to any file or any
-                                    standard file descriptor (including
-                                    '/dev/null'): atmos <command>
-                                    --redirect-stderr /dev/stdout
+        --base-path string           Base path for Atmos project
+
+        --config-path stringSlice    Path to configuration directory (default
+                                     "[]")
+
+        --logs-file string           The file to write Atmos logs to. Logs can
+                                     be written to any file or any standard file
+                                     descriptor, including '/dev/stdout',
+                                     '/dev/stderr' and '/dev/null' (default
+                                     "/dev/stderr")
+
+        --logs-level string          Logs level. Supported log levels are Trace,
+                                     Debug, Info, Warning, Off. If the log level
+                                     is set to Off, Atmos will not log any
+                                     messages (default "Info")
+
+        --redirect-stderr string     File descriptor to redirect 'stderr' to.
+                                     Errors can be redirected to any file or any
+                                     standard file descriptor (including
+                                     '/dev/null'): atmos <command>
+                                     --redirect-stderr /dev/stdout
 
 
 Use atmos validate editorconfig --help for more information about a command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
diff --git a/tests/snapshots/TestCLICommands_atmos_validate_editorconfig_help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_validate_editorconfig_help.stdout.golden
index ad02aeb19f..cc079e4e73 100644
--- a/tests/snapshots/TestCLICommands_atmos_validate_editorconfig_help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_validate_editorconfig_help.stdout.golden
@@ -55,22 +55,27 @@ Flags:
 
 Global Flags:
 
-        --logs-file string          The file to write Atmos logs to. Logs can be
-                                    written to any file or any standard file
-                                    descriptor, including '/dev/stdout',
-                                    '/dev/stderr' and '/dev/null' (default
-                                    "/dev/stderr")
-
-        --logs-level string         Logs level. Supported log levels are Trace,
-                                    Debug, Info, Warning, Off. If the log level
-                                    is set to Off, Atmos will not log any
-                                    messages (default "Info")
-
-        --redirect-stderr string    File descriptor to redirect 'stderr' to.
-                                    Errors can be redirected to any file or any
-                                    standard file descriptor (including
-                                    '/dev/null'): atmos <command>
-                                    --redirect-stderr /dev/stdout
+        --base-path string           Base path for Atmos project
+
+        --config-path stringSlice    Path to configuration directory (default
+                                     "[]")
+
+        --logs-file string           The file to write Atmos logs to. Logs can
+                                     be written to any file or any standard file
+                                     descriptor, including '/dev/stdout',
+                                     '/dev/stderr' and '/dev/null' (default
+                                     "/dev/stderr")
+
+        --logs-level string          Logs level. Supported log levels are Trace,
+                                     Debug, Info, Warning, Off. If the log level
+                                     is set to Off, Atmos will not log any
+                                     messages (default "Info")
+
+        --redirect-stderr string     File descriptor to redirect 'stderr' to.
+                                     Errors can be redirected to any file or any
+                                     standard file descriptor (including
+                                     '/dev/null'): atmos <command>
+                                     --redirect-stderr /dev/stdout
 
 
 Use atmos validate editorconfig --help for more information about a command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

From 729e119aa439795a8e983e99d5af1f298089c480 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 25 Feb 2025 23:53:24 +0200
Subject: [PATCH 48/83] update snapshots

---
 ..._atmos_helmfile_apply_--help.stdout.golden | 50 ++++++++++++-------
 ...Commands_atmos_helmfile_help.stdout.golden | 37 ++++++++------
 2 files changed, 53 insertions(+), 34 deletions(-)

diff --git a/tests/snapshots/TestCLICommands_atmos_helmfile_apply_--help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_helmfile_apply_--help.stdout.golden
index 1517f59d80..2eafb458a8 100644
--- a/tests/snapshots/TestCLICommands_atmos_helmfile_apply_--help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_helmfile_apply_--help.stdout.golden
@@ -14,31 +14,43 @@ Flags:
 
 Global Flags:
 
-        --                          Use double dashes to separate Atmos-specific
-                                    options from native arguments and flags for
-                                    the command.
+        --                           Use double dashes to separate
+                                     Atmos-specific options from native
+                                     arguments and flags for the command.
 
-        --logs-file string          The file to write Atmos logs to. Logs can be
-                                    written to any file or any standard file
-                                    descriptor, including '/dev/stdout',
-                                    '/dev/stderr' and '/dev/null' (default
-                                    "/dev/stderr")
+        --base-path string           Base path for Atmos project
 
-        --logs-level string         Logs level. Supported log levels are Trace,
-                                    Debug, Info, Warning, Off. If the log level
-                                    is set to Off, Atmos will not log any
-                                    messages (default "Info")
+        --config stringSlice         Paths to configuration file (default "[]")
 
-        --redirect-stderr string    File descriptor to redirect 'stderr' to.
-                                    Errors can be redirected to any file or any
-                                    standard file descriptor (including
-                                    '/dev/null'): atmos <command>
-                                    --redirect-stderr /dev/stdout
+        --config-path stringSlice    Path to configuration directory (default
+                                     "[]")
 
-    -s, --stack string              atmos helmfile <helmfile_command>
-                                    <component> -s <stack>
+        --logs-file string           The file to write Atmos logs to. Logs can
+                                     be written to any file or any standard file
+                                     descriptor, including '/dev/stdout',
+                                     '/dev/stderr' and '/dev/null' (default
+                                     "/dev/stderr")
+
+        --logs-level string          Logs level. Supported log levels are Trace,
+                                     Debug, Info, Warning, Off. If the log level
+                                     is set to Off, Atmos will not log any
+                                     messages (default "Info")
+
+        --redirect-stderr string     File descriptor to redirect 'stderr' to.
+                                     Errors can be redirected to any file or any
+                                     standard file descriptor (including
+                                     '/dev/null'): atmos <command>
+                                     --redirect-stderr /dev/stdout
+
+    -s, --stack string               atmos helmfile <helmfile_command>
+                                     <component> -s <stack>
 
 
 Use atmos helmfile apply --help for more information about a command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
 
 
+╭──────────────────────────────────────────────────────────────╮
+│               Update available! test » 1.163.0               │
+│ Atmos Releases: https://github.com/cloudposse/atmos/releases │
+│          Install Atmos: https://atmos.tools/install          │
+╰──────────────────────────────────────────────────────────────╯
diff --git a/tests/snapshots/TestCLICommands_atmos_helmfile_help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_helmfile_help.stdout.golden
index c7b95fdafa..a9d766eef2 100644
--- a/tests/snapshots/TestCLICommands_atmos_helmfile_help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_helmfile_help.stdout.golden
@@ -32,29 +32,36 @@ Flags:
 
 Global Flags:
 
-        --logs-file string          The file to write Atmos logs to. Logs can be
-                                    written to any file or any standard file
-                                    descriptor, including '/dev/stdout',
-                                    '/dev/stderr' and '/dev/null' (default
-                                    "/dev/stderr")
+        --base-path string           Base path for Atmos project
 
-        --logs-level string         Logs level. Supported log levels are Trace,
-                                    Debug, Info, Warning, Off. If the log level
-                                    is set to Off, Atmos will not log any
-                                    messages (default "Info")
+        --config stringSlice         Paths to configuration file (default "[]")
 
-        --redirect-stderr string    File descriptor to redirect 'stderr' to.
-                                    Errors can be redirected to any file or any
-                                    standard file descriptor (including
-                                    '/dev/null'): atmos <command>
-                                    --redirect-stderr /dev/stdout
+        --config-path stringSlice    Path to configuration directory (default
+                                     "[]")
+
+        --logs-file string           The file to write Atmos logs to. Logs can
+                                     be written to any file or any standard file
+                                     descriptor, including '/dev/stdout',
+                                     '/dev/stderr' and '/dev/null' (default
+                                     "/dev/stderr")
+
+        --logs-level string          Logs level. Supported log levels are Trace,
+                                     Debug, Info, Warning, Off. If the log level
+                                     is set to Off, Atmos will not log any
+                                     messages (default "Info")
+
+        --redirect-stderr string     File descriptor to redirect 'stderr' to.
+                                     Errors can be redirected to any file or any
+                                     standard file descriptor (including
+                                     '/dev/null'): atmos <command>
+                                     --redirect-stderr /dev/stdout
 
 
 Use atmos helmfile [subcommand] --help for more information about a command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
 
 
 ╭──────────────────────────────────────────────────────────────╮
-│               Update available! test » 1.160.2               │
+│               Update available! test » 1.163.0               │
 │ Atmos Releases: https://github.com/cloudposse/atmos/releases │
 │          Install Atmos: https://atmos.tools/install          │
 ╰──────────────────────────────────────────────────────────────╯

From 2ee18b981f48a504b48b2f0b409afd0e7bfea484 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 4 Mar 2025 23:36:36 +0200
Subject: [PATCH 49/83] set config path dir

---
 pkg/config/load.go | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pkg/config/load.go b/pkg/config/load.go
index ef925bff06..418c87787c 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -45,8 +45,9 @@ func LoadConfig(configAndStacksInfo *schema.ConfigAndStacksInfo) (schema.AtmosCo
 			return atmosConfig, err
 		}
 	}
-	atmosConfig.CliConfigPath = v.ConfigFileUsed()
-
+	// get dir of atmosConfigFilePath
+	atmosConfigDir := filepath.Dir(v.ConfigFileUsed())
+	atmosConfig.CliConfigPath = atmosConfigDir
 	// Set the CLI config path in the atmosConfig struct
 	if atmosConfig.CliConfigPath != "" && !filepath.IsAbs(atmosConfig.CliConfigPath) {
 		absPath, err := filepath.Abs(atmosConfig.CliConfigPath)

From 25688c64b42e870005def8e210478acb23e662ec Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Wed, 5 Mar 2025 02:39:57 +0200
Subject: [PATCH 50/83] update snapshots

---
 .../TestCLICommands_atmos_describe_config.stdout.golden        | 3 ++-
 ...TestCLICommands_atmos_describe_config_-f_yaml.stdout.golden | 1 +
 ...TestCLICommands_atmos_describe_config_imports.stdout.golden | 2 +-
 .../TestCLICommands_atmos_describe_configuration.stdout.golden | 2 +-
 4 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/snapshots/TestCLICommands_atmos_describe_config.stdout.golden b/tests/snapshots/TestCLICommands_atmos_describe_config.stdout.golden
index dc078a176a..4c58d41116 100644
--- a/tests/snapshots/TestCLICommands_atmos_describe_config.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_describe_config.stdout.golden
@@ -145,5 +145,6 @@
       "color": true
     }
   },
-  "cli_config_path": "/absolute/path/to/repo/examples/demo-stacks"
+  "cli_config_path": "/absolute/path/to/repo/examples/demo-stacks",
+  "import": null
 }
diff --git a/tests/snapshots/TestCLICommands_atmos_describe_config_-f_yaml.stdout.golden b/tests/snapshots/TestCLICommands_atmos_describe_config_-f_yaml.stdout.golden
index 2bc8dfc8a1..9f484b9904 100644
--- a/tests/snapshots/TestCLICommands_atmos_describe_config_-f_yaml.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_describe_config_-f_yaml.stdout.golden
@@ -44,4 +44,5 @@ validate:
     editorconfig:
         color: true
 cli_config_path: /absolute/path/to/repo/examples/demo-stacks
+import: []
 
diff --git a/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stdout.golden b/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stdout.golden
index 589a22c594..47fb0e4cab 100644
--- a/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stdout.golden
@@ -158,7 +158,7 @@ validate:
     editorconfig:
         format: default
         color: true
-cli_config_path: /absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.yaml
+cli_config_path: /absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports
 import:
     - https:/raw.githubusercontent.com/cloudposse/atmos/refs/heads/main/atmos.yaml
     - configs.d/**/*
diff --git a/tests/snapshots/TestCLICommands_atmos_describe_configuration.stdout.golden b/tests/snapshots/TestCLICommands_atmos_describe_configuration.stdout.golden
index ec387e5761..730d4cca82 100644
--- a/tests/snapshots/TestCLICommands_atmos_describe_configuration.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_describe_configuration.stdout.golden
@@ -56,6 +56,6 @@ default: false
 validate:
     editorconfig:
         color: true
-cli_config_path: /absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.yaml
+cli_config_path: /absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration
 import: []
 

From 351c73b71e0669630e0cdbf06b1242d9ab7c646d Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Wed, 5 Mar 2025 02:54:28 +0200
Subject: [PATCH 51/83] add processStackConfigs on config.go

---
 pkg/config/config.go | 71 +++++++++++++++++++++++++-------------------
 1 file changed, 41 insertions(+), 30 deletions(-)

diff --git a/pkg/config/config.go b/pkg/config/config.go
index 764bc5e2c5..5d16fd1309 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -93,43 +93,54 @@ func InitCliConfig(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks
 	atmosConfig.HelmfileDirAbsolutePath = helmfileDirAbsPath
 
 	if processStacks {
-		// If the specified stack name is a logical name, find all stack manifests in the provided paths
-		stackConfigFilesAbsolutePaths, stackConfigFilesRelativePaths, stackIsPhysicalPath, err := FindAllStackConfigsInPathsForStack(
-			atmosConfig,
-			configAndStacksInfo.Stack,
-			includeStackAbsPaths,
-			excludeStackAbsPaths,
-		)
-		if err != nil {
-			return atmosConfig, err
-		}
-
-		if len(stackConfigFilesAbsolutePaths) < 1 {
-			j, err := u.ConvertToYAML(includeStackAbsPaths)
+		if processStacks {
+			err = processStackConfigs(&atmosConfig, configAndStacksInfo, includeStackAbsPaths, excludeStackAbsPaths)
 			if err != nil {
 				return atmosConfig, err
 			}
-			errorMessage := fmt.Sprintf("\nno stack manifests found in the provided "+
-				"paths:\n%s\n\nCheck if `base_path`, 'stacks.base_path', 'stacks.included_paths' and 'stacks.excluded_paths' are correctly set in CLI config "+
-				"files or ENV vars.", j)
-			return atmosConfig, errors.New(errorMessage)
 		}
 
-		atmosConfig.StackConfigFilesAbsolutePaths = stackConfigFilesAbsolutePaths
-		atmosConfig.StackConfigFilesRelativePaths = stackConfigFilesRelativePaths
-
-		if stackIsPhysicalPath {
-			u.LogTrace(fmt.Sprintf("\nThe stack '%s' matches the stack manifest %s\n",
-				configAndStacksInfo.Stack,
-				stackConfigFilesRelativePaths[0]),
-			)
-			atmosConfig.StackType = "Directory"
-		} else {
-			// The stack is a logical name
-			atmosConfig.StackType = "Logical"
-		}
 	}
 
 	atmosConfig.Initialized = true
 	return atmosConfig, nil
 }
+func processStackConfigs(atmosConfig *schema.AtmosConfiguration, configAndStacksInfo schema.ConfigAndStacksInfo, includeStackAbsPaths, excludeStackAbsPaths []string) error {
+	// If the specified stack name is a logical name, find all stack manifests in the provided paths
+	stackConfigFilesAbsolutePaths, stackConfigFilesRelativePaths, stackIsPhysicalPath, err := FindAllStackConfigsInPathsForStack(
+		*atmosConfig,
+		configAndStacksInfo.Stack,
+		includeStackAbsPaths,
+		excludeStackAbsPaths,
+	)
+	if err != nil {
+		return err
+	}
+
+	if len(stackConfigFilesAbsolutePaths) < 1 {
+		j, err := u.ConvertToYAML(includeStackAbsPaths)
+		if err != nil {
+			return err
+		}
+		errorMessage := fmt.Sprintf("\nno stack manifests found in the provided "+
+			"paths:\n%s\n\nCheck if `base_path`, 'stacks.base_path', 'stacks.included_paths' and 'stacks.excluded_paths' are correctly set in CLI config "+
+			"files or ENV vars.", j)
+		return errors.New(errorMessage)
+	}
+
+	atmosConfig.StackConfigFilesAbsolutePaths = stackConfigFilesAbsolutePaths
+	atmosConfig.StackConfigFilesRelativePaths = stackConfigFilesRelativePaths
+
+	if stackIsPhysicalPath {
+		u.LogTrace(fmt.Sprintf("\nThe stack '%s' matches the stack manifest %s\n",
+			configAndStacksInfo.Stack,
+			stackConfigFilesRelativePaths[0]),
+		)
+		atmosConfig.StackType = "Directory"
+	} else {
+		// The stack is a logical name
+		atmosConfig.StackType = "Logical"
+	}
+
+	return nil
+}

From 9ab9d3c0aaef9a3ef04f24b36f06bfb6ba44487c Mon Sep 17 00:00:00 2001
From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com>
Date: Wed, 5 Mar 2025 00:58:54 +0000
Subject: [PATCH 52/83] [autofix.ci] apply automated fixes

---
 pkg/config/config.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg/config/config.go b/pkg/config/config.go
index 5d16fd1309..7478567c74 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -99,12 +99,12 @@ func InitCliConfig(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks
 				return atmosConfig, err
 			}
 		}
-
 	}
 
 	atmosConfig.Initialized = true
 	return atmosConfig, nil
 }
+
 func processStackConfigs(atmosConfig *schema.AtmosConfiguration, configAndStacksInfo schema.ConfigAndStacksInfo, includeStackAbsPaths, excludeStackAbsPaths []string) error {
 	// If the specified stack name is a logical name, find all stack manifests in the provided paths
 	stackConfigFilesAbsolutePaths, stackConfigFilesRelativePaths, stackIsPhysicalPath, err := FindAllStackConfigsInPathsForStack(

From eff1fd7c02b6df7d26552796e9dc36e3e91ac816 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Sun, 9 Mar 2025 21:44:43 +0200
Subject: [PATCH 53/83] fix linter errors config.go

---
 pkg/config/config.go | 89 ++++++++++++++++++++++++++------------------
 1 file changed, 52 insertions(+), 37 deletions(-)

diff --git a/pkg/config/config.go b/pkg/config/config.go
index 7478567c74..56b3ad16e2 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -4,6 +4,7 @@ import (
 	"fmt"
 	"path/filepath"
 
+	log "github.com/charmbracelet/log"
 	"github.com/pkg/errors"
 
 	"github.com/cloudposse/atmos/pkg/schema"
@@ -15,64 +16,89 @@ import (
 // https://dev.to/techschoolguru/load-config-from-file-environment-variables-in-golang-with-viper-2j2d
 // https://medium.com/@bnprashanth256/reading-configuration-files-and-environment-variables-in-go-golang-c2607f912b63
 func InitCliConfig(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks bool) (schema.AtmosConfiguration, error) {
-	atmosConfig, err := LoadConfig(&configAndStacksInfo)
+	atmosConfig, err := processAtmosConfigs(&configAndStacksInfo)
 	if err != nil {
 		return atmosConfig, err
 	}
-	// Process ENV vars
-	err = processEnvVars(&atmosConfig)
+	// Process the base path specified in the Terraform provider (which calls into the atmos code)
+	// This overrides all other atmos base path configs (`atmos.yaml`, ENV var `ATMOS_BASE_PATH`)
+	if configAndStacksInfo.AtmosBasePath != "" {
+		atmosConfig.BasePath = configAndStacksInfo.AtmosBasePath
+	}
+
+	// After unmarshalling, ensure AppendUserAgent is set if still empty
+	if atmosConfig.Components.Terraform.AppendUserAgent == "" {
+		atmosConfig.Components.Terraform.AppendUserAgent = fmt.Sprintf("Atmos/%s (Cloud Posse; +https://atmos.tools)", version.Version)
+	}
+
+	// Check config
+	err = checkConfig(atmosConfig, processStacks)
 	if err != nil {
 		return atmosConfig, err
 	}
 
-	// Process command-line args
-	err = processCommandLineArgs(&atmosConfig, configAndStacksInfo)
+	err = atmosConfigAbsolutePaths(&atmosConfig)
 	if err != nil {
 		return atmosConfig, err
 	}
 
-	// Process stores config
-	err = processStoreConfig(&atmosConfig)
+	if processStacks {
+		err = processStackConfigs(&atmosConfig, &configAndStacksInfo, atmosConfig.IncludeStackAbsolutePaths, atmosConfig.ExcludeStackAbsolutePaths)
+		if err != nil {
+			return atmosConfig, err
+		}
+	}
+
+	atmosConfig.Initialized = true
+	return atmosConfig, nil
+}
+
+func processAtmosConfigs(configAndStacksInfo *schema.ConfigAndStacksInfo) (schema.AtmosConfiguration, error) {
+	atmosConfig, err := LoadConfig(configAndStacksInfo)
 	if err != nil {
 		return atmosConfig, err
 	}
-
-	// Process the base path specified in the Terraform provider (which calls into the atmos code)
-	// This overrides all other atmos base path configs (`atmos.yaml`, ENV var `ATMOS_BASE_PATH`)
-	if configAndStacksInfo.AtmosBasePath != "" {
-		atmosConfig.BasePath = configAndStacksInfo.AtmosBasePath
+	// Process ENV vars
+	err = processEnvVars(&atmosConfig)
+	if err != nil {
+		return atmosConfig, err
 	}
 
-	// After unmarshalling, ensure AppendUserAgent is set if still empty
-	if atmosConfig.Components.Terraform.AppendUserAgent == "" {
-		atmosConfig.Components.Terraform.AppendUserAgent = fmt.Sprintf("Atmos/%s (Cloud Posse; +https://atmos.tools)", version.Version)
+	// Process command-line args
+	err = processCommandLineArgs(&atmosConfig, *configAndStacksInfo)
+	if err != nil {
+		return atmosConfig, err
 	}
 
-	// Check config
-	err = checkConfig(atmosConfig, processStacks)
+	// Process stores config
+	err = processStoreConfig(&atmosConfig)
 	if err != nil {
 		return atmosConfig, err
 	}
+	return atmosConfig, nil
+}
 
+// atmosConfigAbsolutePaths Convert paths to absolute path.
+func atmosConfigAbsolutePaths(atmosConfig *schema.AtmosConfiguration) error {
 	// Convert stacks base path to absolute path
 	stacksBasePath := filepath.Join(atmosConfig.BasePath, atmosConfig.Stacks.BasePath)
 	stacksBaseAbsPath, err := filepath.Abs(stacksBasePath)
 	if err != nil {
-		return atmosConfig, err
+		return err
 	}
 	atmosConfig.StacksBaseAbsolutePath = stacksBaseAbsPath
 
 	// Convert the included stack paths to absolute paths
 	includeStackAbsPaths, err := u.JoinAbsolutePathWithPaths(stacksBaseAbsPath, atmosConfig.Stacks.IncludedPaths)
 	if err != nil {
-		return atmosConfig, err
+		return err
 	}
 	atmosConfig.IncludeStackAbsolutePaths = includeStackAbsPaths
 
 	// Convert the excluded stack paths to absolute paths
 	excludeStackAbsPaths, err := u.JoinAbsolutePathWithPaths(stacksBaseAbsPath, atmosConfig.Stacks.ExcludedPaths)
 	if err != nil {
-		return atmosConfig, err
+		return err
 	}
 	atmosConfig.ExcludeStackAbsolutePaths = excludeStackAbsPaths
 
@@ -80,7 +106,7 @@ func InitCliConfig(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks
 	terraformBasePath := filepath.Join(atmosConfig.BasePath, atmosConfig.Components.Terraform.BasePath)
 	terraformDirAbsPath, err := filepath.Abs(terraformBasePath)
 	if err != nil {
-		return atmosConfig, err
+		return err
 	}
 	atmosConfig.TerraformDirAbsolutePath = terraformDirAbsPath
 
@@ -88,24 +114,14 @@ func InitCliConfig(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks
 	helmfileBasePath := filepath.Join(atmosConfig.BasePath, atmosConfig.Components.Helmfile.BasePath)
 	helmfileDirAbsPath, err := filepath.Abs(helmfileBasePath)
 	if err != nil {
-		return atmosConfig, err
+		return err
 	}
 	atmosConfig.HelmfileDirAbsolutePath = helmfileDirAbsPath
 
-	if processStacks {
-		if processStacks {
-			err = processStackConfigs(&atmosConfig, configAndStacksInfo, includeStackAbsPaths, excludeStackAbsPaths)
-			if err != nil {
-				return atmosConfig, err
-			}
-		}
-	}
-
-	atmosConfig.Initialized = true
-	return atmosConfig, nil
+	return nil
 }
 
-func processStackConfigs(atmosConfig *schema.AtmosConfiguration, configAndStacksInfo schema.ConfigAndStacksInfo, includeStackAbsPaths, excludeStackAbsPaths []string) error {
+func processStackConfigs(atmosConfig *schema.AtmosConfiguration, configAndStacksInfo *schema.ConfigAndStacksInfo, includeStackAbsPaths, excludeStackAbsPaths []string) error {
 	// If the specified stack name is a logical name, find all stack manifests in the provided paths
 	stackConfigFilesAbsolutePaths, stackConfigFilesRelativePaths, stackIsPhysicalPath, err := FindAllStackConfigsInPathsForStack(
 		*atmosConfig,
@@ -132,10 +148,9 @@ func processStackConfigs(atmosConfig *schema.AtmosConfiguration, configAndStacks
 	atmosConfig.StackConfigFilesRelativePaths = stackConfigFilesRelativePaths
 
 	if stackIsPhysicalPath {
-		u.LogTrace(fmt.Sprintf("\nThe stack '%s' matches the stack manifest %s\n",
+		log.Debug(fmt.Sprintf("\nThe stack '%s' matches the stack manifest %s\n",
 			configAndStacksInfo.Stack,
-			stackConfigFilesRelativePaths[0]),
-		)
+			stackConfigFilesRelativePaths[0]))
 		atmosConfig.StackType = "Directory"
 	} else {
 		// The stack is a logical name

From 6c661acefe22eac0b67866369c32bb4347fec226 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Sun, 9 Mar 2025 22:05:44 +0200
Subject: [PATCH 54/83] add nolint:gocritic for InitCliConfig

---
 pkg/config/config.go | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pkg/config/config.go b/pkg/config/config.go
index 56b3ad16e2..2234a1c6ef 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -15,6 +15,8 @@ import (
 // InitCliConfig finds and merges CLI configurations in the following order: system dir, home dir, current dir, ENV vars, command-line arguments
 // https://dev.to/techschoolguru/load-config-from-file-environment-variables-in-golang-with-viper-2j2d
 // https://medium.com/@bnprashanth256/reading-configuration-files-and-environment-variables-in-go-golang-c2607f912b63
+//
+//nolint:gocritic // TODO: Change configAndStacksInfo to pinter . Temporarily suppressing gocritic warnings; refactoring InitCliConfig would require extensive changes.
 func InitCliConfig(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks bool) (schema.AtmosConfiguration, error) {
 	atmosConfig, err := processAtmosConfigs(&configAndStacksInfo)
 	if err != nil {

From 60bed99da86e5a8b54e23c8e188e18b2cf1504c5 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Wed, 12 Mar 2025 20:50:53 +0200
Subject: [PATCH 55/83] fix readEnvAmosConfigPath

---
 pkg/config/load.go | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pkg/config/load.go b/pkg/config/load.go
index 418c87787c..e01c3f7117 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -166,18 +166,17 @@ func readEnvAmosConfigPath(v *viper.Viper) error {
 	if atmosPath == "" {
 		return nil
 	}
-	configFilePath := filepath.Join(atmosPath, CliConfigFileName)
-	err := mergeConfig(v, configFilePath, true)
+	err := mergeConfig(v, atmosPath, true)
 	if err != nil {
 		switch err.(type) {
 		case viper.ConfigFileNotFoundError:
-			log.Debug("config not found ENV var ATMOS_CLI_CONFIG_PATH", "file", configFilePath)
+			log.Debug("config not found ENV var ATMOS_CLI_CONFIG_PATH", "file", atmosPath)
 			return nil
 		default:
 			return err
 		}
 	}
-	log.Debug("Found config ENV", "ATMOS_CLI_CONFIG_PATH", configFilePath)
+	log.Debug("Found config ENV", "ATMOS_CLI_CONFIG_PATH", atmosPath)
 
 	return nil
 }
@@ -199,6 +198,7 @@ func readAtmosConfigCli(v *viper.Viper, atmosCliConfigPath string) error {
 
 // mergeConfig merge config from a specified path directory and process imports.return error if config file not exist .
 func mergeConfig(v *viper.Viper, path string, processImports bool) error {
+
 	v.AddConfigPath(path)
 	v.SetConfigName(CliConfigFileName)
 	err := v.MergeInConfig()

From 2cdd2b948c46145bc1dc0fa739c47ee6a721b031 Mon Sep 17 00:00:00 2001
From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com>
Date: Wed, 12 Mar 2025 18:51:44 +0000
Subject: [PATCH 56/83] [autofix.ci] apply automated fixes

---
 pkg/config/load.go | 1 -
 1 file changed, 1 deletion(-)

diff --git a/pkg/config/load.go b/pkg/config/load.go
index e01c3f7117..2af9ff3c6b 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -198,7 +198,6 @@ func readAtmosConfigCli(v *viper.Viper, atmosCliConfigPath string) error {
 
 // mergeConfig merge config from a specified path directory and process imports.return error if config file not exist .
 func mergeConfig(v *viper.Viper, path string, processImports bool) error {
-
 	v.AddConfigPath(path)
 	v.SetConfigName(CliConfigFileName)
 	err := v.MergeInConfig()

From 2742bb9fb72a60cc032320a266c12be68444255c Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Wed, 12 Mar 2025 21:15:21 +0200
Subject: [PATCH 57/83] improve log

---
 pkg/config/load.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg/config/load.go b/pkg/config/load.go
index 2af9ff3c6b..e10ff46780 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -292,7 +292,7 @@ func mergeImports(dst *viper.Viper) error {
 func preprocessAtmosYamlFunc(yamlContent []byte, v *viper.Viper) error {
 	var rootNode yaml.Node
 	if err := yaml.Unmarshal(yamlContent, &rootNode); err != nil {
-		log.Debug("failed to parse YAML", "content", yamlContent, "error", err)
+		log.Debug("failed to parse YAML", "error", err)
 		return err
 	}
 	processNode(&rootNode, v, "")

From c8accb4e23bdd238299de0c7c205714d678c2bee Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Thu, 13 Mar 2025 00:43:50 +0200
Subject: [PATCH 58/83] fix import

---
 pkg/config/load.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg/config/load.go b/pkg/config/load.go
index e10ff46780..3b7326ad9d 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -9,9 +9,9 @@ import (
 	"runtime"
 
 	log "github.com/charmbracelet/log"
+	"github.com/cloudposse/atmos/pkg/config/go-homedir"
 	"github.com/cloudposse/atmos/pkg/schema"
 	"github.com/cloudposse/atmos/pkg/version"
-	"github.com/mitchellh/go-homedir"
 	"github.com/spf13/viper"
 	"gopkg.in/yaml.v3"
 )

From a7ff480a7c263cc3fccc96ab43f3ead1003b83f1 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Sun, 16 Mar 2025 02:35:38 +0200
Subject: [PATCH 59/83] update snapshots

---
 tests/cli_test.go                                      | 10 +++++++++-
 ...ommands_atmos_describe_config_imports.stdout.golden |  4 ++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/tests/cli_test.go b/tests/cli_test.go
index 2ae70b3efc..775d7b2650 100644
--- a/tests/cli_test.go
+++ b/tests/cli_test.go
@@ -328,7 +328,15 @@ func sanitizeOutput(output string) (string, error) {
 		fixedRemainder := collapseExtraSlashes(groups[2])
 		return groups[1] + fixedRemainder
 	})
-	// 6. Remove the random number added to file name like `atmos-import-454656846`
+
+	// 6. Handle URLs in the output to ensure they are normalized.
+	//    Use a regex to find URLs and collapse extra slashes while preserving the protocol.
+	urlRegex := regexp.MustCompile(`(https?:/+[^\s]+)`)
+	result = urlRegex.ReplaceAllStringFunc(result, func(match string) string {
+		return collapseExtraSlashes(match)
+	})
+
+	// 7. Remove the random number added to file name like `atmos-import-454656846`
 	filePathRegex := regexp.MustCompile(`file_path=[^ ]+/atmos-import-\d+/atmos-import-\d+\.yaml`)
 	result = filePathRegex.ReplaceAllString(result, "file_path=/atmos-import/atmos-import.yaml")
 
diff --git a/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stdout.golden b/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stdout.golden
index 47fb0e4cab..dedd770596 100644
--- a/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stdout.golden
@@ -1,4 +1,4 @@
-base_path: ""
+base_path: ./
 components:
     terraform:
         base_path: components/terraform
@@ -160,7 +160,7 @@ validate:
         color: true
 cli_config_path: /absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports
 import:
-    - https:/raw.githubusercontent.com/cloudposse/atmos/refs/heads/main/atmos.yaml
+    - https://raw.githubusercontent.com/cloudposse/atmos/refs/heads/main/atmos.yaml
     - configs.d/**/*
     - ./logs.yaml
 

From 354878324cc78909f18a62a25d3a020646979b92 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Sun, 16 Mar 2025 05:23:49 +0200
Subject: [PATCH 60/83] fix linter error

---
 tests/cli_test.go | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tests/cli_test.go b/tests/cli_test.go
index 775d7b2650..8679eff212 100644
--- a/tests/cli_test.go
+++ b/tests/cli_test.go
@@ -332,9 +332,7 @@ func sanitizeOutput(output string) (string, error) {
 	// 6. Handle URLs in the output to ensure they are normalized.
 	//    Use a regex to find URLs and collapse extra slashes while preserving the protocol.
 	urlRegex := regexp.MustCompile(`(https?:/+[^\s]+)`)
-	result = urlRegex.ReplaceAllStringFunc(result, func(match string) string {
-		return collapseExtraSlashes(match)
-	})
+	result = urlRegex.ReplaceAllStringFunc(result, collapseExtraSlashes)
 
 	// 7. Remove the random number added to file name like `atmos-import-454656846`
 	filePathRegex := regexp.MustCompile(`file_path=[^ ]+/atmos-import-\d+/atmos-import-\d+\.yaml`)

From 76b4971703b9f6b126bd14d29679875a96e7733e Mon Sep 17 00:00:00 2001
From: "Erik Osterman (CEO @ Cloud Posse)" <erik@cloudposse.com>
Date: Sun, 16 Mar 2025 21:00:04 -0500
Subject: [PATCH 61/83] Apply suggestions from code review

---
 pkg/config/config.go | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pkg/config/config.go b/pkg/config/config.go
index 2234a1c6ef..febfbda738 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -16,7 +16,9 @@ import (
 // https://dev.to/techschoolguru/load-config-from-file-environment-variables-in-golang-with-viper-2j2d
 // https://medium.com/@bnprashanth256/reading-configuration-files-and-environment-variables-in-go-golang-c2607f912b63
 //
-//nolint:gocritic // TODO: Change configAndStacksInfo to pinter . Temporarily suppressing gocritic warnings; refactoring InitCliConfig would require extensive changes.
+// TODO: Change configAndStacksInfo to pointer. 
+// Temporarily suppressing gocritic warnings; refactoring InitCliConfig would require extensive changes.
+// nolint:gocritic
 func InitCliConfig(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks bool) (schema.AtmosConfiguration, error) {
 	atmosConfig, err := processAtmosConfigs(&configAndStacksInfo)
 	if err != nil {
@@ -80,7 +82,7 @@ func processAtmosConfigs(configAndStacksInfo *schema.ConfigAndStacksInfo) (schem
 	return atmosConfig, nil
 }
 
-// atmosConfigAbsolutePaths Convert paths to absolute path.
+// atmosConfigAbsolutePaths Converts paths to absolute paths.
 func atmosConfigAbsolutePaths(atmosConfig *schema.AtmosConfiguration) error {
 	// Convert stacks base path to absolute path
 	stacksBasePath := filepath.Join(atmosConfig.BasePath, atmosConfig.Stacks.BasePath)

From a33f5ab2d653054f9b2bc57b39810072624c8aa4 Mon Sep 17 00:00:00 2001
From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com>
Date: Mon, 17 Mar 2025 02:01:09 +0000
Subject: [PATCH 62/83] [autofix.ci] apply automated fixes

---
 pkg/config/config.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg/config/config.go b/pkg/config/config.go
index febfbda738..8855726c83 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -16,7 +16,7 @@ import (
 // https://dev.to/techschoolguru/load-config-from-file-environment-variables-in-golang-with-viper-2j2d
 // https://medium.com/@bnprashanth256/reading-configuration-files-and-environment-variables-in-go-golang-c2607f912b63
 //
-// TODO: Change configAndStacksInfo to pointer. 
+// TODO: Change configAndStacksInfo to pointer.
 // Temporarily suppressing gocritic warnings; refactoring InitCliConfig would require extensive changes.
 // nolint:gocritic
 func InitCliConfig(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks bool) (schema.AtmosConfiguration, error) {

From df9c5a6342a1eeb301744853c0ace2fb2e71e55d Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Mon, 17 Mar 2025 20:05:02 +0200
Subject: [PATCH 63/83] remove log

---
 pkg/config/imports.go | 1 -
 1 file changed, 1 deletion(-)

diff --git a/pkg/config/imports.go b/pkg/config/imports.go
index 516c8ea780..7e9bb187e5 100644
--- a/pkg/config/imports.go
+++ b/pkg/config/imports.go
@@ -376,7 +376,6 @@ func findMatchingFiles(patterns []string) ([]string, error) {
 	for _, pattern := range patterns {
 		matches, err := u.GetGlobMatches(pattern)
 		if err != nil {
-			log.Debug("no matches found for glob pattern", "path", pattern, "error", err)
 			continue
 		}
 		filePaths = append(filePaths, matches...)

From a0b0e45b8b2ddc676c5050b07afd7d30c2dee085 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Mon, 17 Mar 2025 20:05:22 +0200
Subject: [PATCH 64/83] update snap shots

---
 ...ICommands_Valid_Log_Level_in_Config_File.stderr.golden | 4 ----
 ..._Valid_Log_Level_in_Environment_Variable.stderr.golden | 4 ----
 ..._in_env_should_be_priortized_over_config.stdout.golden | 4 ----
 ...should_be_priortized_over_env_and_config.stdout.golden | 4 ----
 ..._in_env_should_be_priortized_over_config.stderr.golden | 4 ----
 ...should_be_priortized_over_env_and_config.stderr.golden | 4 ----
 ...LICommands_atmos_describe_config_imports.stderr.golden | 8 --------
 ...CLICommands_atmos_describe_configuration.stderr.golden | 4 ----
 8 files changed, 36 deletions(-)

diff --git a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden
index 915f8c6a5e..b66a791f17 100644
--- a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden
+++ b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden
@@ -1,8 +1,4 @@
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d' + '**/*.yaml')"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d' + '**/*.yaml')"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
 DEBU processStoreConfig atmosConfig.StoresConfig=map[]
diff --git a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stderr.golden b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stderr.golden
index d3e7f0a544..f874ea865a 100644
--- a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stderr.golden
+++ b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stderr.golden
@@ -1,8 +1,4 @@
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yaml' ('/absolute/path/to/repo/atmos.d' + '**/*.yaml')"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yml' ('/absolute/path/to/repo/atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yaml')"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Found ENV var ATMOS_LOGS_LEVEL=Debug
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
diff --git a/tests/snapshots/TestCLICommands_Valid_log_file_in_env_should_be_priortized_over_config.stdout.golden b/tests/snapshots/TestCLICommands_Valid_log_file_in_env_should_be_priortized_over_config.stdout.golden
index d83b307e54..9d7e3b2f49 100644
--- a/tests/snapshots/TestCLICommands_Valid_log_file_in_env_should_be_priortized_over_config.stdout.golden
+++ b/tests/snapshots/TestCLICommands_Valid_log_file_in_env_should_be_priortized_over_config.stdout.golden
@@ -1,8 +1,4 @@
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yaml' ('/absolute/path/to/repo/atmos.d' + '**/*.yaml')"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yml' ('/absolute/path/to/repo/atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yaml')"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Found ENV var ATMOS_LOGS_FILE=/dev/stdout
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
diff --git a/tests/snapshots/TestCLICommands_Valid_log_file_in_flag_should_be_priortized_over_env_and_config.stdout.golden b/tests/snapshots/TestCLICommands_Valid_log_file_in_flag_should_be_priortized_over_env_and_config.stdout.golden
index 55641114ab..4742fe97a0 100644
--- a/tests/snapshots/TestCLICommands_Valid_log_file_in_flag_should_be_priortized_over_env_and_config.stdout.golden
+++ b/tests/snapshots/TestCLICommands_Valid_log_file_in_flag_should_be_priortized_over_env_and_config.stdout.golden
@@ -1,8 +1,4 @@
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yaml' ('/absolute/path/to/repo/atmos.d' + '**/*.yaml')"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yml' ('/absolute/path/to/repo/atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yaml')"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Found ENV var ATMOS_LOGS_FILE=/dev/stderr
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
diff --git a/tests/snapshots/TestCLICommands_Valid_log_level_in_env_should_be_priortized_over_config.stderr.golden b/tests/snapshots/TestCLICommands_Valid_log_level_in_env_should_be_priortized_over_config.stderr.golden
index d3e7f0a544..f874ea865a 100644
--- a/tests/snapshots/TestCLICommands_Valid_log_level_in_env_should_be_priortized_over_config.stderr.golden
+++ b/tests/snapshots/TestCLICommands_Valid_log_level_in_env_should_be_priortized_over_config.stderr.golden
@@ -1,8 +1,4 @@
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yaml' ('/absolute/path/to/repo/atmos.d' + '**/*.yaml')"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yml' ('/absolute/path/to/repo/atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yaml')"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Found ENV var ATMOS_LOGS_LEVEL=Debug
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
diff --git a/tests/snapshots/TestCLICommands_Valid_log_level_in_flag_should_be_priortized_over_env_and_config.stderr.golden b/tests/snapshots/TestCLICommands_Valid_log_level_in_flag_should_be_priortized_over_env_and_config.stderr.golden
index 0832f4bad8..a9b1bd722e 100644
--- a/tests/snapshots/TestCLICommands_Valid_log_level_in_flag_should_be_priortized_over_env_and_config.stderr.golden
+++ b/tests/snapshots/TestCLICommands_Valid_log_level_in_flag_should_be_priortized_over_env_and_config.stderr.golden
@@ -1,8 +1,4 @@
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yaml' ('/absolute/path/to/repo/atmos.d' + '**/*.yaml')"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/atmos.d/**/*.yml' ('/absolute/path/to/repo/atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yaml')"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/.atmos.d/**/*.yml' ('/absolute/path/to/repo/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Found ENV var ATMOS_LOGS_LEVEL=Info
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
diff --git a/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stderr.golden b/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stderr.golden
index 889a57cb6c..c09b613fea 100644
--- a/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stderr.golden
+++ b/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stderr.golden
@@ -1,8 +1,4 @@
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d' + '**/*.yaml')"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d' + '**/*.yaml')"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU merged config from import import=https://raw.githubusercontent.com/cloudposse/atmos/refs/heads/main/atmos.yaml file_path=/atmos-import/atmos-import.yaml
 DEBU merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/commands.yaml
@@ -11,11 +7,7 @@ DEBU merged config from import import=/absolute/path/to/repo/tests/fixtures/scen
 DEBU merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/tools/terraform.yaml
 DEBU merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/logs.yaml file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/logs.yaml
 DEBU processStoreConfig atmosConfig.StoresConfig=map[]
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d' + '**/*.yaml')"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d' + '**/*.yaml')"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU merged config from import import=https://raw.githubusercontent.com/cloudposse/atmos/refs/heads/main/atmos.yaml file_path=/atmos-import/atmos-import.yaml
 DEBU merged config from import import=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/**/* file_path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/configs.d/commands.yaml
diff --git a/tests/snapshots/TestCLICommands_atmos_describe_configuration.stderr.golden b/tests/snapshots/TestCLICommands_atmos_describe_configuration.stderr.golden
index b8b0ea0298..4616df6952 100644
--- a/tests/snapshots/TestCLICommands_atmos_describe_configuration.stderr.golden
+++ b/tests/snapshots/TestCLICommands_atmos_describe_configuration.stderr.golden
@@ -1,5 +1,3 @@
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d' + '**/*.yaml')"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/commands.yaml
 DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/logs.yaml
@@ -7,8 +5,6 @@ DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/at
 DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/stack.yaml
 DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/tools/terraform.yaml
 DEBU processStoreConfig atmosConfig.StoresConfig=map[]
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yaml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yaml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d' + '**/*.yaml')"
-DEBU no matches found for glob pattern path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yml error="failed to find a match for the import '/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/*.yml' ('/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d' + '**/*.yml')"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/commands.yaml
 DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/logs.yaml

From 501a94b416b0809ada4e4ebbfa96f56f3d20dce9 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Mon, 17 Mar 2025 20:32:04 +0200
Subject: [PATCH 65/83] add ProcessSchemas

---
 pkg/config/config.go  | 2 ++
 pkg/config/default.go | 6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/pkg/config/config.go b/pkg/config/config.go
index 3063861430..407a20384a 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -62,6 +62,8 @@ func processAtmosConfigs(configAndStacksInfo *schema.ConfigAndStacksInfo) (schem
 	if err != nil {
 		return atmosConfig, err
 	}
+	atmosConfig.ProcessSchemas()
+
 	// Process ENV vars
 	err = processEnvVars(&atmosConfig)
 	if err != nil {
diff --git a/pkg/config/default.go b/pkg/config/default.go
index 7e29e7ada8..8227ece3ba 100644
--- a/pkg/config/default.go
+++ b/pkg/config/default.go
@@ -71,11 +71,11 @@ var (
 			File:  "/dev/stderr",
 			Level: "Info",
 		},
-		Schemas: schema.Schemas{
-			JsonSchema: schema.JsonSchema{
+		Schemas: map[string]interface{}{
+			"jsonschema": schema.ResourcePath{
 				BasePath: "stacks/schemas/jsonschema",
 			},
-			Opa: schema.Opa{
+			"opa": schema.ResourcePath{
 				BasePath: "stacks/schemas/opa",
 			},
 		},

From 2040b9e1993f8ebd7e4b4e572e66ef7795d54340 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Mon, 17 Mar 2025 20:36:55 +0200
Subject: [PATCH 66/83] resolve comments

---
 pkg/config/config.go | 3 ++-
 pkg/config/load.go   | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pkg/config/config.go b/pkg/config/config.go
index 407a20384a..7a348cfab3 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -18,7 +18,8 @@ import (
 //
 // TODO: Change configAndStacksInfo to pointer.
 // Temporarily suppressing gocritic warnings; refactoring InitCliConfig would require extensive changes.
-// nolint:gocritic
+//
+//nolint:gocritic
 func InitCliConfig(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks bool) (schema.AtmosConfiguration, error) {
 	atmosConfig, err := processAtmosConfigs(&configAndStacksInfo)
 	if err != nil {
diff --git a/pkg/config/load.go b/pkg/config/load.go
index 3b7326ad9d..e743de7d3f 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -196,7 +196,7 @@ func readAtmosConfigCli(v *viper.Viper, atmosCliConfigPath string) error {
 	return nil
 }
 
-// mergeConfig merge config from a specified path directory and process imports.return error if config file not exist .
+// mergeConfig merge config from a specified path directory and process imports. Return error if config file does not exist.
 func mergeConfig(v *viper.Viper, path string, processImports bool) error {
 	v.AddConfigPath(path)
 	v.SetConfigName(CliConfigFileName)

From f78b7b039085ab0a3a5f7c334c7a108b8edf91ec Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Mon, 17 Mar 2025 20:39:18 +0200
Subject: [PATCH 67/83] fix base path

---
 pkg/config/imports.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkg/config/imports.go b/pkg/config/imports.go
index 7e9bb187e5..dccce8f3af 100644
--- a/pkg/config/imports.go
+++ b/pkg/config/imports.go
@@ -51,7 +51,7 @@ func processConfigImports(source *schema.AtmosConfiguration, dst *viper.Viper) e
 		return nil
 	}
 	importPaths := source.Import
-	baseBath, err := filepath.Abs(source.BasePath)
+	basePath, err := filepath.Abs(source.BasePath)
 	if err != nil {
 		return err
 	}
@@ -60,7 +60,7 @@ func processConfigImports(source *schema.AtmosConfiguration, dst *viper.Viper) e
 		return err
 	}
 	defer os.RemoveAll(tempDir)
-	resolvedPaths, err := processImports(baseBath, importPaths, tempDir, 1, MaximumImportLvL)
+	resolvedPaths, err := processImports(basePath, importPaths, tempDir, 1, MaximumImportLvL)
 	if err != nil {
 		return err
 	}

From 85e3d04a2b8b38361f8a91a4cbc764c65315d9e2 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Mon, 17 Mar 2025 21:12:24 +0200
Subject: [PATCH 68/83] add doc

---
 .../docs/cli/configuration/configuration.mdx  | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/website/docs/cli/configuration/configuration.mdx b/website/docs/cli/configuration/configuration.mdx
index fc62ee03bb..fd70066c42 100644
--- a/website/docs/cli/configuration/configuration.mdx
+++ b/website/docs/cli/configuration/configuration.mdx
@@ -122,6 +122,43 @@ If Atmos does not find an `atmos.yaml` file and the default CLI config is used,
 
 What follows are all the sections of the `atmos.yaml` configuration file.
 
+## Imports
+
+Additionally, Atmos supports `imports` of other CLI configurations. Use imports to break large Atmos CLI configurations into smaller ones, such as organized by top-level section. File imports are relative to the base path (if `import`  section is set in the config). All imports are processed at the time the configuration is loaded, and then deep-merged in order, so that the last file in the list supersedes settings in the preceding imports. For an example, see [`examples/demo-atmos-cli-imports`](https://github.com/cloudposse/atmos/tree/main/examples/demo-atmos-cli-imports).
+
+:::tip Pro-Tip
+Atmos supports [POSIX-style greedy Globs](https://en.wikipedia.org/wiki/Glob_(programming)) for all file
+names/paths (double-star/globstar `**` is supported as well)
+:::
+
+Imports can be any of the following:
+- Remote URL (if `import` section is set in the config)
+- Specific Path (if `import` section is set in the config)
+- Wildcard globs (`*`), including recursive globs (`**`), can be combined (e.g., `**/*` matches all files and subfolders recursively). Only files ending in `.yml` or `.yaml` will be considered for import when using globs.
+
+For example, we can import from multiple locations like this:
+
+```yaml
+import:
+  # Load the Atmos configuration from the main branch of the 'cloudposse/atmos' repository
+  - "https://raw.githubusercontent.com/cloudposse/atmos/refs/heads/main/atmos.yaml"
+  # Then load the repository root's configuration
+  - !repo-root
+  # Then merge the configs
+  - "configs.d/**/*"
+  # Finally, override some logging settings
+  - "./logs.yaml"
+```
+Note, templated imports of Atmos configuration are not supported (unlike stacks).
+
+:::warning Be Careful with Remote Imports
+- Always use HTTPS URLs (currently correctly demonstrated in the example).
+- Verify the authenticity of remote sources.
+- Consider pinning to specific commit hashes instead of branch references
+:::
+
+Each configuration file discovered is deep-merged with the preceding configurations.
+
 ## Base Path
 
 The base path for components, stacks, workflows and validation configurations.

From c860c8941b106b97d9bbdbd0f5d8bb02be86db7c Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 18 Mar 2025 01:25:56 +0200
Subject: [PATCH 69/83] move functions to helper

---
 pkg/config/config.go | 114 ----------------------------------------
 pkg/config/helper.go | 121 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 121 insertions(+), 114 deletions(-)
 create mode 100644 pkg/config/helper.go

diff --git a/pkg/config/config.go b/pkg/config/config.go
index 7a348cfab3..c4c111e941 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -2,13 +2,8 @@ package config
 
 import (
 	"fmt"
-	"path/filepath"
-
-	log "github.com/charmbracelet/log"
-	"github.com/pkg/errors"
 
 	"github.com/cloudposse/atmos/pkg/schema"
-	u "github.com/cloudposse/atmos/pkg/utils"
 	"github.com/cloudposse/atmos/pkg/version"
 )
 
@@ -57,112 +52,3 @@ func InitCliConfig(configAndStacksInfo schema.ConfigAndStacksInfo, processStacks
 	atmosConfig.Initialized = true
 	return atmosConfig, nil
 }
-
-func processAtmosConfigs(configAndStacksInfo *schema.ConfigAndStacksInfo) (schema.AtmosConfiguration, error) {
-	atmosConfig, err := LoadConfig(configAndStacksInfo)
-	if err != nil {
-		return atmosConfig, err
-	}
-	atmosConfig.ProcessSchemas()
-
-	// Process ENV vars
-	err = processEnvVars(&atmosConfig)
-	if err != nil {
-		return atmosConfig, err
-	}
-
-	// Process command-line args
-	err = processCommandLineArgs(&atmosConfig, configAndStacksInfo)
-	if err != nil {
-		return atmosConfig, err
-	}
-
-	// Process stores config
-	err = processStoreConfig(&atmosConfig)
-	if err != nil {
-		return atmosConfig, err
-	}
-	return atmosConfig, nil
-}
-
-// atmosConfigAbsolutePaths Converts paths to absolute paths.
-func atmosConfigAbsolutePaths(atmosConfig *schema.AtmosConfiguration) error {
-	// Convert stacks base path to absolute path
-	stacksBasePath := filepath.Join(atmosConfig.BasePath, atmosConfig.Stacks.BasePath)
-	stacksBaseAbsPath, err := filepath.Abs(stacksBasePath)
-	if err != nil {
-		return err
-	}
-	atmosConfig.StacksBaseAbsolutePath = stacksBaseAbsPath
-
-	// Convert the included stack paths to absolute paths
-	includeStackAbsPaths, err := u.JoinAbsolutePathWithPaths(stacksBaseAbsPath, atmosConfig.Stacks.IncludedPaths)
-	if err != nil {
-		return err
-	}
-	atmosConfig.IncludeStackAbsolutePaths = includeStackAbsPaths
-
-	// Convert the excluded stack paths to absolute paths
-	excludeStackAbsPaths, err := u.JoinAbsolutePathWithPaths(stacksBaseAbsPath, atmosConfig.Stacks.ExcludedPaths)
-	if err != nil {
-		return err
-	}
-	atmosConfig.ExcludeStackAbsolutePaths = excludeStackAbsPaths
-
-	// Convert terraform dir to absolute path
-	terraformBasePath := filepath.Join(atmosConfig.BasePath, atmosConfig.Components.Terraform.BasePath)
-	terraformDirAbsPath, err := filepath.Abs(terraformBasePath)
-	if err != nil {
-		return err
-	}
-	atmosConfig.TerraformDirAbsolutePath = terraformDirAbsPath
-
-	// Convert helmfile dir to absolute path
-	helmfileBasePath := filepath.Join(atmosConfig.BasePath, atmosConfig.Components.Helmfile.BasePath)
-	helmfileDirAbsPath, err := filepath.Abs(helmfileBasePath)
-	if err != nil {
-		return err
-	}
-	atmosConfig.HelmfileDirAbsolutePath = helmfileDirAbsPath
-
-	return nil
-}
-
-func processStackConfigs(atmosConfig *schema.AtmosConfiguration, configAndStacksInfo *schema.ConfigAndStacksInfo, includeStackAbsPaths, excludeStackAbsPaths []string) error {
-	// If the specified stack name is a logical name, find all stack manifests in the provided paths
-	stackConfigFilesAbsolutePaths, stackConfigFilesRelativePaths, stackIsPhysicalPath, err := FindAllStackConfigsInPathsForStack(
-		*atmosConfig,
-		configAndStacksInfo.Stack,
-		includeStackAbsPaths,
-		excludeStackAbsPaths,
-	)
-	if err != nil {
-		return err
-	}
-
-	if len(stackConfigFilesAbsolutePaths) < 1 {
-		j, err := u.ConvertToYAML(includeStackAbsPaths)
-		if err != nil {
-			return err
-		}
-		errorMessage := fmt.Sprintf("\nno stack manifests found in the provided "+
-			"paths:\n%s\n\nCheck if `base_path`, 'stacks.base_path', 'stacks.included_paths' and 'stacks.excluded_paths' are correctly set in CLI config "+
-			"files or ENV vars.", j)
-		return errors.New(errorMessage)
-	}
-
-	atmosConfig.StackConfigFilesAbsolutePaths = stackConfigFilesAbsolutePaths
-	atmosConfig.StackConfigFilesRelativePaths = stackConfigFilesRelativePaths
-
-	if stackIsPhysicalPath {
-		log.Debug(fmt.Sprintf("\nThe stack '%s' matches the stack manifest %s\n",
-			configAndStacksInfo.Stack,
-			stackConfigFilesRelativePaths[0]))
-		atmosConfig.StackType = "Directory"
-	} else {
-		// The stack is a logical name
-		atmosConfig.StackType = "Logical"
-	}
-
-	return nil
-}
diff --git a/pkg/config/helper.go b/pkg/config/helper.go
new file mode 100644
index 0000000000..ac921a6f8c
--- /dev/null
+++ b/pkg/config/helper.go
@@ -0,0 +1,121 @@
+package config
+
+import (
+	"fmt"
+	"path/filepath"
+
+	u "github.com/cloudposse/atmos/pkg/utils"
+
+	log "github.com/charmbracelet/log"
+	"github.com/cloudposse/atmos/pkg/schema"
+	"github.com/pkg/errors"
+)
+
+func processAtmosConfigs(configAndStacksInfo *schema.ConfigAndStacksInfo) (schema.AtmosConfiguration, error) {
+	atmosConfig, err := LoadConfig(configAndStacksInfo)
+	if err != nil {
+		return atmosConfig, err
+	}
+	atmosConfig.ProcessSchemas()
+
+	// Process ENV vars
+	err = processEnvVars(&atmosConfig)
+	if err != nil {
+		return atmosConfig, err
+	}
+
+	// Process command-line args
+	err = processCommandLineArgs(&atmosConfig, configAndStacksInfo)
+	if err != nil {
+		return atmosConfig, err
+	}
+
+	// Process stores config
+	err = processStoreConfig(&atmosConfig)
+	if err != nil {
+		return atmosConfig, err
+	}
+	return atmosConfig, nil
+}
+
+// atmosConfigAbsolutePaths Converts paths to absolute paths.
+func atmosConfigAbsolutePaths(atmosConfig *schema.AtmosConfiguration) error {
+	// Convert stacks base path to absolute path
+	stacksBasePath := filepath.Join(atmosConfig.BasePath, atmosConfig.Stacks.BasePath)
+	stacksBaseAbsPath, err := filepath.Abs(stacksBasePath)
+	if err != nil {
+		return err
+	}
+	atmosConfig.StacksBaseAbsolutePath = stacksBaseAbsPath
+
+	// Convert the included stack paths to absolute paths
+	includeStackAbsPaths, err := u.JoinAbsolutePathWithPaths(stacksBaseAbsPath, atmosConfig.Stacks.IncludedPaths)
+	if err != nil {
+		return err
+	}
+	atmosConfig.IncludeStackAbsolutePaths = includeStackAbsPaths
+
+	// Convert the excluded stack paths to absolute paths
+	excludeStackAbsPaths, err := u.JoinAbsolutePathWithPaths(stacksBaseAbsPath, atmosConfig.Stacks.ExcludedPaths)
+	if err != nil {
+		return err
+	}
+	atmosConfig.ExcludeStackAbsolutePaths = excludeStackAbsPaths
+
+	// Convert terraform dir to absolute path
+	terraformBasePath := filepath.Join(atmosConfig.BasePath, atmosConfig.Components.Terraform.BasePath)
+	terraformDirAbsPath, err := filepath.Abs(terraformBasePath)
+	if err != nil {
+		return err
+	}
+	atmosConfig.TerraformDirAbsolutePath = terraformDirAbsPath
+
+	// Convert helmfile dir to absolute path
+	helmfileBasePath := filepath.Join(atmosConfig.BasePath, atmosConfig.Components.Helmfile.BasePath)
+	helmfileDirAbsPath, err := filepath.Abs(helmfileBasePath)
+	if err != nil {
+		return err
+	}
+	atmosConfig.HelmfileDirAbsolutePath = helmfileDirAbsPath
+
+	return nil
+}
+
+func processStackConfigs(atmosConfig *schema.AtmosConfiguration, configAndStacksInfo *schema.ConfigAndStacksInfo, includeStackAbsPaths, excludeStackAbsPaths []string) error {
+	// If the specified stack name is a logical name, find all stack manifests in the provided paths
+	stackConfigFilesAbsolutePaths, stackConfigFilesRelativePaths, stackIsPhysicalPath, err := FindAllStackConfigsInPathsForStack(
+		*atmosConfig,
+		configAndStacksInfo.Stack,
+		includeStackAbsPaths,
+		excludeStackAbsPaths,
+	)
+	if err != nil {
+		return err
+	}
+
+	if len(stackConfigFilesAbsolutePaths) < 1 {
+		j, err := u.ConvertToYAML(includeStackAbsPaths)
+		if err != nil {
+			return err
+		}
+		errorMessage := fmt.Sprintf("\nno stack manifests found in the provided "+
+			"paths:\n%s\n\nCheck if `base_path`, 'stacks.base_path', 'stacks.included_paths' and 'stacks.excluded_paths' are correctly set in CLI config "+
+			"files or ENV vars.", j)
+		return errors.New(errorMessage)
+	}
+
+	atmosConfig.StackConfigFilesAbsolutePaths = stackConfigFilesAbsolutePaths
+	atmosConfig.StackConfigFilesRelativePaths = stackConfigFilesRelativePaths
+
+	if stackIsPhysicalPath {
+		log.Debug(fmt.Sprintf("\nThe stack '%s' matches the stack manifest %s\n",
+			configAndStacksInfo.Stack,
+			stackConfigFilesRelativePaths[0]))
+		atmosConfig.StackType = "Directory"
+	} else {
+		// The stack is a logical name
+		atmosConfig.StackType = "Logical"
+	}
+
+	return nil
+}

From c936af3402274f878d5d280c68d6df7c0eb12bf5 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 18 Mar 2025 01:43:52 +0200
Subject: [PATCH 70/83] update snapshots

---
 pkg/config/config.go                          | 113 ++++++++++++++++
 pkg/config/helper.go                          | 121 ------------------
 ...ld_be_priortized_over_config.stdout.golden |   2 +-
 ...iortized_over_env_and_config.stdout.golden |   2 +-
 4 files changed, 115 insertions(+), 123 deletions(-)
 delete mode 100644 pkg/config/helper.go

diff --git a/pkg/config/config.go b/pkg/config/config.go
index 0138999913..5ec759d18f 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -3,10 +3,15 @@ package config
 import (
 	"fmt"
 	"os"
+	"path/filepath"
 	"strings"
 
+	u "github.com/cloudposse/atmos/pkg/utils"
+
+	log "github.com/charmbracelet/log"
 	"github.com/cloudposse/atmos/pkg/schema"
 	"github.com/cloudposse/atmos/pkg/version"
+	"github.com/pkg/errors"
 )
 
 // InitCliConfig finds and merges CLI configurations in the following order: system dir, home dir, current dir, ENV vars, command-line arguments
@@ -108,3 +113,111 @@ func parseFlags() map[string]string {
 	}
 	return flags
 }
+func processAtmosConfigs(configAndStacksInfo *schema.ConfigAndStacksInfo) (schema.AtmosConfiguration, error) {
+	atmosConfig, err := LoadConfig(configAndStacksInfo)
+	if err != nil {
+		return atmosConfig, err
+	}
+	atmosConfig.ProcessSchemas()
+
+	// Process ENV vars
+	err = processEnvVars(&atmosConfig)
+	if err != nil {
+		return atmosConfig, err
+	}
+
+	// Process command-line args
+	err = processCommandLineArgs(&atmosConfig, configAndStacksInfo)
+	if err != nil {
+		return atmosConfig, err
+	}
+
+	// Process stores config
+	err = processStoreConfig(&atmosConfig)
+	if err != nil {
+		return atmosConfig, err
+	}
+	return atmosConfig, nil
+}
+
+// atmosConfigAbsolutePaths Converts paths to absolute paths.
+func atmosConfigAbsolutePaths(atmosConfig *schema.AtmosConfiguration) error {
+	// Convert stacks base path to absolute path
+	stacksBasePath := filepath.Join(atmosConfig.BasePath, atmosConfig.Stacks.BasePath)
+	stacksBaseAbsPath, err := filepath.Abs(stacksBasePath)
+	if err != nil {
+		return err
+	}
+	atmosConfig.StacksBaseAbsolutePath = stacksBaseAbsPath
+
+	// Convert the included stack paths to absolute paths
+	includeStackAbsPaths, err := u.JoinAbsolutePathWithPaths(stacksBaseAbsPath, atmosConfig.Stacks.IncludedPaths)
+	if err != nil {
+		return err
+	}
+	atmosConfig.IncludeStackAbsolutePaths = includeStackAbsPaths
+
+	// Convert the excluded stack paths to absolute paths
+	excludeStackAbsPaths, err := u.JoinAbsolutePathWithPaths(stacksBaseAbsPath, atmosConfig.Stacks.ExcludedPaths)
+	if err != nil {
+		return err
+	}
+	atmosConfig.ExcludeStackAbsolutePaths = excludeStackAbsPaths
+
+	// Convert terraform dir to absolute path
+	terraformBasePath := filepath.Join(atmosConfig.BasePath, atmosConfig.Components.Terraform.BasePath)
+	terraformDirAbsPath, err := filepath.Abs(terraformBasePath)
+	if err != nil {
+		return err
+	}
+	atmosConfig.TerraformDirAbsolutePath = terraformDirAbsPath
+
+	// Convert helmfile dir to absolute path
+	helmfileBasePath := filepath.Join(atmosConfig.BasePath, atmosConfig.Components.Helmfile.BasePath)
+	helmfileDirAbsPath, err := filepath.Abs(helmfileBasePath)
+	if err != nil {
+		return err
+	}
+	atmosConfig.HelmfileDirAbsolutePath = helmfileDirAbsPath
+
+	return nil
+}
+
+func processStackConfigs(atmosConfig *schema.AtmosConfiguration, configAndStacksInfo *schema.ConfigAndStacksInfo, includeStackAbsPaths, excludeStackAbsPaths []string) error {
+	// If the specified stack name is a logical name, find all stack manifests in the provided paths
+	stackConfigFilesAbsolutePaths, stackConfigFilesRelativePaths, stackIsPhysicalPath, err := FindAllStackConfigsInPathsForStack(
+		*atmosConfig,
+		configAndStacksInfo.Stack,
+		includeStackAbsPaths,
+		excludeStackAbsPaths,
+	)
+	if err != nil {
+		return err
+	}
+
+	if len(stackConfigFilesAbsolutePaths) < 1 {
+		j, err := u.ConvertToYAML(includeStackAbsPaths)
+		if err != nil {
+			return err
+		}
+		errorMessage := fmt.Sprintf("\nno stack manifests found in the provided "+
+			"paths:\n%s\n\nCheck if `base_path`, 'stacks.base_path', 'stacks.included_paths' and 'stacks.excluded_paths' are correctly set in CLI config "+
+			"files or ENV vars.", j)
+		return errors.New(errorMessage)
+	}
+
+	atmosConfig.StackConfigFilesAbsolutePaths = stackConfigFilesAbsolutePaths
+	atmosConfig.StackConfigFilesRelativePaths = stackConfigFilesRelativePaths
+
+	if stackIsPhysicalPath {
+		log.Debug(fmt.Sprintf("\nThe stack '%s' matches the stack manifest %s\n",
+			configAndStacksInfo.Stack,
+			stackConfigFilesRelativePaths[0]))
+		atmosConfig.StackType = "Directory"
+	} else {
+		// The stack is a logical name
+		atmosConfig.StackType = "Logical"
+	}
+
+	return nil
+}
diff --git a/pkg/config/helper.go b/pkg/config/helper.go
deleted file mode 100644
index ac921a6f8c..0000000000
--- a/pkg/config/helper.go
+++ /dev/null
@@ -1,121 +0,0 @@
-package config
-
-import (
-	"fmt"
-	"path/filepath"
-
-	u "github.com/cloudposse/atmos/pkg/utils"
-
-	log "github.com/charmbracelet/log"
-	"github.com/cloudposse/atmos/pkg/schema"
-	"github.com/pkg/errors"
-)
-
-func processAtmosConfigs(configAndStacksInfo *schema.ConfigAndStacksInfo) (schema.AtmosConfiguration, error) {
-	atmosConfig, err := LoadConfig(configAndStacksInfo)
-	if err != nil {
-		return atmosConfig, err
-	}
-	atmosConfig.ProcessSchemas()
-
-	// Process ENV vars
-	err = processEnvVars(&atmosConfig)
-	if err != nil {
-		return atmosConfig, err
-	}
-
-	// Process command-line args
-	err = processCommandLineArgs(&atmosConfig, configAndStacksInfo)
-	if err != nil {
-		return atmosConfig, err
-	}
-
-	// Process stores config
-	err = processStoreConfig(&atmosConfig)
-	if err != nil {
-		return atmosConfig, err
-	}
-	return atmosConfig, nil
-}
-
-// atmosConfigAbsolutePaths Converts paths to absolute paths.
-func atmosConfigAbsolutePaths(atmosConfig *schema.AtmosConfiguration) error {
-	// Convert stacks base path to absolute path
-	stacksBasePath := filepath.Join(atmosConfig.BasePath, atmosConfig.Stacks.BasePath)
-	stacksBaseAbsPath, err := filepath.Abs(stacksBasePath)
-	if err != nil {
-		return err
-	}
-	atmosConfig.StacksBaseAbsolutePath = stacksBaseAbsPath
-
-	// Convert the included stack paths to absolute paths
-	includeStackAbsPaths, err := u.JoinAbsolutePathWithPaths(stacksBaseAbsPath, atmosConfig.Stacks.IncludedPaths)
-	if err != nil {
-		return err
-	}
-	atmosConfig.IncludeStackAbsolutePaths = includeStackAbsPaths
-
-	// Convert the excluded stack paths to absolute paths
-	excludeStackAbsPaths, err := u.JoinAbsolutePathWithPaths(stacksBaseAbsPath, atmosConfig.Stacks.ExcludedPaths)
-	if err != nil {
-		return err
-	}
-	atmosConfig.ExcludeStackAbsolutePaths = excludeStackAbsPaths
-
-	// Convert terraform dir to absolute path
-	terraformBasePath := filepath.Join(atmosConfig.BasePath, atmosConfig.Components.Terraform.BasePath)
-	terraformDirAbsPath, err := filepath.Abs(terraformBasePath)
-	if err != nil {
-		return err
-	}
-	atmosConfig.TerraformDirAbsolutePath = terraformDirAbsPath
-
-	// Convert helmfile dir to absolute path
-	helmfileBasePath := filepath.Join(atmosConfig.BasePath, atmosConfig.Components.Helmfile.BasePath)
-	helmfileDirAbsPath, err := filepath.Abs(helmfileBasePath)
-	if err != nil {
-		return err
-	}
-	atmosConfig.HelmfileDirAbsolutePath = helmfileDirAbsPath
-
-	return nil
-}
-
-func processStackConfigs(atmosConfig *schema.AtmosConfiguration, configAndStacksInfo *schema.ConfigAndStacksInfo, includeStackAbsPaths, excludeStackAbsPaths []string) error {
-	// If the specified stack name is a logical name, find all stack manifests in the provided paths
-	stackConfigFilesAbsolutePaths, stackConfigFilesRelativePaths, stackIsPhysicalPath, err := FindAllStackConfigsInPathsForStack(
-		*atmosConfig,
-		configAndStacksInfo.Stack,
-		includeStackAbsPaths,
-		excludeStackAbsPaths,
-	)
-	if err != nil {
-		return err
-	}
-
-	if len(stackConfigFilesAbsolutePaths) < 1 {
-		j, err := u.ConvertToYAML(includeStackAbsPaths)
-		if err != nil {
-			return err
-		}
-		errorMessage := fmt.Sprintf("\nno stack manifests found in the provided "+
-			"paths:\n%s\n\nCheck if `base_path`, 'stacks.base_path', 'stacks.included_paths' and 'stacks.excluded_paths' are correctly set in CLI config "+
-			"files or ENV vars.", j)
-		return errors.New(errorMessage)
-	}
-
-	atmosConfig.StackConfigFilesAbsolutePaths = stackConfigFilesAbsolutePaths
-	atmosConfig.StackConfigFilesRelativePaths = stackConfigFilesRelativePaths
-
-	if stackIsPhysicalPath {
-		log.Debug(fmt.Sprintf("\nThe stack '%s' matches the stack manifest %s\n",
-			configAndStacksInfo.Stack,
-			stackConfigFilesRelativePaths[0]))
-		atmosConfig.StackType = "Directory"
-	} else {
-		// The stack is a logical name
-		atmosConfig.StackType = "Logical"
-	}
-
-	return nil
-}
diff --git a/tests/snapshots/TestCLICommands_Valid_log_file_in_env_should_be_priortized_over_config.stdout.golden b/tests/snapshots/TestCLICommands_Valid_log_file_in_env_should_be_priortized_over_config.stdout.golden
index 21c99167de..5dddfbc733 100644
--- a/tests/snapshots/TestCLICommands_Valid_log_file_in_env_should_be_priortized_over_config.stdout.golden
+++ b/tests/snapshots/TestCLICommands_Valid_log_file_in_env_should_be_priortized_over_config.stdout.golden
@@ -1,6 +1,6 @@
+DEBU Set logs-level=debug logs-file=/dev/stdout
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU Found ENV var ATMOS_LOGS_FILE=/dev/stdout
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
 DEBU processStoreConfig atmosConfig.StoresConfig=map[]
 
diff --git a/tests/snapshots/TestCLICommands_Valid_log_file_in_flag_should_be_priortized_over_env_and_config.stdout.golden b/tests/snapshots/TestCLICommands_Valid_log_file_in_flag_should_be_priortized_over_env_and_config.stdout.golden
index dade51d1b5..5dddfbc733 100644
--- a/tests/snapshots/TestCLICommands_Valid_log_file_in_flag_should_be_priortized_over_env_and_config.stdout.golden
+++ b/tests/snapshots/TestCLICommands_Valid_log_file_in_flag_should_be_priortized_over_env_and_config.stdout.golden
@@ -1,6 +1,6 @@
+DEBU Set logs-level=debug logs-file=/dev/stdout
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU Found ENV var ATMOS_LOGS_FILE=/dev/stderr
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
 DEBU processStoreConfig atmosConfig.StoresConfig=map[]
 

From 8871f8073cd1513c5ef30319322d570b70837f9d Mon Sep 17 00:00:00 2001
From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com>
Date: Mon, 17 Mar 2025 23:44:57 +0000
Subject: [PATCH 71/83] [autofix.ci] apply automated fixes

---
 pkg/config/config.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pkg/config/config.go b/pkg/config/config.go
index 5ec759d18f..1fc4f269df 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -113,6 +113,7 @@ func parseFlags() map[string]string {
 	}
 	return flags
 }
+
 func processAtmosConfigs(configAndStacksInfo *schema.ConfigAndStacksInfo) (schema.AtmosConfiguration, error) {
 	atmosConfig, err := LoadConfig(configAndStacksInfo)
 	if err != nil {

From 29d78c2b4aa077a8dbbc6117420a92f8791031f6 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 18 Mar 2025 02:01:18 +0200
Subject: [PATCH 72/83] update snapshot

---
 ...mmands_Valid_Log_Level_in_Environment_Variable.stderr.golden | 2 +-
 ..._level_in_env_should_be_priortized_over_config.stderr.golden | 2 +-
 .../TestCLICommands_atmos_describe_config_imports.stderr.golden | 1 +
 .../TestCLICommands_atmos_describe_configuration.stderr.golden  | 1 +
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stderr.golden b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stderr.golden
index f874ea865a..5005c2a089 100644
--- a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stderr.golden
+++ b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Environment_Variable.stderr.golden
@@ -1,5 +1,5 @@
+DEBU Set logs-level=debug logs-file=/dev/stderr
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU Found ENV var ATMOS_LOGS_LEVEL=Debug
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
 DEBU processStoreConfig atmosConfig.StoresConfig=map[]
diff --git a/tests/snapshots/TestCLICommands_Valid_log_level_in_env_should_be_priortized_over_config.stderr.golden b/tests/snapshots/TestCLICommands_Valid_log_level_in_env_should_be_priortized_over_config.stderr.golden
index f874ea865a..5005c2a089 100644
--- a/tests/snapshots/TestCLICommands_Valid_log_level_in_env_should_be_priortized_over_config.stderr.golden
+++ b/tests/snapshots/TestCLICommands_Valid_log_level_in_env_should_be_priortized_over_config.stderr.golden
@@ -1,5 +1,5 @@
+DEBU Set logs-level=debug logs-file=/dev/stderr
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU Found ENV var ATMOS_LOGS_LEVEL=Debug
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
 DEBU processStoreConfig atmosConfig.StoresConfig=map[]
diff --git a/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stderr.golden b/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stderr.golden
index c09b613fea..2098e0033d 100644
--- a/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stderr.golden
+++ b/tests/snapshots/TestCLICommands_atmos_describe_config_imports.stderr.golden
@@ -1,3 +1,4 @@
+DEBU Set logs-level=debug logs-file=/dev/stderr
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-cli-imports/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU merged config from import import=https://raw.githubusercontent.com/cloudposse/atmos/refs/heads/main/atmos.yaml file_path=/atmos-import/atmos-import.yaml
diff --git a/tests/snapshots/TestCLICommands_atmos_describe_configuration.stderr.golden b/tests/snapshots/TestCLICommands_atmos_describe_configuration.stderr.golden
index 4616df6952..d483e70f2c 100644
--- a/tests/snapshots/TestCLICommands_atmos_describe_configuration.stderr.golden
+++ b/tests/snapshots/TestCLICommands_atmos_describe_configuration.stderr.golden
@@ -1,3 +1,4 @@
+DEBU Set logs-level=debug logs-file=/dev/stderr
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/commands.yaml
 DEBU atmos merged config path=/absolute/path/to/repo/tests/fixtures/scenarios/atmos-configuration/atmos.d/logs.yaml

From 2bf442b5bb6e55becfd85e0e1db8bca6600ed50c Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 18 Mar 2025 02:07:12 +0200
Subject: [PATCH 73/83] update snapshots

---
 ..._flag_should_be_priortized_over_env_and_config.stderr.golden | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/snapshots/TestCLICommands_Valid_log_level_in_flag_should_be_priortized_over_env_and_config.stderr.golden b/tests/snapshots/TestCLICommands_Valid_log_level_in_flag_should_be_priortized_over_env_and_config.stderr.golden
index f2de1de3a7..5005c2a089 100644
--- a/tests/snapshots/TestCLICommands_Valid_log_level_in_flag_should_be_priortized_over_env_and_config.stderr.golden
+++ b/tests/snapshots/TestCLICommands_Valid_log_level_in_flag_should_be_priortized_over_env_and_config.stderr.golden
@@ -1,5 +1,5 @@
+DEBU Set logs-level=debug logs-file=/dev/stderr
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
-DEBU Found ENV var ATMOS_LOGS_LEVEL=Info
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false
 DEBU processStoreConfig atmosConfig.StoresConfig=map[]

From 4b6baad2403929db8bf679fa406f01db46dc88b5 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 18 Mar 2025 02:11:10 +0200
Subject: [PATCH 74/83] update snapshots

---
 .../TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden
index b66a791f17..69dc47e147 100644
--- a/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden
+++ b/tests/snapshots/TestCLICommands_Valid_Log_Level_in_Config_File.stderr.golden
@@ -1,3 +1,4 @@
+DEBU Set logs-level=debug logs-file=/dev/stderr
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Failed to find atmos config file path=/absolute/path/to/repo/tests/fixtures/scenarios/valid-log-level/.atmos.d/**/* error="failed to find matching files: no files matching patterns found"
 DEBU Found ENV var ATMOS_VERSION_CHECK_ENABLED=false

From 2bb9e3f17022883c96218d6ef4810d68be114c26 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 18 Mar 2025 02:25:44 +0200
Subject: [PATCH 75/83] remove  repository root configuration from CLI docs

---
 website/docs/cli/configuration/configuration.mdx | 2 --
 1 file changed, 2 deletions(-)

diff --git a/website/docs/cli/configuration/configuration.mdx b/website/docs/cli/configuration/configuration.mdx
index fd70066c42..1530c86276 100644
--- a/website/docs/cli/configuration/configuration.mdx
+++ b/website/docs/cli/configuration/configuration.mdx
@@ -142,8 +142,6 @@ For example, we can import from multiple locations like this:
 import:
   # Load the Atmos configuration from the main branch of the 'cloudposse/atmos' repository
   - "https://raw.githubusercontent.com/cloudposse/atmos/refs/heads/main/atmos.yaml"
-  # Then load the repository root's configuration
-  - !repo-root
   # Then merge the configs
   - "configs.d/**/*"
   # Finally, override some logging settings

From 2444a4080a5d12c1c1713fd8f0661fac2a3a43f7 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 18 Mar 2025 20:30:02 +0200
Subject: [PATCH 76/83] update snapshots

---
 ...mands_atmos_terraform_--help.stdout.golden | 37 +++++++++++--------
 ...-help_alias_subcommand_check.stdout.golden | 37 +++++++++++--------
 ...atmos_terraform_apply_--help.stdout.golden | 13 ++-----
 ...ommands_atmos_terraform_help.stdout.golden | 37 +++++++++++--------
 4 files changed, 70 insertions(+), 54 deletions(-)

diff --git a/tests/snapshots/TestCLICommands_atmos_terraform_--help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_terraform_--help.stdout.golden
index 635068bf09..476ab68120 100644
--- a/tests/snapshots/TestCLICommands_atmos_terraform_--help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_terraform_--help.stdout.golden
@@ -73,21 +73,28 @@ Flags:
 
 Global Flags:
 
-        --logs-file string          The file to write Atmos logs to. Logs can be
-                                    written to any file or any standard file
-                                    descriptor, including /dev/stdout,
-                                    /dev/stderr and /dev/null (default
-                                    /dev/stderr)
-
-        --logs-level string         Logs level. Supported log levels are Trace,
-                                    Debug, Info, Warning, Off. If the log level
-                                    is set to Off, Atmos will not log any
-                                    messages (default Info)
-
-        --redirect-stderr string    File descriptor to redirect stderr to.
-                                    Errors can be redirected to any file or any
-                                    standard file descriptor (including
-                                    /dev/null)
+        --base-path string           Base path for Atmos project
+
+        --config stringSlice         Paths to configuration file (default [])
+
+        --config-path stringSlice    Path to configuration directory (default
+                                     [])
+
+        --logs-file string           The file to write Atmos logs to. Logs can
+                                     be written to any file or any standard file
+                                     descriptor, including '/dev/stdout',
+                                     '/dev/stderr' and '/dev/null' (default
+                                     /dev/stderr)
+
+        --logs-level string          Logs level. Supported log levels are Trace,
+                                     Debug, Info, Warning, Off. If the log level
+                                     is set to Off, Atmos will not log any
+                                     messages (default Info)
+
+        --redirect-stderr string     File descriptor to redirect stderr to.
+                                     Errors can be redirected to any file or any
+                                     standard file descriptor (including
+                                     /dev/null)
 
 
 Examples:
diff --git a/tests/snapshots/TestCLICommands_atmos_terraform_--help_alias_subcommand_check.stdout.golden b/tests/snapshots/TestCLICommands_atmos_terraform_--help_alias_subcommand_check.stdout.golden
index c59f52cce6..02f8c0c747 100644
--- a/tests/snapshots/TestCLICommands_atmos_terraform_--help_alias_subcommand_check.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_terraform_--help_alias_subcommand_check.stdout.golden
@@ -78,21 +78,28 @@ Flags:
 
 Global Flags:
 
-        --logs-file string          The file to write Atmos logs to. Logs can be
-                                    written to any file or any standard file
-                                    descriptor, including /dev/stdout,
-                                    /dev/stderr and /dev/null (default
-                                    /dev/stderr)
-
-        --logs-level string         Logs level. Supported log levels are Trace,
-                                    Debug, Info, Warning, Off. If the log level
-                                    is set to Off, Atmos will not log any
-                                    messages (default Info)
-
-        --redirect-stderr string    File descriptor to redirect stderr to.
-                                    Errors can be redirected to any file or any
-                                    standard file descriptor (including
-                                    /dev/null)
+        --base-path string           Base path for Atmos project
+
+        --config stringSlice         Paths to configuration file (default [])
+
+        --config-path stringSlice    Path to configuration directory (default
+                                     [])
+
+        --logs-file string           The file to write Atmos logs to. Logs can
+                                     be written to any file or any standard file
+                                     descriptor, including '/dev/stdout',
+                                     '/dev/stderr' and '/dev/null' (default
+                                     /dev/stderr)
+
+        --logs-level string          Logs level. Supported log levels are Trace,
+                                     Debug, Info, Warning, Off. If the log level
+                                     is set to Off, Atmos will not log any
+                                     messages (default Info)
+
+        --redirect-stderr string     File descriptor to redirect stderr to.
+                                     Errors can be redirected to any file or any
+                                     standard file descriptor (including
+                                     /dev/null)
 
 
 Examples:
diff --git a/tests/snapshots/TestCLICommands_atmos_terraform_apply_--help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_terraform_apply_--help.stdout.golden
index 8bf9d134fe..08e020aade 100644
--- a/tests/snapshots/TestCLICommands_atmos_terraform_apply_--help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_terraform_apply_--help.stdout.golden
@@ -27,15 +27,15 @@ Global Flags:
 
         --base-path string            Base path for Atmos project
 
-        --config stringSlice          Paths to configuration file (default "[]")
+        --config stringSlice          Paths to configuration file (default [])
 
         --config-path stringSlice     Path to configuration directory (default
-                                      "[]")
+                                      [])
 
         --logs-file string            The file to write Atmos logs to. Logs can
                                       be written to any file or any standard
-                                      file descriptor, including /dev/stdout,
-                                      /dev/stderr and /dev/null (default
+                                      file descriptor, including '/dev/stdout',
+                                      '/dev/stderr' and '/dev/null' (default
                                       /dev/stderr)
 
         --logs-level string           Logs level. Supported log levels are
@@ -69,8 +69,3 @@ Examples:
 Use atmos terraform apply --help for more information about a command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
 
 
-╭──────────────────────────────────────────────────────────────╮
-│               Update available! test » 1.163.0               │
-│ Atmos Releases: https://github.com/cloudposse/atmos/releases │
-│          Install Atmos: https://atmos.tools/install          │
-╰──────────────────────────────────────────────────────────────╯
diff --git a/tests/snapshots/TestCLICommands_atmos_terraform_help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_terraform_help.stdout.golden
index 635068bf09..476ab68120 100644
--- a/tests/snapshots/TestCLICommands_atmos_terraform_help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_terraform_help.stdout.golden
@@ -73,21 +73,28 @@ Flags:
 
 Global Flags:
 
-        --logs-file string          The file to write Atmos logs to. Logs can be
-                                    written to any file or any standard file
-                                    descriptor, including /dev/stdout,
-                                    /dev/stderr and /dev/null (default
-                                    /dev/stderr)
-
-        --logs-level string         Logs level. Supported log levels are Trace,
-                                    Debug, Info, Warning, Off. If the log level
-                                    is set to Off, Atmos will not log any
-                                    messages (default Info)
-
-        --redirect-stderr string    File descriptor to redirect stderr to.
-                                    Errors can be redirected to any file or any
-                                    standard file descriptor (including
-                                    /dev/null)
+        --base-path string           Base path for Atmos project
+
+        --config stringSlice         Paths to configuration file (default [])
+
+        --config-path stringSlice    Path to configuration directory (default
+                                     [])
+
+        --logs-file string           The file to write Atmos logs to. Logs can
+                                     be written to any file or any standard file
+                                     descriptor, including '/dev/stdout',
+                                     '/dev/stderr' and '/dev/null' (default
+                                     /dev/stderr)
+
+        --logs-level string          Logs level. Supported log levels are Trace,
+                                     Debug, Info, Warning, Off. If the log level
+                                     is set to Off, Atmos will not log any
+                                     messages (default Info)
+
+        --redirect-stderr string     File descriptor to redirect stderr to.
+                                     Errors can be redirected to any file or any
+                                     standard file descriptor (including
+                                     /dev/null)
 
 
 Examples:

From 751240cfa13fa177af6ef3d5df5eba599cb72089 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 18 Mar 2025 21:00:27 +0200
Subject: [PATCH 77/83] update doc

---
 pkg/config/load_config_args.go                      |  2 +-
 ...ommands_atmos_terraform_apply_help.stdout.golden | 13 ++++---------
 website/docs/cli/configuration/configuration.mdx    | 11 ++++++++++-
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/pkg/config/load_config_args.go b/pkg/config/load_config_args.go
index c54d66e57e..c1775ea83b 100644
--- a/pkg/config/load_config_args.go
+++ b/pkg/config/load_config_args.go
@@ -16,7 +16,7 @@ var (
 	ErrAtmosArgConfigNotFound = errors.New("atmos configuration not found")
 )
 
-// loadConfigFromCLIArgs handles the loading of configurations provided via --config-path.
+// loadConfigFromCLIArgs handles the loading of configurations provided via --config-path and --config.
 func loadConfigFromCLIArgs(v *viper.Viper, configAndStacksInfo *schema.ConfigAndStacksInfo, atmosConfig *schema.AtmosConfiguration) error {
 	log.Debug("loading config from command line arguments")
 
diff --git a/tests/snapshots/TestCLICommands_atmos_terraform_apply_help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_terraform_apply_help.stdout.golden
index 8bf9d134fe..08e020aade 100644
--- a/tests/snapshots/TestCLICommands_atmos_terraform_apply_help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_terraform_apply_help.stdout.golden
@@ -27,15 +27,15 @@ Global Flags:
 
         --base-path string            Base path for Atmos project
 
-        --config stringSlice          Paths to configuration file (default "[]")
+        --config stringSlice          Paths to configuration file (default [])
 
         --config-path stringSlice     Path to configuration directory (default
-                                      "[]")
+                                      [])
 
         --logs-file string            The file to write Atmos logs to. Logs can
                                       be written to any file or any standard
-                                      file descriptor, including /dev/stdout,
-                                      /dev/stderr and /dev/null (default
+                                      file descriptor, including '/dev/stdout',
+                                      '/dev/stderr' and '/dev/null' (default
                                       /dev/stderr)
 
         --logs-level string           Logs level. Supported log levels are
@@ -69,8 +69,3 @@ Examples:
 Use atmos terraform apply --help for more information about a command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
 
 
-╭──────────────────────────────────────────────────────────────╮
-│               Update available! test » 1.163.0               │
-│ Atmos Releases: https://github.com/cloudposse/atmos/releases │
-│          Install Atmos: https://atmos.tools/install          │
-╰──────────────────────────────────────────────────────────────╯
diff --git a/website/docs/cli/configuration/configuration.mdx b/website/docs/cli/configuration/configuration.mdx
index 1530c86276..43d531eba3 100644
--- a/website/docs/cli/configuration/configuration.mdx
+++ b/website/docs/cli/configuration/configuration.mdx
@@ -26,7 +26,16 @@ you'd specify the command to run (e.g. [`opentofu`](/core-concepts/projects/conf
 the base path location of the components, and so forth.
 
 ## Configuration File (`atmos.yaml`)
-
+The --config flag allows you to specify a relative or absolute path to a valid configuration file. Only the configuration files specified by this flag will be loaded.
+The --config-path flag designates a directory containing Atmos configuration files (atmos, .atmos). Only files from the specified directory will be loaded.
+You can use both --config and --config-path multiple times in a single command. Configurations will be deep-merged in the order provided, 
+with the first specified config having the lowest priority and the last one having the highest. This allows later configurations to override settings from earlier ones.
+For example, to load multiple configuration files, you would run:
+  ```bash
+    atmos --config /path/to/config1.yaml --config /path/to/config2.yaml --config-path /path/first/config/ -config-path /path/second/config/ ...
+  ```
+Configuration Load Order
+If --config and --config-path not specified in command
 The CLI config is loaded from the following locations (from lowest to highest priority):
 
 - System directory (`/usr/local/etc/atmos/atmos.yaml` on Linux, `%LOCALAPPDATA%/atmos/atmos.yaml` on Windows)

From ff38c5943ec4bb4802e28d8e7c82792dce53a86b Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 18 Mar 2025 21:15:48 +0200
Subject: [PATCH 78/83] update snapshot

---
 ...TestCLICommands_atmos_--help.stdout.golden | 36 +++++++++++--------
 1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/tests/snapshots/TestCLICommands_atmos_--help.stdout.golden b/tests/snapshots/TestCLICommands_atmos_--help.stdout.golden
index ec97c7bc92..181623f185 100644
--- a/tests/snapshots/TestCLICommands_atmos_--help.stdout.golden
+++ b/tests/snapshots/TestCLICommands_atmos_--help.stdout.golden
@@ -34,26 +34,32 @@ Subcommand Aliases:
 
 Flags:
 
-    -h, --help                      help for atmos
+        --base-path string           Base path for Atmos project
 
-        --logs-file string          The file to write Atmos logs to. Logs can be
-                                    written to any file or any standard file
-                                    descriptor, including /dev/stdout,
-                                    /dev/stderr and /dev/null (default
-                                    /dev/stderr)
+        --config stringSlice         Paths to configuration file (default [])
 
-        --logs-level string         Logs level. Supported log levels are Trace,
-                                    Debug, Info, Warning, Off. If the log level
-                                    is set to Off, Atmos will not log any
-                                    messages (default Info)
+        --config-path stringSlice    Path to configuration directory (default
+                                     [])
 
-        --redirect-stderr string    File descriptor to redirect stderr to.
-                                    Errors can be redirected to any file or any
-                                    standard file descriptor (including
-                                    /dev/null)
+    -h, --help                       help for atmos
 
+        --logs-file string           The file to write Atmos logs to. Logs can
+                                     be written to any file or any standard file
+                                     descriptor, including '/dev/stdout',
+                                     '/dev/stderr' and '/dev/null' (default
+                                     /dev/stderr)
 
-Use atmos [subcommand] --help for more information about a command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
+        --logs-level string          Logs level. Supported log levels are Trace,
+                                     Debug, Info, Warning, Off. If the log level
+                                     is set to Off, Atmos will not log any
+                                     messages (default Info)
+
+        --redirect-stderr string     File descriptor to redirect stderr to.
+                                     Errors can be redirected to any file or any
+                                     standard file descriptor (including
+                                     /dev/null)
 
 
+Use atmos [subcommand] --help for more information about a command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
+
 

From fe627ac08896c9ac64875ec12038472e9c28b0f0 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 18 Mar 2025 21:35:30 +0200
Subject: [PATCH 79/83] fix test TestExecuteVendorPullCommand

---
 internal/exec/vendor_utils_test.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/internal/exec/vendor_utils_test.go b/internal/exec/vendor_utils_test.go
index b9247843f1..a1365e991a 100644
--- a/internal/exec/vendor_utils_test.go
+++ b/internal/exec/vendor_utils_test.go
@@ -48,7 +48,9 @@ func TestExecuteVendorPullCommand(t *testing.T) {
 	cmd.PersistentFlags().Bool("dry-run", false, "Simulate pulling the latest version of the specified component from the remote repository without making any changes.")
 	cmd.PersistentFlags().String("tags", "", "Only vendor the components that have the specified tags")
 	cmd.PersistentFlags().Bool("everything", false, "Vendor all components")
-
+	cmd.PersistentFlags().String("base-path", "", "Base path for Atmos project")
+	cmd.PersistentFlags().StringSlice("config", []string{}, "Paths to configuration file")
+	cmd.PersistentFlags().StringSlice("config-path", []string{}, "Path to configuration directory")
 	// Execute the command
 	err = cmd.RunE(cmd, []string{})
 	assert.NoError(t, err, "'atmos vendor pull' command should execute without error")

From 4b3c1cb8a921e776b6b1a49db9ff4946ae09a6c7 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 18 Mar 2025 21:45:22 +0200
Subject: [PATCH 80/83] fix tests TestExecuteWorkflowCmd,TestExecuteVendorPull

---
 internal/exec/vendor_utils_test.go | 3 +++
 internal/exec/workflow_test.go     | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/internal/exec/vendor_utils_test.go b/internal/exec/vendor_utils_test.go
index a1365e991a..c79e3f27c1 100644
--- a/internal/exec/vendor_utils_test.go
+++ b/internal/exec/vendor_utils_test.go
@@ -105,6 +105,9 @@ func TestExecuteVendorPull(t *testing.T) {
 	}
 	// set vendor pull command
 	cmd := cobra.Command{}
+	cmd.PersistentFlags().String("base-path", "", "Base path for Atmos project")
+	cmd.PersistentFlags().StringSlice("config", []string{}, "Paths to configuration file")
+	cmd.PersistentFlags().StringSlice("config-path", []string{}, "Path to configuration directory")
 	flags := cmd.Flags()
 	flags.String("component", "", "")
 	flags.String("stack", "", "")
diff --git a/internal/exec/workflow_test.go b/internal/exec/workflow_test.go
index 6089af05c7..899c6720d4 100644
--- a/internal/exec/workflow_test.go
+++ b/internal/exec/workflow_test.go
@@ -55,7 +55,9 @@ atmos describe component c1 -s test
 	cmd.PersistentFlags().Bool("dry-run", false, "Simulate the workflow without making any changes")
 	cmd.PersistentFlags().String("from-step", "", "Resume the workflow from the specified step")
 	cmd.PersistentFlags().String("stack", "", "Execute the workflow for the specified stack")
-
+	cmd.PersistentFlags().String("base-path", "", "Base path for Atmos project")
+	cmd.PersistentFlags().StringSlice("config", []string{}, "Paths to configuration file")
+	cmd.PersistentFlags().StringSlice("config-path", []string{}, "Path to configuration directory")
 	// Execute the command
 	cmd.SetArgs([]string{"--file", "workflows", "show-all-describe-component-commands"})
 	err = cmd.Execute()

From bf346ea25317a8048c7ebaecd1b6d2c15938a8a9 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Tue, 18 Mar 2025 22:59:37 +0200
Subject: [PATCH 81/83] add test cases

---
 pkg/config/load_config_args.go |  17 ++--
 pkg/config/load_config_test.go | 146 +++++++++++++++++++++++++++++++++
 2 files changed, 156 insertions(+), 7 deletions(-)
 create mode 100644 pkg/config/load_config_test.go

diff --git a/pkg/config/load_config_args.go b/pkg/config/load_config_args.go
index c1775ea83b..da6a316475 100644
--- a/pkg/config/load_config_args.go
+++ b/pkg/config/load_config_args.go
@@ -2,7 +2,9 @@ package config
 
 import (
 	"errors"
+	"fmt"
 	"os"
+	"path/filepath"
 
 	log "github.com/charmbracelet/log"
 	"github.com/cloudposse/atmos/pkg/schema"
@@ -10,10 +12,11 @@ import (
 )
 
 var (
-	ErrExpectedDirOrPattern   = errors.New("--config-path expected directory found file")
-	ErrFileNotFound           = errors.New("file not found")
-	ErrExpectedFile           = errors.New("--config expected file found directory")
-	ErrAtmosArgConfigNotFound = errors.New("atmos configuration not found")
+	ErrExpectedDirOrPattern        = errors.New("--config-path expected directory found file")
+	ErrFileNotFound                = errors.New("file not found")
+	ErrExpectedFile                = errors.New("--config expected file found directory")
+	ErrAtmosArgConfigNotFound      = errors.New("atmos configuration not found")
+	ErrAtmosFilesDIrConfigNotFound = errors.New("`atmos.yaml` or `.atmos.yaml` configuration  file not found on directory")
 )
 
 // loadConfigFromCLIArgs handles the loading of configurations provided via --config-path and --config.
@@ -90,7 +93,7 @@ func mergeConfigFromDirectories(v *viper.Viper, dirPaths []string) ([]string, er
 			log.Debug("Failed to find atmos config", "path", confDirPath, "error", err)
 			switch err.(type) {
 			case viper.ConfigFileNotFoundError:
-				log.Debug("Failed to found atmos config", "file", v.ConfigFileUsed())
+				log.Debug("Failed to found atmos config", "file", filepath.Join(confDirPath, CliConfigFileName))
 			default:
 				return nil, err
 			}
@@ -102,8 +105,8 @@ func mergeConfigFromDirectories(v *viper.Viper, dirPaths []string) ([]string, er
 		}
 		err = mergeConfig(v, confDirPath, DotCliConfigFileName, true)
 		if err != nil {
-			log.Debug("Failed to found .atmos config", "path", confDirPath, "error", err)
-			return nil, ErrAtmosArgConfigNotFound
+			log.Debug("Failed to found .atmos config", "path", filepath.Join(confDirPath, CliConfigFileName), "error", err)
+			return nil, fmt.Errorf("%w: %s", ErrAtmosFilesDIrConfigNotFound, confDirPath)
 		}
 		log.Debug(".atmos config file merged", "path", v.ConfigFileUsed())
 		configPaths = append(configPaths, confDirPath)
diff --git a/pkg/config/load_config_test.go b/pkg/config/load_config_test.go
new file mode 100644
index 0000000000..a46efc62dd
--- /dev/null
+++ b/pkg/config/load_config_test.go
@@ -0,0 +1,146 @@
+package config
+
+import (
+	"os"
+	"path/filepath"
+	"testing"
+
+	"github.com/cloudposse/atmos/pkg/schema"
+	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"
+)
+
+// test configuration with flags --config and --config-path with multiple files and directories merge
+func TestLoadConfigFromCLIArgsMultipleMerge(t *testing.T) {
+	// create tmp folder
+	tmpDir, err := os.MkdirTemp("", "atmos-config-test")
+	if err != nil {
+		t.Fatalf("Failed to create temp directory: %v", err)
+	}
+	defer os.RemoveAll(tmpDir)
+	// create atmos.yaml file
+	atmosConfigFilePath := filepath.Join(tmpDir, "test-config.yaml")
+	f, err := os.Create(atmosConfigFilePath)
+	if err != nil {
+		t.Fatalf("Failed to create atmos.yaml file: %v", err)
+	}
+	content := []string{
+		"logs:\n",
+		"  file: /dev/stderr\n",
+		"  level: Info",
+	}
+
+	for _, line := range content {
+		if _, err := f.WriteString(line); err != nil {
+			t.Fatalf("Failed to write to config file: %v", err)
+		}
+	}
+	f.Close()
+	// write another config file
+	tmpDir2, err := os.MkdirTemp("", "atmos-config-test-2")
+	if err != nil {
+		t.Fatalf("Failed to create temp directory: %v", err)
+	}
+	defer os.RemoveAll(tmpDir2)
+	atmosConfigFilePath2 := filepath.Join(tmpDir2, "atmos.yaml")
+	f2, err := os.Create(atmosConfigFilePath2)
+	if err != nil {
+		t.Fatalf("Failed to create atmos.yaml file: %v", err)
+	}
+	content2 := []string{
+		"logs:\n",
+		"  file: /dev/stderr\n",
+		"  level: Debug",
+	}
+	for _, line := range content2 {
+		if _, err := f2.WriteString(line); err != nil {
+			t.Fatalf("Failed to write to config file: %v", err)
+		}
+	}
+	f2.Close()
+
+	configAndStacksInfo := schema.ConfigAndStacksInfo{
+		AtmosConfigFilesFromArg: []string{atmosConfigFilePath},
+		AtmosConfigDirsFromArg:  []string{tmpDir2},
+	}
+
+	atmosConfig, err := InitCliConfig(configAndStacksInfo, false)
+	if err != nil {
+		t.Fatalf("Failed to initialize atmos config: %v", err)
+	}
+	assert.Equal(t, atmosConfig.Logs.Level, "Debug", "Logs level should be Debug")
+	assert.Equal(t, atmosConfig.Logs.File, "/dev/stderr", "Logs file should be /dev/stderr")
+}
+func TestLoadConfigFromCLIArgs(t *testing.T) {
+	// Setup valid configuration for base case
+	validDir := t.TempDir()
+	validConfig := `
+logs:
+  file: /dev/stderr
+  level: Info
+`
+	validPath := filepath.Join(validDir, "atmos.yaml")
+	if err := os.WriteFile(validPath, []byte(validConfig), 0644); err != nil {
+		t.Fatalf("Setup failed: %v", err)
+	}
+
+	testCases := []struct {
+		name          string
+		files         []string
+		dirs          []string
+		expectError   bool
+		expectedLevel string
+	}{
+		{
+			name:          "valid configuration paths",
+			files:         []string{validPath},
+			dirs:          []string{validDir},
+			expectError:   false,
+			expectedLevel: "Info",
+		},
+		{
+			name:        "invalid config file path",
+			files:       []string{"/non/existent/file.yaml"},
+			dirs:        []string{validDir},
+			expectError: true,
+		},
+		{
+			name:        "invalid config directory path",
+			files:       []string{validPath},
+			dirs:        []string{"/non/existent/directory"},
+			expectError: true,
+		},
+		{
+			name:        "both invalid file and directory",
+			files:       []string{"/non/existent/file.yaml"},
+			dirs:        []string{"/non/existent/directory"},
+			expectError: true,
+		},
+		{
+			name:        "mixed valid and invalid paths",
+			files:       []string{"/non/existent/file.yaml", validPath},
+			dirs:        []string{"/non/existent/directory", validDir},
+			expectError: true,
+		},
+	}
+
+	for _, tc := range testCases {
+		t.Run(tc.name, func(t *testing.T) {
+			configInfo := schema.ConfigAndStacksInfo{
+				AtmosConfigFilesFromArg: tc.files,
+				AtmosConfigDirsFromArg:  tc.dirs,
+			}
+
+			cfg, err := InitCliConfig(configInfo, false)
+
+			if tc.expectError {
+				require.Error(t, err, "Expected error for invalid paths")
+				return
+			}
+
+			require.NoError(t, err, "Valid config should not return error")
+			assert.Equal(t, tc.expectedLevel, cfg.Logs.Level, "Unexpected log level configuration")
+			assert.Equal(t, "/dev/stderr", cfg.Logs.File, "Unexpected log file configuration")
+		})
+	}
+}

From 9534bd45e6b2f70d85108520169cfc530b0af76d Mon Sep 17 00:00:00 2001
From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com>
Date: Tue, 18 Mar 2025 21:00:33 +0000
Subject: [PATCH 82/83] [autofix.ci] apply automated fixes

---
 pkg/config/load_config_test.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pkg/config/load_config_test.go b/pkg/config/load_config_test.go
index a46efc62dd..4a8f7282cc 100644
--- a/pkg/config/load_config_test.go
+++ b/pkg/config/load_config_test.go
@@ -71,6 +71,7 @@ func TestLoadConfigFromCLIArgsMultipleMerge(t *testing.T) {
 	assert.Equal(t, atmosConfig.Logs.Level, "Debug", "Logs level should be Debug")
 	assert.Equal(t, atmosConfig.Logs.File, "/dev/stderr", "Logs file should be /dev/stderr")
 }
+
 func TestLoadConfigFromCLIArgs(t *testing.T) {
 	// Setup valid configuration for base case
 	validDir := t.TempDir()
@@ -80,7 +81,7 @@ logs:
   level: Info
 `
 	validPath := filepath.Join(validDir, "atmos.yaml")
-	if err := os.WriteFile(validPath, []byte(validConfig), 0644); err != nil {
+	if err := os.WriteFile(validPath, []byte(validConfig), 0o644); err != nil {
 		t.Fatalf("Setup failed: %v", err)
 	}
 

From ad754fe0456d5b4668012949694746acb9a9dd72 Mon Sep 17 00:00:00 2001
From: haitham911 <haitham911eg@gmail.com>
Date: Fri, 28 Mar 2025 01:09:52 +0200
Subject: [PATCH 83/83] remove comment

---
 pkg/config/load.go             | 1 -
 pkg/config/load_config_test.go | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/pkg/config/load.go b/pkg/config/load.go
index 3238af2374..3899f126ea 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -99,7 +99,6 @@ func setDefaultConfiguration(v *viper.Viper) {
 // loadConfigSources delegates reading configs from each source,
 // returning early if any step in the chain fails.
 func loadConfigSources(v *viper.Viper, configAndStacksInfo *schema.ConfigAndStacksInfo) error {
-	// Check if --config flag is provided
 	if err := readSystemConfig(v); err != nil {
 		return err
 	}
diff --git a/pkg/config/load_config_test.go b/pkg/config/load_config_test.go
index 4a8f7282cc..22cf146212 100644
--- a/pkg/config/load_config_test.go
+++ b/pkg/config/load_config_test.go
@@ -10,7 +10,7 @@ import (
 	"github.com/stretchr/testify/require"
 )
 
-// test configuration with flags --config and --config-path with multiple files and directories merge
+// test configuration with flags --config and --config-path with multiple files and directories merge.
 func TestLoadConfigFromCLIArgsMultipleMerge(t *testing.T) {
 	// create tmp folder
 	tmpDir, err := os.MkdirTemp("", "atmos-config-test")