hcli-hstorage cli
H存储 命令行界面—允许您从终端管理文件、文件夹、团队等。
招致 是用框架构筑的,对人和AI代理都容易使用的CLI。
示例演示

目次
- 文件操作 - 文件夹操作 - 文件夹共享 - 团队管理 - 用户管理
- 注册为MCP服务器 - 同步技能文件 - --llms 旗子 - --mcp 旗子 - --schema 旗子
- auth —认证 - file —文件管理 - folder —文件夹管理 - folder-share —文件夹共享 - team —团队管理 - user —用户管理
快速启动
1.安装
curl -fsSL https://raw.githubusercontent.com/HCloud-Ltd/hstorage-cli/main/install.sh | shその他のインストール方法
指定版本
curl -fsSL https://raw.githubusercontent.com/HCloud-Ltd/hstorage-cli/main/install.sh | HCLI_VERSION=v0.0.3 sh更改安装位置
curl -fsSL https://raw.githubusercontent.com/HCloud-Ltd/hstorage-cli/main/install.sh | HCLI_INSTALL_DIR=~/.bin sh默认情况下 /usr/local/bin 中所述修改相应参数的值。没有写入权限时 ~/.local/bin 中所述修改相应参数的值。
从源构建
bun install
bun run build
mv hcli /usr/local/bin/hcli开发中 bun run dev -- 而需要与环境混合的每条反射光线,进行环境采样。2.认证
使用HStorage的API密钥进行认证。API密钥 汇编仪表盘 中所述修改相应参数的值。
hcli auth login --email you@example.com --api-key YOUR_API_KEY --secret-key YOUR_SECRET_KEY认证信息是 ~/.config/hstorage/credentials.json 中所述修改相应参数的值。
# 認証状態を確認
hcli auth status
# ログアウト(認証情報を削除)
hcli auth logout3. 基本操作
# ファイル一覧を表示
hcli file list
# ファイルをアップロード
hcli file upload ./document.pdf
# ファイルをダウンロード
hcli file download abc123 --output ./downloaded.pdf
# フォルダ一覧を表示
hcli folder list使用例
文件操作
# ファイル一覧を取得(ページネーション付き)
hcli file list --limit 50 --offset 0
# ファイルの詳細情報を取得
hcli file info abc123
# パスワード付きファイルの情報を取得
hcli file info abc123 --password mypassword
# ファイルをアップロード(オプション付き)
hcli file upload ./report.pdf \
--password secretpass \
--download-limit-count 5 \
--delete-date 2026-12-31T00:00:00Z \
--folder-uid folder-uid-here
# ファイルをダウンロード
hcli file download abc123
hcli file download abc123 --output ./local-copy.pdf
hcli file download abc123 --password filepassword
# ファイルを別のフォルダに移動
hcli file move --external-id abc123 --target-folder-id 42
# ファイルをメールで送信
hcli file email --external-id abc123 --email recipient@example.com
# ファイルを削除(確認付き)
hcli file delete abc123 --confirm文件夹操作
# フォルダ一覧を表示
hcli folder list
# UID でフォルダを取得
hcli folder get folder-uid-here
# フォルダを作成
hcli folder create --name "プロジェクト資料"
# 子フォルダを作成
hcli folder create --name "設計書" --parent-id 1
# 公開フォルダを作成
hcli folder create --name "公開ファイル" --public-view true --public-upload true
# フォルダ名を変更
hcli folder update --id 1 --name "新しい名前"
# フォルダを削除
hcli folder delete --id 1 --confirm文件夹共享
# フォルダの共有一覧を表示
hcli folder-share shares --folder-uid folder-uid-here
# フォルダを共有(権限: read / edit / admin)
hcli folder-share share \
--folder-uid folder-uid-here \
--email colleague@example.com \
--permission edit
# 共有権限を変更
hcli folder-share update-share \
--folder-uid folder-uid-here \
--email colleague@example.com \
--permission read
# 共有を解除
hcli folder-share remove-share \
--folder-uid folder-uid-here \
--email colleague@example.com
# 自分に共有されたフォルダの一覧
hcli folder-share shared-folders团队管理
# チーム情報を表示
hcli team info
# メンバーを招待
hcli team invite --email newmember@example.com
# メンバーを削除
hcli team remove-member user-id-here
# チームのストレージ状況を確認
hcli team storage
# メンバーのストレージ割り当てを変更
hcli team update-storage --user-id user-id-here --storage-limit 10737418240用户管理
# ユーザー情報を表示
hcli user info
# ユーザー設定を取得
hcli user settings-get
# ユーザー設定を更新
hcli user settings-update --key value输出格式
可以在所有命令中指定输出格式:
# デフォルト(TOON 形式 — トークン効率が高く、JSON より約 40% 少ないトークン数)
hcli file list
# JSON 形式
hcli file list --format json
# YAML 形式
hcli file list --format yaml
# Markdown テーブル形式
hcli file list --format md
# JSONL 形式(行区切り JSON)
hcli file list --format jsonl过滤输出
--filter-output 中所需的字段:
# ファイル名だけ取得
hcli file list --filter-output uploads.name
# 複数フィールドを指定
hcli file list --filter-output uploads.name,uploads.size标记控制
如果要通过分页获取大输出:
# トークン数を確認
hcli file list --token-count
# 最初の 100 トークンだけ取得
hcli file list --token-limit 100
# 100 トークン目から次の 100 トークンを取得
hcli file list --token-offset 100 --token-limit 100查看整个响应
# メタデータ付きの完全なレスポンス
hcli file list --verboseAI代理协作
这个CLI 招致 它由框架构建,可与人工智能代理(Claude Code、Cursor、Amp等)进行本地协作。
注册为MCP服务器
将CLI作为“MCP(Model Context Protocol)”服务器注册到AI代理中。所有命令都作为MCP工具公开,代理可以直接调用。
# グローバルに登録(推奨)
hcli mcp add
# 特定のエージェントに登録
hcli mcp add --agent claude-code
hcli mcp add --agent cursor
# プロジェクト単位で登録
hcli mcp add --no-global注册后,AI代理可以通过“将文件上传到HStorage”等自然语言的指示调用CLI。
同步技能文件
通过CLI命令定义自动生成技能文件(Markdown),使代理能够学习CLI的使用方法。比MCP轻,可以抑制令牌消耗。
# スキルファイルをグローバルにインストール
hcli skills add
# プロジェクトにインストール
hcli skills add --no-global
# グルーピングの深さを指定
hcli skills add --depth 2--llms 旗子
以AI容易读的形式输出所有命令的规格。代理可以准确掌握命令的参数和选项。
# コマンド一覧(概要)
hcli --llms
# 全コマンドの詳細仕様(引数・オプション・型情報)
hcli --llms-full
# JSON スキーマ形式で出力
hcli --llms --format json--mcp 旗子
将CLI作为MCP stdio服务器启动。代理可以通过stdin/stdout调用命令。
hcli --mcp--schema 旗子
输出单个命令的JSON架构:
hcli file upload --schemaargs:
type: object
properties:
filePath:
type: string
description: Local file path to upload
required[1]: filePath
options:
type: object
properties:
downloadLimitCount:
description: Max download count
type: number
password:
description: Password protection
type: string
deleteDate:
description: Auto-delete date (ISO 8601)
type: string
folderUid:
description: Target folder UID
type: string壳完成
# Bash
eval "$(hstorage completions bash)" # ~/.bashrc に追加
# Zsh
eval "$(hstorage completions zsh)" # ~/.zshrc に追加
# Fish
hstorage completions fish | source # ~/.config/fish/config.fish に追加
# Nushell
hstorage completions nushell # config.nu の手順を確認命令参考
auth —认证
|子命令|说明| | ------------ | ---------------------------- | | login 登录HStorage | logout |注销并删除认证信息| | status 查看当前认证状态
file —文件管理
|子命令|说明| | ----------------------- | ---------------------------------- | | list 查看文件列表 | info 获取文件信息 | upload 将文件上传到HStorage | download 下载文件 | update 更新文件状态 | delete 删除文件 | move 将文件移动到其他文件夹 | email 用邮件发送文件
folder —文件夹管理
|子命令|说明| | ------------ | -------------------- | | list 查看文件夹列表 | get 用UID获取文件夹 | create 创建文件夹 | update 更新文件夹 | delete 删除文件夹
folder-share —文件夹共享
|子命令|说明| | ---------------- | ------------------------------------ | | shares 查看文件夹共享列表 | share 创建文件夹共享 | update-share 更新文件夹共享 | remove-share 取消文件夹共享 | shared-folders 查看共享给自己的文件夹列表
team —团队管理
|子命令|说明| | ------------------------ | ---------------------------------- | | info 查看团队信息 | invite 邀请团队成员 | remove-member |删除团队成员| | storage 查看团队存储状态 | update-storage 更改成员的存储分配
user —用户管理
|子命令|说明| | ----------------- | ------------------ | | info 查看用户信息 | delete 删除帐户 | settings-get 获取用户设置 | settings-update 更新用户设置
全局选项
|标志|说明| | ---------------------------------------- | --------------------------------- | | --format 指定输出格式 | --filter-output 用密钥路径过滤输出 | --verbose 查看整个响应 | --help 查看命令帮助 | --version 查看版本 | --schema 查看命令的JSON架构 | --llms / --llms-full 输出面向AI的命令清单 | --mcp 作为MCP stdio服务器启动 | --token-count 查看输出的标记数 | --token-limit 将输出限制为n个令牌 | --token-offset 跳过输出的开头n个令牌
动作要件
- 包子 v1.3 以上
开発
# 依存関係のインストール
bun install
# 開発モードで実行
bun run dev -- file list
# テスト
bun test
# ビルド
bun run buildAPI
这个CLI https://api.hstorage.io 中描述的相应参数的值。有关端点的详细信息,请参见 API文档 来修改标记元素的显示属性。
