Skip to content

cwp shell

shipped 1.0.0
cwp shell [env] [flags]

Acts on the local site unless an environment is named.

A conduit: standard output belongs to the program being run, so there is no --json and the exit code is forwarded unchanged.

ArgumentWhat it isDefault
[env]environment to open a shell on (omit for the local site)

Plus the shared flags --verbose and --dry-run.

What it does

An interactive shell: ddev ssh locally, and whatever the environment’s host calls a shell remotely — cloudron exec on Cloudron, ssh -t on a plain host.

Like cwp wp, it hands the terminal over and forwards the shell’s exit code verbatim, which is why it has no --json. A tty is requested only when cwp itself has one, so cwp shell prod < script.sh behaves in a pipeline.

A remote target is named on stderr before the shell opens, with protected called out:

opening a shell on prod (example.com) — a protected environment

Example

cwp shell            # a shell in the local DDEV web container
cwp shell prod       # a shell inside the Cloudron app
cwp shell vps        # a login shell on a plain host

What it does not do

It guards nothing. Opening a shell writes nothing by itself, and cwp cannot know what you will type into it — a confirmation prompt here would only train the reflex that dismisses the prompts that matter.

The line naming the environment is the whole of the protection, and it is deliberately a statement rather than a question.