apple / apple/container

[Request]: Add `container restart` command

Open
#2,219 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
49.9k
Forks
1.8k
Avg merge
1d 20h
Merged PRs (30d)
22

Description

### Feature or enhancement request details

Currently there's no way to restart a container with a single command you have to run `container stop` followed by `container start`. Every major container tool (Docker, Podman, nerdctl) provides a `restart` command, and it would be nice to have it here too.

The command would:
- Accept one or more container IDs, or `--all` to restart everything
- Support `--time` and `--signal` options for the stop phase (same as `container stop`)
- Stop the container if it's running, then start it back up in detached mode
- Simply start already-stopped containers (matching Docker's behavior)

This is a CLI-shape change since it adds a new subcommand under the `Container` group.

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Research direction

Start by locating the existing `container stop` and `container start` commands under the `Container` group and read how they handle IDs, `--all`, `--time`, and `--signal`. Add the `restart` subcommand with the requested stopped-container behavior and detached startup, then verify that single, multiple, and `--all` invocations match the stated behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.