在終端機使用 Bluesky:應該選哪個 CLI?

用 bsbot 管理你的 Bluesky.bot 帳號代碼,用 goat 處理一般的 AT Protocol 操作,用發文客戶端瀏覽時間軸和發文。我們錄製的工作階段會註明確切版本,以及使用的是公開資料還是本機說明。

作者:Bluesky.bot 團隊

發布日期:
更新日期:
審閱日期:

依用途選擇

要管理機械人的 name.bluesky.bot 帳號代碼(handle),請從 bsbot 和 CLI 參考文件開始。要做公開身份解析、匯出儲存庫、處理 CAR 檔案、查看 PLC 歷史記錄或遷移帳號,可以考慮 goat。要瀏覽時間軸或發文,可以考慮 mattn/bsky 或 AT Protocol SDK。這些工具的用途和權限各不相同。

版本和來源查核日期:2026 年 11 月 16 日。說明和公開讀取的擷取內容並未測試需要驗證的變更。
工具與版本最適合驗證與寫入安裝與授權條款來源與審閱

bsbot

0.1.0

TypeScript / Node.js ≥ 22

發布日期:2026年11月12日

管理你的機械人的 Bluesky.bot 帳號代碼;公開名稱查詢和瀏覽目錄。它不會發文,也不會讀取時間線。帳號操作使用瀏覽器 OAuth。它的權杖允許管理帳號代碼;與 Bluesky 應用程式專用密碼無關。npm install --global @blueskydotbot/[email protected]

MIT

有版本標記的來源

查核日期:2026年11月16日

goat

0.2.9

Go

發布日期:2026年11月6日

解析身份、檢視儲存庫和 CAR 檔案、讀取 PLC 歷史記錄、匯出資料,以及管理或遷移帳號。許多讀取是公開的。帳號寫入需以應用程式專用密碼登入;文件所述的客戶端會將憑證儲存在磁碟上。go install github.com/bluesky-social/[email protected]

MIT / Apache-2.0

有版本標記的來源

查核日期:2026年11月16日

mattn/bsky

0.0.82

Go

發布日期:2026年8月19日

Bluesky 發文和時間線客戶端,附有個人檔案、跟隨、內容審核和其他帳號命令。文件所述的登入方式接受帳號代碼和密碼。請使用應用程式專用密碼;需要驗證的命令可能會更改帳號。go install github.com/mattn/[email protected]

MIT

有版本標記的來源

查核日期:2026年11月16日

這份比較描述的是我們檢查過的正式版本,而不是尚未發布的儲存庫程式碼。我們在本機執行了 bsbot 和 bsky 的說明指令,用 bsbot 做了一次公開名稱查詢,並用 goat 做了一次公開 DID 解析。我們沒有執行需要登入的發文、遷移或帳號代碼變更。

安裝並確認實際版本

bash
npm install --global @blueskydotbot/[email protected]
bsbot --version
bsbot --help

固定的版本與擷取記錄相符。只想執行一次,請使用 npx @blueskydotbot/[email protected] --help。選擇較新版本之前,請先查看版本資訊。文件記載的需求是 macOS 或 Linux 上的 Node.js 22 以上;這次工作階段是在 Linux 上以 Node.js 24 執行。

bsbot 0.1.0 ·

本機命令;不連結帳號 · 結束代碼 0

bash
bsbot --help
bsbot 0.1.0: manage your Bluesky bots and their name.bluesky.bot handles.

Usage: bsbot <command> [options]

Account
  login [--no-browser] [--name <label>]
                           Sign in through the browser (OAuth, no password);
                           <label> names this machine in your settings
  logout                   Revoke this machine's token and forget it
  whoami                   Show the signed-in account

Handles
  check <name>             Is <name>.bluesky.bot free to claim?
  claim <bot> <name>       Claim <name>.bluesky.bot for a bot and switch to it
  switch <bot>             Ask the bot's server again to use its handle
  verify <bot>             Check that the bot's handle is live on Bluesky
  release <bot> [--yes]    Give the handle up (the bot goes back to its old one)

Bots
  bots                     List your bots
  directory [--q <text>] [--category <c>] [--verified] [--limit <n>] [--cursor <c>]
                           Browse the public directory

<bot> is a bot's DID, its handle, its previous handle, or the name of its
.bluesky.bot handle. Add bots from the dashboard: https://bluesky.bot/manage

Options
  --json                   Machine-readable output (never contains the token)
  --api-url <url>          Another server (or BSBOT_API_URL)
  -h, --help               This help
  -v, --version            The version

從公開讀取開始

check 會查詢某個名稱是否可用。它不會保留或領取該名稱。擷取記錄中的名稱屬於本項目的 CLI 帳號;可用狀態和建議日後可能改變。

bsbot 0.1.0 ·

唯讀的公開 Bluesky.bot API · 結束代碼 0

bash
bsbot check cli --json
{
  "name": "cli",
  "handle": "cli.bluesky.bot",
  "available": false,
  "reason": "taken",
  "suggestions": [
    "cli2",
    "cli-24",
    "cli3"
  ]
}

登入並管理你自己的機械人

以下指令是操作說明,而不是錄製下來的已登入工作階段。請先在控制台新增機械人。執行 bsbot login,在瀏覽器中確認帳號和機器名稱,然後授權。你的 Bluesky 密碼不會經過 bsbot。它的權杖用於 Bluesky.bot,而不是用來在 Bluesky 發文。

bash
bsbot login
bsbot whoami
bsbot bots

選好你自己的機械人 DID 和一個可用的名稱後,已發布的語法如下:

bash
bsbot claim BOT_DID chosen-name
bsbot switch BOT_DID
bsbot verify BOT_DID

請替換預留位置。claim 會領取名稱,並要求機械人的伺服器切換;switch 會重試這項變更。verify 會檢查帳號代碼是否已啓用。重試之前,請先閱讀實際回傳的狀態:等待中的變更可能只需要一點時間,而需要手動處理的回應則要你採取行動。請參閱帳號代碼驗證。

Doctor 與 CI:區分伺服器和 CLI 版本

我們檢查的 npm 套件是 0.1.0,儘管原始碼儲存庫描述了之後的開發內容。它不包含 doctor、listing,也不支援 BSBOT_TOKEN。以下「未知指令」的擷取記錄是真實的;它們不是成功的健康檢查或目錄資料更新。

bsbot 0.1.0 ·

本機命令;不連結帳號 · 結束代碼 2

bash
bsbot doctor --json
{"error":{"code":"usage","message":"Unknown command \"doctor\". See bsbot --help."}}

bsbot 0.1.0 ·

本機命令;不連結帳號 · 結束代碼 2

bash
bsbot listing get cli --json
{"error":{"code":"usage","message":"Unknown command \"listing\". See bsbot --help."}}

目前請使用控制台的健康檢查。API 參考文件說明了需要驗證的 doctor 和 listing 端點,以及只能更新目錄資料的部署權杖。在 CI 中,請依照這份 HTTP 規格操作,把機密存放在 CI 的機密儲存區,並將部署權杖限定於目標機械人。HTTP 範例並不代表尚未發布的 bsbot listing set 指令已受支援。指令相容性的細節仍以 CLI 參考文件為準。

用 goat 進行唯讀的 AT Protocol 操作

這次工作階段解析了 bsky.app 的公開 DID。它沒有登入,也沒有變更帳號。回傳的 DID 文件記載了擷取當下的帳號代碼、公開密鑰和服務端點。匯出儲存庫和遷移是不同的指令,風險也不同;使用前請先參考對應版本的 goat 原始碼。

goat goat version 0.2.9 ·

唯讀的公開 AT Protocol 資料 · 結束代碼 0

bash
goat resolve did:plc:z72i7hdynmk6r22z27h6tvur
{
  "@context": [
    "https://www.w3.org/ns/did/v1",
    "https://w3id.org/security/multikey/v1",
    "https://w3id.org/security/suites/secp256k1-2019/v1"
  ],
  "id": "did:plc:z72i7hdynmk6r22z27h6tvur",
  "alsoKnownAs": [
    "at://bsky.app"
  ],
  "verificationMethod": [
    {
      "id": "did:plc:z72i7hdynmk6r22z27h6tvur#atproto",
      "type": "Multikey",
      "controller": "did:plc:z72i7hdynmk6r22z27h6tvur",
      "publicKeyMultibase": "zQ3shQo6TF2moaqMTrUZEM1jeuYRQXeHEx4evX9751y2qPqRA"
    }
  ],
  "service": [
    {
      "id": "#atproto_pds",
      "type": "AtprotoPersonalDataServer",
      "serviceEndpoint": "https://puffball.us-east.host.bsky.network"
    }
  ]
}

用 bsky 發文和瀏覽時間軸

擷取的說明來自下載的 mattn/bsky 0.0.82 版本。它列出了時間軸、發文和帳號操作。我們沒有登入,也沒有執行它的任何寫入指令。它的上游文件是功能的出處,並不代表我們的工作階段測試過每個指令。

bsky bsky version 0.0.82 ·

本機命令;不連結帳號 · 結束代碼 0

bash
bsky --help
NAME:
   bsky - bsky

USAGE:
   bsky [global options] command [command options]

VERSION:
   0.0.82

DESCRIPTION:
   A cli application for bluesky

COMMANDS:
   show-profile         Show profile
   update-profile       Update profile
   show-session         Show session
   timeline, tl         Show timeline
   stream               Show timeline as stream
   thread               Show thread
   post                 Post new text
   vote                 Vote the post
   votes                Show votes of the post
   repost               Repost the post
   reposts              Show reposts of the post
   follow               Follow the handle
   unfollow             Unfollow the handle
   follows              Show follows
   followers            Show followers
   block                Block the handle
   unblock              Unblock the handle
   blocks               Show blocks
   mute                 Mute the handle
   unmute               Unmute the handle
   mutes                Show muted users
   report               Report the handle
   moderation-list      Add the handle to a new moderation list
   lists                Show lists
   list                 Show list items
   chat                 Direct messages
   delete               Delete the note
   search               Search Bluesky
   search-actors        Search Actors
   login                Login the social
   notification, notif  Show notifications
   invite-codes         Show invite codes
   list-app-passwords   Show App-passwords
   add-app-password     Add App-password
   revoke-app-password  Revoke App-password
   mcp                  Start MCP server
   help, h              Shows a list of commands or help for one command

GLOBAL OPTIONS:
   -a value       profile name
   -V             verbose (default: false)
   --help, -h     show help
   --version, -v  print the version

讓每個憑證只用於它的用途

bsbot 會把自己的權杖存放在 ~/.config/bsbot/credentials.json,權限僅限用戶本人;預設有效期為 30 天。bsbot logout 會撤銷該權杖。控制台也可以撤銷 CLI 存取權。請讓憑證遠離日誌和版本控制。

對於以參數接收 Bluesky 密碼的客戶端,請建立應用程式專用密碼,而不是提供帳號密碼。goat 的文件說明它會把應用程式專用密碼和權杖存在磁碟上;它的登出會移除這個本機驗證檔案。發文客戶端的憑證可能允許發文和其他帳號變更,這與 Bluesky.bot 的帳號代碼權杖不同。啓用無人看管的工作之前,請先檢查權限範圍、本機儲存方式和撤銷方法。

關於 Bluesky CLI 的問題

bsbot 可以在 Bluesky 上發文嗎?
不可以。查核的 npm 版本用來管理 Bluesky.bot 帳號代碼和瀏覽目錄。如要發文,請使用發文客戶端或 AT Protocol SDK。
為甚麼 bsbot doctor 顯示 unknown command?
記錄的 npm 0.1.0 套件沒有 doctor 或目錄資料命令。單有伺服器端點,並不會為已安裝的 CLI 新增命令。在依賴較新的功能之前,請先查看版本資訊。
我可以在 CI 中配合 BSBOT_TOKEN 使用已發布的 bsbot 嗎?
查核的 0.1.0 套件不會讀取這個環境變數。伺服器為直接的 HTTP 請求提供僅限目錄資料的部署權杖;請使用它的 API 參考文件,並將密鑰保存在 CI 的密鑰儲存區中。

資料來源