Skip to content

Conversation

@supercobra
Copy link

@supercobra supercobra commented Sep 28, 2025

kamal alias lists existing aliases from deploy.[target].yml files.

Example:

$ kamal alias -d production                                                                   
console                        app exec --interactive --reuse "bundle exec rails console"     
shell                          app exec --interactive --reuse "bash"                          
logs                           app logs -f                                                    
dbc                            app exec --interactive --reuse "bundle exec rails dbconsole"  

Copilot AI review requested due to automatic review settings September 28, 2025 15:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new kamal alias command that displays all available aliases from the configuration files. The command shows aliases in a formatted table with names left-aligned in a 30-character column followed by their corresponding commands.

  • Adds kamal alias command to list configured aliases
  • Provides formatted output showing alias names and their commands
  • Handles cases where no aliases are configured

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
lib/kamal/cli/main.rb Implements the new alias command with formatting logic
test/cli/alias_test.rb Adds comprehensive test coverage for the alias command functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

def alias
if KAMAL.config.aliases.any?
KAMAL.config.aliases.each do |name, alias_config|
puts "#{name.ljust(30)} #{alias_config.command}"
Copy link

Copilot AI Sep 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The magic number 30 for column width is hardcoded. Consider extracting this to a constant like ALIAS_NAME_COLUMN_WIDTH = 30 to improve maintainability and make the formatting intention clearer.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant