cp

A Crabbox command for copying files or folders between your computer and a Crabbox-managed remote machine. It uses a provider's copy system when available, or transfers through SSH using rsync or an archive stream.

In plain words
What is it for?
Use it to upload source files or instructions to a lease, or download logs, coverage reports and other results. It supports copying in either direction, directories and recursive transfers.
Why use it?
It removes the need to assemble transfer commands and connection details by hand. Crabbox checks that the destination lease belongs to it and handles the appropriate transport.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/openclaw/crabbox/cp
Clone the repo
git clone --depth 1 https://github.com/openclaw/crabbox
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,388 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01388
Opus 5 $0.00000 $0.00694
Sonnet 5 $0.00000 $0.00278
Haiku 4.5 $0.00000 $0.00139

Measured 2d ago against content hash e0155245b28b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cp scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/commands/cp.md · 117 lines

How it starts

The opening of the file, as written. The whole thing — 117 lines — stays where its author put it; the contents beside it link to each section on GitHub.

cp

crabbox cp copies files or directories between the host and a Crabbox-owned lease. It resolves the lease id or slug first. Providers with a native copy backend keep using that backend; SSH-backed leases otherwise transfer through the resolved SSH transport with rsync or a validated archive stream.

crabbox cp --provider docker-sandbox --id blue-box ./coverage.xml SANDBOX:/tmp/coverage.xml
crabbox cp --provider docker-sandbox --id blue-box SANDBOX:/tmp/output.log ./output.log
crabbox cp --provider docker-sandbox --id blue-box -L ./src SANDBOX:/tmp/src
crabbox cp --provider ssh --id buildbox ./instructions SANDBOX:/tmp/instructions
crabbox cp --id blue-box SANDBOX:/tmp/results ./results

Lease Resolution

--id is required. It accepts a Crabbox lease id or active slug. Providers only act on Crabbox-owned leases; raw user-created sandboxes are rejected.

For SSH-backed copies, claim validation remains mandatory. The subsequent best-effort lease refresh has a 20-second budget; a refresh failure warns and copying continues without guaranteeing renewed expiry. Cancellation by the caller stops the command instead. This budget does not limit the file transfer.

Path Syntax

Exactly one side must use SANDBOX:PATH.

  • Host to sandbox: ./file.txt SANDBOX:/tmp/file.txt
  • Sandbox to host: SANDBOX:/tmp/file.txt ./file.txt

crabbox cp does not support sandbox-to-sandbox copies.

For provider=docker-sandbox, Crabbox rewrites SANDBOX:PATH to <sandbox-name>:PATH and then calls sbx cp. For an SSH lease, SANDBOX:PATH is a path on the resolved remote host.

Flags

crabbox cp --help (or -h) shows the invocation, path rule, both copy directions, and copy-specific flags before the complete provider flag reference.

--id <lease-id-or-slug>
--provider <name>
-L                      follow symbolic links when copying from host to sandbox

Transport Selection

Provider-native copy remains the first choice when the backend implements it. Otherwise, Crabbox accepts any provider that resolves a managed SSH lease and uses the same SSHTarget used by run, sync, and interactive SSH. Crabbox prefers rsync 3.4.3 or newer. On a POSIX operator host, if the local client is missing or older, it uses a Go-owned tar+gzip archive stream over SSH instead; it never invokes the rejected rsync client, scp, or another copy command. Delegated providers with neither transport fail clearly.

Read the full file on GitHub · 117 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 117 lines · 0 tokens per session scan A e0155245b28b

Subscribe to this mod's changes

cp is a command published in the GitHub repository openclaw/crabbox (1,343 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,388 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.