Skip to main content

ArtDAM 数字资产管理平台命令行工具

Project description

artdam-cli

ArtDAM 数字资产管理平台命令行工具,支持所有主流 AI Agent工具接入

安装

# 推荐(无需 Python 环境)
uv tool install artdam-cli

# 或使用 pip
pip install artdam-cli

快速开始

# 登录(默认走 SSO,自动打开浏览器完成授权)
artdam login

# 用账号密码登录
artdam login --password --username <用户名>

# 查看可访问的项目列表(获取项目 ID)
artdam projects

# 设置默认项目(之后无需每次输入 -p)
artdam project use 1

# 搜索资产
artdam search "关键词"

# 查看资产详情
artdam get 123

# 下载资产
artdam download 123 --out ./downloads

命令说明

查询命令(viewer 及以上)

artdam projects

列出当前用户可访问的所有项目(含 ID)。

artdam projects
artdam projects --json   # 输出原始 JSON(AI Agent 用)

artdam project use / show

设置或查看默认项目,设置后所有命令无需再传 -p

artdam project use 1     # 设置默认项目 ID 为 1
artdam project show      # 查看当前默认项目

artdam login

登录 ArtDAM,保存 token 到本地 ~/.artdam/config.json

默认走 SSO 浏览器授权(推荐):

artdam login
# 自动打开浏览器 → 完成公司 SSO 授权 → token 写入本地配置

账号密码登录(仅管理员 / 服务账号):

artdam login --password --username <用户名>
# 回车后提示输入密码(不回显)
参数 说明
--url 服务器地址(默认已内置,无需填写)
--password 切换为账号密码模式(不加此 flag 默认走 SSO)
--username 用户名(仅 --password 模式)

artdam search

搜索资产,返回匹配列表。

artdam search "场景"                        # 使用默认项目
artdam search "场景" --project 1            # 临时指定项目
artdam search "场景" --limit 50
artdam search "场景" --type image/png
artdam search "场景" --folder 10
artdam search "场景" --json                 # 输出原始 JSON(AI Agent 用)
参数 说明
KEYWORD 搜索关键词
-p, --project 项目 ID(省略则使用默认项目)
-n, --limit 返回数量上限(默认 20)
--type 文件类型,如 image/png
--folder 限定文件夹 ID
--json 输出原始 JSON

artdam get

查看单个资产详情(含预览链接)。

artdam get 123
artdam get 123 --json   # 输出原始 JSON(AI Agent 用)

artdam download

下载资产文件到本地。

artdam download 123
artdam download 123 --out ./downloads

artdam tags

列出项目标签。

artdam tags                        # 使用默认项目
artdam tags --search "角色"
artdam tags --json

artdam folders

查看文件夹结构。

artdam folders                     # 使用默认项目
artdam folders --json

资产管理(member 及以上)

artdam upload

上传文件到指定项目和文件夹。

artdam upload ./image.jpg                  # 使用默认项目
artdam upload ./image.jpg --folder 10
artdam upload ./image.jpg --project 1      # 临时指定项目

artdam update

更新资产信息(可同时传多个选项)。

artdam update 123 --name "新文件名"
artdam update 123 --description "新描述"
artdam update 123 --folder 10

artdam delete

软删除资产(可通过 restore 恢复)。

artdam delete 123

artdam restore

恢复已删除的资产。

artdam restore 123

标签管理(member 及以上)

# 给资产添加标签
artdam tag add 123 5

# 从资产移除标签
artdam tag remove 123 5

# 创建新标签(省略 -p 则使用默认项目)
artdam tag create "标签名"
artdam tag create "标签名" --project 1

文件夹管理(member 及以上)

# 创建文件夹(省略 -p 则使用默认项目)
artdam folder create "文件夹名"
artdam folder create "子文件夹" --parent 10

# 删除文件夹
artdam folder delete 10

互动操作(member 及以上)

# 评论
artdam comment 123 "评论内容"

# 评分(1-5 星)
artdam rate 123 4

# 收藏 / 取消收藏
artdam favorite 123
artdam favorite 123 --remove

AI Agent 使用指南

所有查询命令支持 --json 输出原始 JSON,适合 Agent 解析:

artdam projects --json
artdam search "安妮" --json
artdam get 123 --json
artdam tags --json
artdam folders --json

典型 Agent 工作流

# 1. 登录(SSO 浏览器授权,完成后自动保存 token)
artdam login

# 2. 查询项目列表,选择目标项目并设为默认
artdam projects --json
artdam project use 1

# 3. 搜索 → 确认 → 下载
artdam search "头盔" --json
artdam get 50707 --json
artdam download 50707 --out ./assets

# 4. 搜索 → 批量打标签
artdam search "安妮" --json
artdam tag add 50707 5
artdam tag add 50708 5

# 5. 上传并更新描述
artdam upload ./new_asset.jpg --folder 10
artdam update <asset_id> --description "AI 生成的场景描述"

注意事项

  • 首次使用先运行 artdam projects 获取项目 ID,再 artdam project use <id> 设置默认项目
  • 设置默认项目后,search / tags / folders / upload 等命令无需再传 -p
  • -p 仍可临时覆盖默认项目
  • --json 返回原始 JSON,适合程序解析
  • token 保存在 ~/.artdam/config.json,登录一次长期有效
  • artdam delete 是软删除,可用 artdam restore 恢复
  • Windows CMD 下中文乱码时,在命令前加 PYTHONUTF8=1

配置文件

登录信息保存在 ~/.artdam/config.json

{
  "base_url": "https://artdam.xindong.com",
  "token": "eyJ...",
  "default_project": 1
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

artdam_cli-0.2.3.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

artdam_cli-0.2.3-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file artdam_cli-0.2.3.tar.gz.

File metadata

  • Download URL: artdam_cli-0.2.3.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for artdam_cli-0.2.3.tar.gz
Algorithm Hash digest
SHA256 d6e7b5e228e15785a1767b50b62e2536d1196e51a1be8d4c13cd2fd5f592ea46
MD5 fbc8638091e926f8eff5cf8b6f6343d9
BLAKE2b-256 964ee71b586eb1981ea636944b81d40a385ba052661ff399b71f85bbe5b29f5d

See more details on using hashes here.

File details

Details for the file artdam_cli-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: artdam_cli-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for artdam_cli-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 204340bdf8f66f9594d57b7f11f5d8f0999560d8124f9db69da450753646e29e
MD5 d510789d6490d3ec0fab23730107eb66
BLAKE2b-256 82db0130743aa4e549da6c17effc0e4a3257d86327ec7613f3bae12ad95c5ede

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page