npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dtyq/teamshare-cli

v1.0.3

Published

Teamshare CLI

Readme

Teamshare CLI

teamshare-cli 是面向 Teamshare 多维表格能力的命令行工具。当前定位是:让人工、脚本和 Agent 可以用稳定命令操作 Teamshare 多维表格,从环境配置、凭证管理,到文件、数据表、字段、记录、视图、表单、仪表盘和图表组件的主链路管理。

安装

npm install -g @dtyq/teamshare-cli
teamshare-cli install
teamshare-cli --version

teamshare-cli install 会把 npm 包内置的 Teamshare AI Skills 安装到全局 skill 目录;只需要 CLI 命令时可跳过。

当前能力总览

配置与凭证

配置与凭证命令(用户侧):

teamshare-cli auth login                 # 默认 cn-saas,第一次返回浏览器授权地址
teamshare-cli auth login                 # 第二次执行:阻塞轮询,登录成功
teamshare-cli config status              # 查看当前环境与登录状态
teamshare-cli auth status                # 查看 credential 状态
teamshare-cli auth logout                # 退出登录

切环境必须先 auth logout,再 auth login --env <env>

Base 业务命令

当前 Base 已覆盖 9 类对象,共 49 条命令:

| 模块 | 数量 | 能力 | | --- | ---: | --- | | File | 5 | 多维表格文件创建、列表、详情、重命名、删除 | | Directory | 5 | 文件内目录创建、列表、详情、重命名、删除 | | Sheet | 5 | 文件内数据表创建、列表、详情、重命名、删除 | | Field | 5 | 字段创建、列表、详情、完整更新、删除 | | Record | 6 | 单条创建/更新、批量创建、批量更新、列表、详情、删除 | | View | 5 | 普通视图创建、列表、详情、重命名、删除 | | Form | 7 | 表单创建、列表、详情、配置、字段配置、重命名、删除 | | Dashboard | 6 | 仪表盘创建、列表、详情、重命名、布局替换、删除 | | Widget | 5 | 仪表盘组件创建、列表、详情、更新、删除 |

执行前阅读

本 README 只提供能力总览和命令索引,不承载完整参数、JSON 结构、写入前置条件和易错点。真正执行命令前,先阅读 skills/teamshare-base/SKILL.md,再按目标模块进入 skills/teamshare-base/references 下对应命令文档。

当前命令清单

file(5)

teamshare-cli base +file-create --name "..."
teamshare-cli base +file-list
teamshare-cli base +file-get --file-id <file_id>
teamshare-cli base +file-update --file-id <file_id> --name "..."
teamshare-cli base +file-delete --file-id <file_id> --yes

directory(5)

teamshare-cli base +directory-create --file-id <file_id> --name "..."
teamshare-cli base +directory-list --file-id <file_id>
teamshare-cli base +directory-get --directory-id <directory_id>
teamshare-cli base +directory-rename --directory-id <directory_id> --name "..."
teamshare-cli base +directory-delete --directory-id <directory_id> --yes

sheet(5)

teamshare-cli base +sheet-create --file-id <file_id> --name "..."
teamshare-cli base +sheet-create --file-id <file_id> --directory-id <directory_id> --name "..."
teamshare-cli base +sheet-list --file-id <file_id>
teamshare-cli base +sheet-get --sheet-id <sheet_id>
teamshare-cli base +sheet-update --sheet-id <sheet_id> --name "..."
teamshare-cli base +sheet-delete --sheet-id <sheet_id> --yes

field(5)

teamshare-cli base +field-create --sheet-id <sheet_id> --json '{"name":"...","type":"text"}'
teamshare-cli base +field-list --sheet-id <sheet_id>
teamshare-cli base +field-get --sheet-id <sheet_id> --field-id <field_id>
teamshare-cli base +field-update --sheet-id <sheet_id> --field-id <field_id> --json '{"name":"...","type":"text"}'
teamshare-cli base +field-delete --sheet-id <sheet_id> --field-id <field_id> --yes

当前字段定义能力覆盖:text / number / select / multiple / datetime / checkbox / link / created_at / updated_at / modifier / creator / auto_id

其中系统只读字段支持字段定义创建、更新和读取,不支持 record 写入。

record(6)

teamshare-cli base +record-upsert --sheet-id <sheet_id> --json '{"fields":{"<field_id>":"value"}}'
teamshare-cli base +record-upsert --sheet-id <sheet_id> --record-id <record_id> --json '{"fields":{"<field_id>":"value"}}'
teamshare-cli base +record-batch-create --sheet-id <sheet_id> --json '{"records":[{"fields":{"<field_id>":"v1"}},{"fields":{"<field_id>":"v2"}}]}'
teamshare-cli base +record-batch-update --sheet-id <sheet_id> --json '{"record_ids":["..."],"fields":{"<field_id>":"value"}}'
teamshare-cli base +record-list --sheet-id <sheet_id>
teamshare-cli base +record-get --sheet-id <sheet_id> --record-id <record_id>
teamshare-cli base +record-delete --sheet-id <sheet_id> --record-id <record_id> --yes

当前 record 写入能力覆盖:text / number / select / multiple / datetime / checkbox / link

view(5)

teamshare-cli base +view-create --sheet-id <sheet_id> --json '[{"name":"...","type":"table"}]'
teamshare-cli base +view-list --sheet-id <sheet_id>
teamshare-cli base +view-get --sheet-id <sheet_id> --view-id <view_id>
teamshare-cli base +view-rename --sheet-id <sheet_id> --view-id <view_id> --name "..."
teamshare-cli base +view-delete --sheet-id <sheet_id> --view-id <view_id> --yes

普通视图当前按 table / kanban / gantt / gallery 使用。表单视图使用 +form-* 命令。

form(7)

teamshare-cli base +form-create --sheet-id <sheet_id> --name "..."
teamshare-cli base +form-list --sheet-id <sheet_id>
teamshare-cli base +form-get --sheet-id <sheet_id> --view-id <view_id>
teamshare-cli base +form-config --sheet-id <sheet_id> --view-id <view_id> --json '{...}'
teamshare-cli base +form-field-config --sheet-id <sheet_id> --view-id <view_id> --json '[{...}]'
teamshare-cli base +form-rename --sheet-id <sheet_id> --view-id <view_id> --name "..."
teamshare-cli base +form-delete --sheet-id <sheet_id> --view-id <view_id> --yes

Form 是数据表下的表单视图,不是独立表单系统。表单字段只能来自数据表字段。

dashboard(6)

teamshare-cli base +dashboard-create --file-id <file_id> --name "..."
teamshare-cli base +dashboard-create --file-id <file_id> --directory-id <directory_id> --name "..."
teamshare-cli base +dashboard-list --file-id <file_id>
teamshare-cli base +dashboard-get --dashboard-id <dashboard_id>
teamshare-cli base +dashboard-update --dashboard-id <dashboard_id> --name "..."
teamshare-cli base +dashboard-set-layouts --dashboard-id <dashboard_id> --json '{"layouts":[{"i":"<widget_id>","x":0,"y":0,"w":12,"h":6}]}'
teamshare-cli base +dashboard-delete --dashboard-id <dashboard_id> --yes

widget(5)

teamshare-cli base +widget-list --dashboard-id <dashboard_id>
teamshare-cli base +widget-get --dashboard-id <dashboard_id> --widget-id <widget_id>
teamshare-cli base +widget-create --dashboard-id <dashboard_id> --json '{"widget":{"name":"说明","type":"rich-text","html":"<p>说明</p>"}}'
teamshare-cli base +widget-update --dashboard-id <dashboard_id> --widget-id <widget_id> --json '{"widget":{...}}'
teamshare-cli base +widget-delete --dashboard-id <dashboard_id> --widget-id <widget_id> --yes

当前 widget 文档覆盖 rich-textindicator 和常见 chart 结构。图表和指标的数据源使用 widget.sheetId 指向数据表;不要把 dashboard_id 当作数据源 ID。