Skip to content

Add a once exec ... command#75

Merged
kevinmcconnell merged 1 commit into
mainfrom
exec-command
Jun 24, 2026
Merged

Add a once exec ... command#75
kevinmcconnell merged 1 commit into
mainfrom
exec-command

Conversation

@kevinmcconnell

@kevinmcconnell kevinmcconnell commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Adds a new CLI command, exec which executes a command in an application's running container. Much like docker exec, docker compose exec, etc.

  • Will attach a TTY as necessary, so interactive commands work without additional flags
  • Passes back the exit code from the command

Closes #59

Adds a new CLI command, `exec` which executes a command in an
application's running container. Much like `docker exec`, `docker
compose exec`, etc.

- Will attach a TTY as necessary, so interactive commands work without
  additional flags
- Passes back the exit code from the command
Copilot AI review requested due to automatic review settings June 24, 2026 14:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a new once exec CLI command that executes a command inside a running application container (similar to docker exec), including TTY attachment/resize handling and propagating the container command’s exit status back to the once process.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Changes:

  • Implement attached exec support in the Docker layer (TTY/raw mode, stdin/stdout piping, resize handling, exit-code errors).
  • Add once exec <host> <command> [args...] command wiring plus argument parsing and unit tests.
  • Propagate exec exit codes through the CLI entrypoint and add integration coverage for success/failure/not-running cases.

Reviewed changes

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

Show a summary per file
File Description
internal/docker/container.go Adds attached exec implementation (TTY detection, raw mode, I/O piping, resize monitoring) and exit-code error type.
internal/docker/application.go Exposes Application.Exec and maps Docker “conflict” errors to ErrApplicationNotRunning.
internal/command/root.go Registers the new exec subcommand and adds helpers for extracting exit codes from errors.
internal/command/exec.go Implements the once exec Cobra command and argument splitting (including -- separator).
internal/command/exec_test.go Unit tests for splitExecArgs behavior.
integration/docker_test.go Integration tests validating exec exit codes and behavior when the app is stopped.
cmd/once/main.go Exits with the underlying exec exit code when present.

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

Comment thread internal/command/exec.go
@kevinmcconnell kevinmcconnell merged commit 34fb598 into main Jun 24, 2026
6 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.

once exec

2 participants