Publish to R2 from your prompt.
One skill and CLI script for your default Cloudflare website bucket.
upcloud file.html
-
Agent file prompt
"upcloud file.html" -
Agent directory prompt
"upcloud this dir" -
Direct CLI force flag
upload -f file.html
-
Root object check
/file.html -
Confirmed folder prefix
/upcloud/* -
Overwrite without prompt
/file.html
Four steps collapse into one command.
Skip the dashboard, bucket flags, and manual overwrite checks.
Manual R2 upload routine
- Pass the account ID and bucket name on every run
- Check whether
file.htmlalready exists at the root - Count directory files and byte size before syncing
- Repeat the same flags across agent and shell
With the upcloud skill and script
DEFAULT_UPCLOUD_BUCKET automatically.Every invocation checks before writing.
Switch between agent phrases, root files, force flags, and directory syncs.
Ask your coding agent in plain words
Say “upcloud this file” to publish a file to the bucket root, or “upcloud this dir” to confirm and upload a folder under a matching prefix.
> upcloud index.html
Uploading to DEFAULT_UPCLOUD_BUCKET/index.html
> upcloud this dir
Target: DEFAULT_UPCLOUD_BUCKET/upcloud/
Confirm upload? [y/N] y
Uploaded folder to /upcloud/
Check the root before writing a file
Running upcloud file.html checks whether the key exists at the root of DEFAULT_UPCLOUD_BUCKET and asks for confirmation if present.
$ upcloud file.html
Checking DEFAULT_UPCLOUD_BUCKET/file.html
Object exists at /file.html.
Overwrite file? [y/N] y
Uploaded file.html to bucket root.
Skip confirmation with the force flag
Pass -f when redeploying an existing page so the script replaces the root object without waiting for input.
$ upload -f file.html
Target: DEFAULT_UPCLOUD_BUCKET/file.html
Force flag (-f) set, replacing object.
Uploaded file.html (18.4 KB).
Inspect file count and size before sync
Running upload . walks the current directory, prints total files and byte size, then waits for confirmation.
$ upload .
Directory: ./upcloud
Total files: 14
Total size: 412.8 KB
Upload to DEFAULT_UPCLOUD_BUCKET/upcloud/? [y/N] y
Synced 14 files.
Three environment variables run the script.
Missing credentials print usage help and exit before touching the network.
| Variable | Sample setting | Role in upcloud |
|---|---|---|
DEFAULT_UPCLOUD_BUCKET |
DEFAULT_UPCLOUD_BUCKET=site-bucket |
R2 bucket configured to serve static website assets |
CLOUDFLARE_DEFAULT_ACCOUNT_ID |
CLOUDFLARE_DEFAULT_ACCOUNT_ID=foo |
Account identifier owning the target R2 bucket |
CLOUDFLARE_API_TOKEN |
CLOUDFLARE_API_TOKEN=bar |
API token with R2 object read and write access |
Unset variable behaviour |
Prints help to stdout |
Halts immediately and prints required exports |
Install the skill and export your tokens.
Add skills/upcloud/SKILL.md from btbytes/skills to your coding agent, link the CLI script, and set your Cloudflare R2 credentials.
Four ways to set up upcloud
- Install with
npx skills: Runnpx skills add btbytes/skills --skill upcloud -gto installupcloud/SKILL.mdglobally across supported coding agents. - Or clone and sync locally: Clone
github.com/btbytes/skillsand run./scripts/sync-skills.sh --skill upcloudto symlink into~/.agents/skills,~/.gemini/skills,~/.claude/skills,~/.cursor/skills, and~/.codex/skills. - Add CLI scripts to
PATH: Symlinkskills/upcloud/scripts/upcloudanduploadinto~/.local/bin(or add thescripts/directory toPATH) to run commands directly in your shell. - Export Cloudflare R2 variables: Set
DEFAULT_UPCLOUD_BUCKET,CLOUDFLARE_DEFAULT_ACCOUNT_ID, andCLOUDFLARE_API_TOKENin your shell profile. Missing variables print usage help and exit safely.
# Option A: Install globally via npx skills
$ npx skills add btbytes/skills --skill upcloud -g
# Option B: Clone repo & symlink to local coding agents
$ git clone https://github.com/btbytes/skills.git && cd skills
$ ./scripts/sync-skills.sh --skill upcloud
# Optional: Symlink CLI scripts to ~/.local/bin
$ ln -sf "$PWD/skills/upcloud/scripts/upcloud" ~/.local/bin/upcloud
$ ln -sf "$PWD/skills/upcloud/scripts/upload" ~/.local/bin/upload
2. Fallback help output when env vars are unset
$ upcloud file.html
Missing Cloudflare environment variables.
Set these before running upcloud:
CLOUDFLARE_DEFAULT_ACCOUNT_ID=foo
CLOUDFLARE_API_TOKEN=bar
DEFAULT_UPCLOUD_BUCKET=site-bucket
Usage:
upcloud <file.html> Upload file to bucket root
upload -f <file.html> Overwrite root file immediately
upload . Print count and size, then sync
btbytes/skills/skills/upcloud/SKILL.md and export R2 tokens.