New:Socket for Asana Is Now Available.Learn more
Get Started

@harukibox/cli

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@harukibox/cli

Official harukibox CLI — thin command-line wrapper around the harukibox Agent API.

Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
8
60%
Maintainers
1
Weekly downloads
 
Created
Source

@harukibox/cli

官方 harukibox 命令列工具。純粹是 Agent API 的薄薄一層 wrapper,不會自己呼叫任何 AI。

安裝

npm install -g @harukibox/cli

登入

最簡單的方式(OAuth 2.1 PKCE,瀏覽器自動跳):

harukibox login

CLI 會:

  • 起一個 localhost server,產生 PKCE verifier/challenge
  • 開你的預設瀏覽器到 harukibox 的 /oauth/authorize
  • 你在網頁登入後按「授權」,瀏覽器自動 callback 回 localhost
  • CLI 用 code + verifier 換到 token,存到 ~/.config/harukibox/config.json(mode 0600)

沒有桌面瀏覽器(SSH、devcontainer、CI)?

CLI 會自動退回 RFC 8628 device flow

🔐 在瀏覽器開啟下方網址並輸入代碼:
   https://harukibox.com/oauth/device
   代碼:BHJK-MNPQ

你開任何一台有瀏覽器的裝置,到該網址輸入代碼即可。

也可以強制走 device flow:

harukibox login --device

Power user / 自動化腳本

如果已經有 hrk_live_* token(例如從另一台機器跑過 harukibox login),可手動帶入:

harukibox login --token hrk_live_xxx
# 或用環境變數
HARUKIBOX_TOKEN=hrk_live_xxx harukibox whoami

常用指令

harukibox whoami
harukibox products list --search 'pokemon' --limit 50
harukibox products get <product-id>
harukibox products create --name "新商品" --sku "ABC-001" --price-twd 1500
harukibox orders list --status pending
harukibox buyers list --search "陳"
harukibox shipments list
harukibox search "海賊王"
harukibox logout                # 預設 RFC 7009 撤銷伺服器 token + 刪本地 config
harukibox logout --keep-remote  # 只刪本地 config(token 仍在伺服器有效到期)

--json 旗標把輸出改成原始 JSON,方便 pipe 給 jq

harukibox products list --limit 5 --json | jq '.data[].name'

Self-host / 私有部署

harukibox login --token hrk_live_xxx --base-url https://your-instance.example.com/api/agent

安全

  • Token 一律以 Bearer header 傳送,走 HTTPS
  • Config 檔 mode 0600,僅當前 user 可讀
  • 過期 / 撤銷 / IP 不在 allowlist 時呼叫會立即被拒,CLI 顯示伺服器回的錯誤訊息
  • 每次呼叫都會被記錄到伺服器端 audit log(沒有 web UI 查詢;如需匯出請與服務方聯繫)

License

MIT

FAQs

Package last updated on 15 May 2026

Related posts