Skip to Content
CLIRemote accesscmdop files

Files

Transfer and manage files on remote machines through the cmdop relay. Same auth, same permission gate as the rest of cmdop — no SSH keys, no port 22.

File operations route over the same gRPC stream as cmdop connect. Anything you can do interactively in cmdop connect you can also do via cmdop files.

List a remote directory

cmdop files ls vps-audi:/var/log

Output:

NAME SIZE MODIFIED app.log 1.2 MB 2 hours ago nginx/ - 1 day ago syslog 45 KB just now

Listing options:

cmdop files ls vps-audi:/home/deploy --all # include hidden cmdop files ls vps-audi:/var/log --long # detailed format cmdop files ls vps-audi:/var/log --json # script-friendly

Download a file

cmdop files get vps-audi:/var/log/app.log ./app.log cmdop files get vps-audi:/var/log/app.log . # current dir cmdop files get vps-audi:/var/log/app.log ./logs/prod.log cmdop files get vps-audi:/app/logs ./local-logs --recursive # whole dir

Upload a file

cmdop files put ./config.yaml vps-audi:/app/config.yaml cmdop files put ./local.conf prod-server:/etc/app/production.conf cmdop files put ./dist prod-server:/app/public --recursive

Read or tail a remote file

cmdop files cat vps-audi:/etc/hostname cmdop files cat vps-audi:/var/log/app.log --tail 100 cmdop files cat vps-audi:/var/log/app.log --follow # like tail -f

Delete, copy, move

cmdop files rm vps-audi:/tmp/old-file.txt cmdop files rm vps-audi:/tmp/old-dir --recursive cmdop files cp vps-audi:/app/config.yaml vps-audi:/app/config.yaml.backup cmdop files mv vps-audi:/tmp/upload.txt vps-audi:/app/data.txt

File metadata

cmdop files info vps-audi:/var/log/app.log
Path: /var/log/app.log Size: 1,234,567 bytes Mode: 0644 Owner: deploy Group: deploy Modified: 2026-04-25 10:30:00

Sync a directory (rsync-style)

cmdop files sync only transfers changed files:

cmdop files sync ./project vps-audi:/app cmdop files sync ./project vps-audi:/app --delete # mirror (deletes remote files not in local) cmdop files sync ./project vps-audi:/app --dry-run # preview

Progress display

Large transfers show throughput and ETA:

Uploading: data.tar.gz [████████████░░░░░░░░] 60% 120 MB/200 MB 5.2 MB/s ETA: 15s

Frame inside cmdop connect

cmdop files is a sibling of cmdop connect — you can also run file operations during an attached session by prefixing with !:

$ cmdop connect vps-audi deploy@vps-audi:~$ !files put ./config.yaml /app/config.yaml

Scripting

Backup with date-stamp:

DATE=$(date +%Y%m%d) cmdop files get prod-server:/data/db.sqlite ./backup/db-$DATE.sqlite cmdop files get prod-server:/data/uploads ./backup/uploads-$DATE --recursive

Deploy to multiple hosts:

for host in vps-audi vps-bmw mac-studio; do cmdop files put ./config.yaml $host:/app/config.yaml done

Atomic deploy:

cmdop files put ./dist prod-server:/app/public-new --recursive cmdop connect exec prod-server -- "mv /app/public /app/public-old && mv /app/public-new /app/public" cmdop connect exec prod-server -- "systemctl restart app"

Permissions on remote writes

write_file and read_file go through the target machine’s permission gate. Patterns like write_file(.env*) can deny writes to dotfiles. See ./permissions for rule grammar.

Last updated on