cwp shell
shipped 1.0.0cwp shell [env] [flags]
Acts on the local site. Name an environment to act there instead.
A conduit: standard output belongs to the program you run, so there is no --json, and cwp forwards the exit code unchanged.
| Argument | What it is | Default |
|---|---|---|
[env] | environment to open a shell on (default: default_environment in cwp.yml) |
Plus the shared flags -v, --verbose, -q, --quiet and --dry-run.
What it does
An interactive shell: ddev ssh locally, and whatever the environment’s host
calls a shell remotely. That is cloudron exec on Cloudron and ssh -t on a
plain host.
Like cwp wp, it hands the terminal over and forwards the shell’s
exit code verbatim, so it has no --json. It requests a tty only when it has
one itself, so cwp shell prod < script.sh behaves in a pipeline.
cwp names a remote target 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. It is a statement rather than a question, on purpose.