Add --debug flag for WebSocket connection diagnostics
Shows WS URL, auth headers (truncated), full handshake request/response. Also improves the handshake failure error to include the raw server response. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -39,6 +39,7 @@ module PortainerCli
|
||||
HELP
|
||||
|
||||
def self.run(argv)
|
||||
debug = argv.delete('--debug')
|
||||
config = Config.load
|
||||
cmd = argv.shift&.downcase
|
||||
|
||||
@@ -56,11 +57,11 @@ module PortainerCli
|
||||
when 'console'
|
||||
require_config!(config)
|
||||
client = Client.new(config)
|
||||
Commands::Console.new(config, client).run(argv)
|
||||
Commands::Console.new(config, client, debug: debug).run(argv)
|
||||
when 'exec', 'shell'
|
||||
require_config!(config)
|
||||
client = Client.new(config)
|
||||
Commands::Exec.new(config, client).run(argv)
|
||||
Commands::Exec.new(config, client, debug: debug).run(argv)
|
||||
when 'version', '--version', '-v'
|
||||
puts "portainer-cli #{PortainerCli::VERSION}"
|
||||
when 'help', '--help', '-h', nil
|
||||
|
||||
Reference in New Issue
Block a user