Skip to content

cwp agent install

shipped 2.0.0
cwp agent install <env> [flags]

Acts on the environment you name. There is no local default, so you name one.

ArgumentWhat it isDefault
<env>environment to install the agent on
FlagWhat it doesDefault
--hours <n>how long it answers before it expires8
--with-agentwith —dry-run on a host with no shell: install and remove the PHP agent so the plan is realoff

Plus the shared flags --json, -v, --verbose, -q, --quiet and --dry-run.

What it does

agent install uploads an agent and leaves it there. It records where the agent is and what signs a request to it. Every later run against that environment uses that agent instead of installing one of its own.

cwp agent install live --hours 8

The file answers for the hours you gave, then refuses everything and deletes itself. Set --hours when a long day of work is ahead. No value means forever, on purpose.

cwp leaves an environment that already has an agent alone, and the run says so. Replace it by removing it first:

cwp agent remove live && cwp agent install live

What it does not do

It does not install on a host that runs its own commands. A cloudron, ssh or ddev environment has a shell, so there is nothing to install. The run says that rather than uploading a file nothing would call.

It does not write the secret anywhere a project can commit. The record is in ~/.config/cwp/agents.yml, mode 0600, and --json reports the path and the expiry without it.