Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmd/about/about.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ var aboutCmd = &cobra.Command{
Long: `Display information about Atmos, its features, and benefits.`,
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
return ui.Markdown(markdown.AboutMarkdown)
ui.Markdown(markdown.AboutMarkdown)
return nil
},
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/auth_ecr_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func executeExplicitRegistries(ctx context.Context, registries []string) error {

// Log success with actual expiration time from ECR token.
expiresIn := time.Until(result.ExpiresAt).Round(time.Minute)
_ = ui.Success(fmt.Sprintf("ECR login: %s (expires in %s)", registry, expiresIn))
ui.Success(fmt.Sprintf("ECR login: %s (expires in %s)", registry, expiresIn))
}

// Set DOCKER_CONFIG so downstream Docker commands use the same config location.
Expand Down
6 changes: 3 additions & 3 deletions cmd/auth_exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ func extractIdentityFlag(args []string) (identityValue string, commandArgs []str

// printAuthExecTip prints a helpful tip when auth exec fails.
func printAuthExecTip(identityName string) {
_ = ui.Writeln("")
_ = ui.Info("Tip: If credentials are expired, refresh with:")
_ = ui.Writef(" atmos auth login --identity %s\n", identityName)
ui.Writeln("")
ui.Info("Tip: If credentials are expired, refresh with:")
ui.Writef(" atmos auth login --identity %s\n", identityName)
}

func init() {
Expand Down
10 changes: 5 additions & 5 deletions cmd/auth_whoami.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,19 +174,19 @@ func printWhoamiHuman(whoami *authTypes.WhoamiInfo, isValid bool) {
statusIndicator = theme.Styles.Checkmark.String()
}

_ = ui.Writef("%s Current Authentication Status\n\n", statusIndicator)
ui.Writef("%s Current Authentication Status\n\n", statusIndicator)

// Build and print table.
rows := buildWhoamiTableRows(whoami)
t := createWhoamiTable(rows)

_ = ui.Writef("%s\n", t)
ui.Writef("%s\n", t)

// Show warning with tip if credentials are invalid.
if !isValid {
_ = ui.Writeln("")
_ = ui.Warning("Credentials may be expired or invalid.")
_ = ui.Writef(" Run 'atmos auth login --identity %s' to refresh.\n", whoami.Identity)
ui.Writeln("")
ui.Warning("Credentials may be expired or invalid.")
ui.Writef(" Run 'atmos auth login --identity %s' to refresh.\n", whoami.Identity)
}
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/list/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func listComponentsWithOptions(cmd *cobra.Command, args []string, opts *Componen
}

if len(components) == 0 {
_ = ui.Info("No components found")
ui.Info("No components found")
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/list/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ func setupSettingsOptions(opts *SettingsOptions, componentFilter string) *l.Filt
// displayNoSettingsFoundMessage displays an appropriate message when no settings are found.
func displayNoSettingsFoundMessage(componentFilter string) {
if componentFilter != "" {
_ = ui.Info("No settings found for component: " + componentFilter)
ui.Info("No settings found for component: " + componentFilter)
} else {
_ = ui.Info("No settings found")
ui.Info("No settings found")
}
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/list/stacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func listStacksWithOptions(cmd *cobra.Command, args []string, opts *StacksOption
return err
}
if len(stacks) == 0 {
_ = ui.Info("No stacks found")
ui.Info("No stacks found")
return nil
}

Expand Down
6 changes: 4 additions & 2 deletions cmd/list/themes.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,13 @@ func displayThemes(opts *ThemesOptions, themes []*theme.Theme, activeTheme strin
if !term.IsTTYSupportForStdout() {
// Fall back to simple text output for non-TTY
output := formatSimpleOutput(opts, themes, activeTheme, showingRecommendedOnly)
return ui.Write(output)
ui.Write(output)
return nil
}

output := formatThemesTable(opts, themes, activeTheme, showingRecommendedOnly)
return ui.Write(output)
ui.Write(output)
return nil
}

// formatThemesTable formats themes into a styled Charmbracelet table.
Expand Down
8 changes: 4 additions & 4 deletions cmd/list/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,13 @@ var varsCmd = &cobra.Command{
if err != nil {
var componentVarsNotFoundErr *listerrors.ComponentVarsNotFoundError
if errors.As(err, &componentVarsNotFoundErr) {
_ = ui.Info("No vars found for component: " + componentVarsNotFoundErr.Component)
ui.Info("No vars found for component: " + componentVarsNotFoundErr.Component)
return nil
}

var noValuesErr *listerrors.NoValuesFoundError
if errors.As(err, &noValuesErr) {
_ = ui.Info("No values found for query '.vars' for component: " + args[0])
ui.Info("No values found for query '.vars' for component: " + args[0])
return nil
}

Expand Down Expand Up @@ -280,9 +280,9 @@ func getFilterOptionsFromValues(opts *ValuesOptions) *l.FilterOptions {
// displayNoValuesFoundMessage displays an appropriate message when no values or vars are found.
func displayNoValuesFoundMessage(componentName string, query string) {
if query == ".vars" {
_ = ui.Info("No vars found for component: " + componentName)
ui.Info("No vars found for component: " + componentName)
} else {
_ = ui.Info("No values found for component: " + componentName)
ui.Info("No values found for component: " + componentName)
}
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/list/vendor.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func listVendorWithOptions(opts *VendorOptions) error {
}

if len(vendors) == 0 {
_ = ui.Info("No vendor configurations found")
ui.Info("No vendor configurations found")
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/list/workflows.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func listWorkflowsWithOptions(cmd *cobra.Command, args []string, opts *Workflows
}

if len(workflows) == 0 {
_ = ui.Info("No workflows found")
ui.Info("No workflows found")
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,9 @@ var RootCmd = &cobra.Command{
"", "",
)
case "warn":
_ = ui.Experimental(experimentalCmd)
ui.Experimental(experimentalCmd)
case "error":
_ = ui.Experimental(experimentalCmd)
ui.Experimental(experimentalCmd)
errUtils.CheckErrorPrintAndExit(
errUtils.Build(errUtils.ErrExperimentalRequiresIn).
WithContext("command", experimentalCmd).
Expand Down
2 changes: 1 addition & 1 deletion cmd/terraform/varfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func ExecuteVarfileGeneration(config *VarfileConfig) error {

// runVarfileCommand is the shared implementation for varfile commands.
func runVarfileCommand(cmd *cobra.Command, component string, parser *flags.StandardParser, deprecationMsg string) error {
_ = ui.Warning(deprecationMsg)
ui.Warning(deprecationMsg)

v := viper.GetViper()

Expand Down
4 changes: 2 additions & 2 deletions cmd/terraform/workdir/workdir_clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func cleanAllWorkdirs(atmosConfig *schema.AtmosConfiguration) error {
return err
}

_ = ui.Writef("%s All workdirs cleaned\n", theme.Styles.Checkmark.String())
ui.Writef("%s All workdirs cleaned\n", theme.Styles.Checkmark.String())
return nil
}

Expand All @@ -99,7 +99,7 @@ func cleanSpecificWorkdir(atmosConfig *schema.AtmosConfiguration, component, sta
return err
}

_ = ui.Writef("%s Workdir cleaned for %s in %s\n", theme.Styles.Checkmark.String(), component, stack)
ui.Writef("%s Workdir cleaned for %s in %s\n", theme.Styles.Checkmark.String(), component, stack)
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/terraform/workdir/workdir_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func printListYAML(workdirs []WorkdirInfo) error {

func printListTable(workdirs []WorkdirInfo) {
if len(workdirs) == 0 {
_ = ui.Writeln("No workdirs found")
ui.Writeln("No workdirs found")
return
}

Expand Down Expand Up @@ -129,7 +129,7 @@ func printListTable(workdirs []WorkdirInfo) {
return lipgloss.NewStyle().Padding(0, 2, 0, 0)
})

_ = ui.Writeln(t.String())
ui.Writeln(t.String())
}

func init() {
Expand Down
4 changes: 2 additions & 2 deletions cmd/terraform/workdir/workdir_show.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func printShowHuman(info *WorkdirInfo) {

// Display status indicator with colored checkmark.
statusIndicator := theme.Styles.Checkmark.String()
_ = ui.Writef("%s Workdir Status\n\n", statusIndicator)
ui.Writef("%s Workdir Status\n\n", statusIndicator)

// Build table rows.
rows := [][]string{
Expand Down Expand Up @@ -106,7 +106,7 @@ func printShowHuman(info *WorkdirInfo) {
return lipgloss.NewStyle().Padding(0, 1)
})

_ = ui.Writef("%s\n", t)
ui.Writef("%s\n", t)
}

func init() {
Expand Down
12 changes: 3 additions & 9 deletions cmd/theme/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ func executeThemeList(cmd *cobra.Command, args []string) error {
}

// Write the table output.
if err := ui.Write(result.Output); err != nil {
return err
}
ui.Write(result.Output)

// Write footer messages with styling.
countMsg := fmt.Sprintf("%d theme", result.ThemeCount)
Expand All @@ -116,14 +114,10 @@ func executeThemeList(cmd *cobra.Command, args []string) error {
}
}

if err := ui.Info(countMsg); err != nil {
return err
}
ui.Info(countMsg)

if result.ActiveTheme != "" {
if err := ui.Success(fmt.Sprintf("Active theme: %s", result.ActiveTheme)); err != nil {
return err
}
ui.Success(fmt.Sprintf("Active theme: %s", result.ActiveTheme))
}

return nil
Expand Down
3 changes: 2 additions & 1 deletion cmd/theme/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,6 @@ func executeThemeShow(cmd *cobra.Command, args []string) error {
return result.Error
}

return ui.Write(result.Output)
ui.Write(result.Output)
return nil
}
18 changes: 9 additions & 9 deletions cmd/toolchain/registry/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Default built-in registries:

Use 'atmos toolchain registry list aqua' to see tools in the Aqua registry.
`
_ = ui.MarkdownMessage(message)
ui.MarkdownMessage(message)

return nil
}
Expand Down Expand Up @@ -190,12 +190,12 @@ func displayToolsTable(params *displayTableParams) error {
// Show info toast before pager content.
if end == total {
// Showing all tools.
_ = ui.Infof("Showing **%d tools** from registry `%s` (%s)", total, registryName, meta.Type)
ui.Infof("Showing **%d tools** from registry `%s` (%s)", total, registryName, meta.Type)
} else {
// Showing a subset.
_ = ui.Infof("Showing **%d-%d** of **%d tools** from registry `%s` (%s)", start, end, total, registryName, meta.Type)
ui.Infof("Showing **%d-%d** of **%d tools** from registry `%s` (%s)", start, end, total, registryName, meta.Type)
}
_ = ui.Writef("Source: %s\n\n", meta.Source)
ui.Writef("Source: %s\n\n", meta.Source)

// Get table content.
tableContent := buildToolsTable(tools)
Expand All @@ -208,9 +208,9 @@ func displayToolsTable(params *displayTableParams) error {
}

// Show helpful hints after pager closes (so they're visible).
_ = ui.Writeln("")
_ = ui.Hintf("Use `atmos toolchain info <tool>` for details")
_ = ui.Hintf("Use `atmos toolchain install <tool>@<version>` to install")
ui.Writeln("")
ui.Hintf("Use `atmos toolchain info <tool>` for details")
ui.Hintf("Use `atmos toolchain install <tool>@<version>` to install")

return nil
}
Expand Down Expand Up @@ -242,7 +242,7 @@ func listRegistryTools(ctx context.Context, registryName string, opts *ListOptio
}

if len(tools) == 0 {
_ = ui.Infof("No tools found in registry '%s'", registryName)
ui.Infof("No tools found in registry '%s'", registryName)
return nil
}

Expand Down Expand Up @@ -293,7 +293,7 @@ func loadToolVersionsAndInstaller() (*toolchain.ToolVersions, *toolchain.Install
toolVersionsFile := toolchain.GetToolVersionsFilePath()
toolVersions, err := toolchain.LoadToolVersions(toolVersionsFile)
if err != nil && !os.IsNotExist(err) {
_ = ui.Warningf("Could not load .tool-versions: %v", err)
ui.Warningf("Could not load .tool-versions: %v", err)
}
return toolVersions, installer
}
Expand Down
18 changes: 9 additions & 9 deletions cmd/toolchain/registry/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,18 @@ func displaySearchTable(results []*toolchainregistry.Tool, query string, searchL
// Display results with info toast showing range vs total.
if searchLimit <= 0 || totalMatches <= searchLimit {
// Showing all results (no limit or within limit).
_ = ui.Infof("Found **%d tools** matching `%s`:", totalMatches, query)
ui.Infof("Found **%d tools** matching `%s`:", totalMatches, query)
} else {
// Showing subset of results.
_ = ui.Infof("Showing **%d** of **%d tools** matching `%s`:", len(displayResults), totalMatches, query)
ui.Infof("Showing **%d** of **%d tools** matching `%s`:", len(displayResults), totalMatches, query)
}
_ = ui.Writeln("") // Blank line after toast.
ui.Writeln("") // Blank line after toast.
displaySearchResults(displayResults)

// Show helpful hints after table.
_ = ui.Writeln("")
_ = ui.Hintf("Use `atmos toolchain info <tool>` for details")
_ = ui.Hintf("Use `atmos toolchain install <tool>@<version>` to install")
ui.Writeln("")
ui.Hintf("Use `atmos toolchain info <tool>` for details")
ui.Hintf("Use `atmos toolchain install <tool>@<version>` to install")
}

// searchFlags holds parsed search command flags.
Expand Down Expand Up @@ -216,7 +216,7 @@ Try:
- Using a different search term
- Checking 'atmos toolchain registry list' for available tools
`, query)
_ = ui.Info(message)
ui.Info(message)
return nil
}

Expand Down Expand Up @@ -255,7 +255,7 @@ func displaySearchResults(tools []*toolchainregistry.Tool) {
toolVersions, installer := loadSearchToolVersions()
rows, widths := buildSearchRows(tools, toolVersions, installer)
styled := renderSearchTable(rows, widths)
_ = ui.Writeln(styled)
ui.Writeln(styled)
}

// loadSearchToolVersions loads tool versions and creates an installer for search.
Expand All @@ -264,7 +264,7 @@ func loadSearchToolVersions() (*toolchain.ToolVersions, *toolchain.Installer) {
toolVersionsFile := toolchain.GetToolVersionsFilePath()
toolVersions, err := toolchain.LoadToolVersions(toolVersionsFile)
if err != nil && !os.IsNotExist(err) {
_ = ui.Warningf("Could not load .tool-versions: %v", err)
ui.Warningf("Could not load .tool-versions: %v", err)
}
return toolVersions, installer
}
Expand Down
14 changes: 7 additions & 7 deletions internal/exec/terraform_shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ type shellConfig struct {

// printShellDryRunInfo prints the shell configuration in dry-run mode.
func printShellDryRunInfo(info *schema.ConfigAndStacksInfo, cfg *shellConfig) {
_ = ui.Writeln("Dry run mode: shell would be started with the following configuration:")
_ = ui.Writeln(" Component: " + info.ComponentFromArg)
_ = ui.Writeln(" Stack: " + info.Stack)
_ = ui.Writeln(" Working directory: " + cfg.workingDir)
_ = ui.Writeln(" Terraform workspace: " + info.TerraformWorkspace)
_ = ui.Writeln(" Component path: " + cfg.componentPath)
_ = ui.Writeln(" Varfile: " + cfg.varFile)
ui.Writeln("Dry run mode: shell would be started with the following configuration:")
ui.Writeln(" Component: " + info.ComponentFromArg)
ui.Writeln(" Stack: " + info.Stack)
ui.Writeln(" Working directory: " + cfg.workingDir)
ui.Writeln(" Terraform workspace: " + info.TerraformWorkspace)
ui.Writeln(" Component path: " + cfg.componentPath)
ui.Writeln(" Varfile: " + cfg.varFile)
}

// ExecuteTerraformShell starts an interactive shell configured for a terraform component.
Expand Down
2 changes: 1 addition & 1 deletion internal/exec/workflow_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ func ExecuteWorkflow(
log.Debug("Using stack", "stack", finalStack)
}

_ = ui.Infof("Executing command: `atmos %s`", command)
ui.Infof("Executing command: `atmos %s`", command)
err = retry.With7Params(context.Background(), step.Retry,
ExecuteShellCommand,
atmosConfig, "atmos", args, ".", stepEnv, dryRun, "")
Expand Down
Loading