Your drive, from the terminal.你的雲端硬碟,就在終端機。
bkp is the bkpdrive command-line client — upload, download, list, and manage your files from any shell. One static binary, no dependencies.bkp 是 bkpdrive 的命令列客戶端——在任何 shell 上傳、下載、列出、管理你的檔案。單一靜態執行檔,零相依。
01Install安裝
macOS, Linux, and WSL — one line. It detects your OS and architecture and drops a single binary on your PATH.macOS、Linux、WSL——一行搞定。它會偵測你的作業系統與架構,把單一執行檔放上你的 PATH。
$ curl -fsSL https://bkpdrive.com/cli/install.sh | sh
Windows: download bkp-windows-amd64.exe and put it on your PATH. Prefer a custom location? BKP_INSTALL_DIR=~/.local/bin curl … | sh.Windows:下載 bkp-windows-amd64.exe 放上 PATH。想放在別的位置?BKP_INSTALL_DIR=~/.local/bin curl … | sh。
02Set up設定
Authenticate once with your account email and a Personal Access Token. The token has the same access as your account — keep it secret. Tokens can only be created on the web.用帳號 email 與 Personal Access Token 認證一次即可。token 的權限等同你的帳號——務必保密。token 只能在網頁上建立。
- Generate a token in the web app at app.bkpdrive.com/settings → Personal access tokens → Generate token. Copy it (it's shown once).產生 token:到網頁版 app.bkpdrive.com/settings → Personal access tokens → Generate token,複製它(只顯示一次)。
- Log in with your account email + the token — saves them to
~/.bkpdrive/config.json:登入:輸入帳號 email + token——會存到~/.bkpdrive/config.json:$ bkp login Email: [email protected] Enter token: bkp_pat_xxxxxxxx
- Verify you're connected:驗證連線:
$ bkp whoami && bkp quota
export [email protected] BKPDRIVE_TOKEN=bkp_pat_…. Every command also takes --json for machine-readable output.腳本與自動化:用環境變數跳過互動輸入——export [email protected] BKPDRIVE_TOKEN=bkp_pat_…。每個指令都支援 --json 輸出機器可讀格式。03Usage使用
Address files by name or by a /path (e.g. /photos/trip.zip) — no ids to copy around. Set a working folder with cd and relative paths resolve against it, just like a shell.用名稱或 /path(例如 /photos/trip.zip)指定檔案——不用到處複製 id。用 cd 設定工作資料夾後,相對路徑就像在 shell 裡一樣解析。
bkp cd [path] | Set the working folder (no arg → root). Relative .. works.設定工作資料夾(不帶參數 → 根目錄)。支援相對 ..。 |
bkp pwd | Print the current working folder.顯示目前的工作資料夾。 |
bkp ls [path] | List names like ls. -l details · -a hidden · --trash · --recent.像 ls 一樣列出名稱。-l 詳細 · -a 隱藏檔 · --trash · --recent。 |
bkp tree [path] | Show a folder as a tree. -L <depth> to limit.以樹狀顯示資料夾。-L <depth> 限制深度。 |
bkp ul <file> [dest] | Upload a local file (into an optional folder). -r for a whole directory.上傳本地檔案(可指定目的資料夾)。-r 上傳整個目錄。 |
bkp dl <path> [-o out] | Download a file. -o - → stdout · -r for a whole folder.下載檔案。-o - → stdout · -r 整個資料夾。 |
bkp mkdir <name> | Create a folder.建立資料夾。 |
bkp mv <src> <dest> | Move or rename.移動或重新命名。 |
bkp rm [-r] <path>… | Delete to trash (-r for folders).刪除到垃圾桶(資料夾用 -r)。 |
bkp quota | Storage used and available.已用與可用空間。 |
bkp whoami | Who you're signed in as.目前登入的帳號。 |
bkp upgrade | Update bkp to the latest version in place (--check to peek first).就地把 bkp 更新到最新版(--check 先查看)。 |
Exit codes: 0 ok · 2 usage · 3 auth · 4 not found · 5 quota · 6 error · 7 network. Large uploads are split and streamed automatically.結束代碼:0 正常 · 2 用法 · 3 認證 · 4 找不到 · 5 配額 · 6 錯誤 · 7 網路。大檔上傳會自動分塊串流。
⇥ to complete folder and file names (cd completes folders only). Load it in your current shell with source <(bkp completion zsh) (or bash/fish).Tab 補完由安裝器自動設定——按 ⇥ 補完資料夾與檔名(cd 只補資料夾)。要在目前的 shell 立即載入:source <(bkp completion zsh)(或 bash/fish)。04Examples範例
Everyday flows.日常操作。
# set a working folder and upload into it $ bkp cd /backups $ bkp ul ~/db.dump . $ bkp ls
# make a folder and upload into it $ bkp mkdir reports $ bkp ul ~/q3-report.pdf /reports $ bkp ls /reports
# download by path (or by id) $ bkp dl /reports/q3-report.pdf -o ./q3.pdf
# back up a directory as an archive $ tar czf project.tar.gz ~/project $ bkp ul ./project.tar.gz
# scripting — no prompts, JSON output $ export [email protected] BKPDRIVE_TOKEN=bkp_pat_xxxx $ bkp --json ls | jq -r '.files[].id'