Skip to content

feat: add -c/--command option to specify container command#1

Merged
nihen merged 2 commits intomainfrom
feat/custom-command
Feb 26, 2026
Merged

feat: add -c/--command option to specify container command#1
nihen merged 2 commits intomainfrom
feat/custom-command

Conversation

@nihen
Copy link
Copy Markdown
Owner

@nihen nihen commented Feb 26, 2026

Summary

  • Add -c/--command option to specify the command to execute inside the container
  • Also configurable via ECSSH_COMMAND environment variable
  • Default remains /bin/bash when not specified

Usage

ecssh -c "ls -la" my-cluster web-app           # Run a one-liner command
ecssh -c "/bin/sh" my-cluster web-app          # Connect with sh
ECSSH_COMMAND="whoami" ecssh my-cluster web-app # Specify via env var

Test plan

  • Verify command execution with -c "ls -la"
  • Verify /bin/bash is used by default without -c
  • Verify ECSSH_COMMAND environment variable works
  • Verify -c option takes priority over ECSSH_COMMAND
  • Verify ecssh help shows the -c option

🤖 Generated with Claude Code

Allow users to specify the command to execute in the container
instead of always using /bin/bash. Supports both CLI flag (-c/--command)
and environment variable (ECSSH_COMMAND).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

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

Adds support for specifying the command executed inside the ECS container via a new CLI option and an environment variable, while keeping /bin/bash as the default.

Changes:

  • Extend container connection flow to accept a user-provided command (defaulting to /bin/bash when empty).
  • Add -c/--command CLI parsing and ECSSH_COMMAND environment variable support.
  • Update usage/help text and Claude guidance examples to document the new option.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
main.go Plumbs a command parameter through connection logic, adds -c/--command parsing, reads ECSSH_COMMAND, and updates usage output.
CLAUDE.md Documents examples for -c and ECSSH_COMMAND.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread main.go Outdated
Comment thread main.go
Copy link
Copy Markdown

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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread main.go
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nihen nihen merged commit b56c66d into main Feb 26, 2026
4 checks passed
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.

2 participants