Skip to main content

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

Project description

artdam-cli

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

安装

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

# 或使用 pip
pip install artdam-cli

快速开始

# 登录(首次使用,服务器地址已内置)
artdam login --username <用户名> --password <密码>

# 查看可访问的项目列表(获取项目 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

artdam login --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. 登录
artdam login --username <用户名> --password <密码>

# 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.dsworks.cn",
  "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.1.tar.gz (11.5 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.1-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: artdam_cli-0.2.1.tar.gz
  • Upload date:
  • Size: 11.5 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.1.tar.gz
Algorithm Hash digest
SHA256 c3e7298248a79f26ff6a0753db885a425e0b3e5b0c3bb4a30c56dbcb98d62dd7
MD5 ff8f43e8578a374327bc39d17e24cddb
BLAKE2b-256 4652fa88907364abb3d02be51b73c25a3ad7944dbbeac19dc2f95723a434ee0b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: artdam_cli-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 17.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 39897b2aafc51af0e31a7472ffea6629c136243cb2324fa9222a365694b228ce
MD5 f819eea40d66e84eb56029ac63db61cd
BLAKE2b-256 1461eea5d00665dfedc125821dac7302ee2c88d0fda2d659987ea7f468332dad

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