apps-script (v1)
PREREQUISITE: Read ../gws-shared/SKILL.md for auth, global flags, and security rules. If missing, run gws generate-skills to create it.
CODEBLOCK0
Helper Commands
| Command | Description |
|---|
+push | Upload local files to an Apps Script project |
API Resources
processes
- list — List information about processes made by or on behalf of a user, such as process type and current status.
- listScriptProcesses — List information about a script's executed processes, such as process type and current status.
projects
- create — Creates a new, empty script project with no script files and a base manifest file.
- get — Gets a script project's metadata.
- getContent — Gets the content of the script project, including the code source and metadata for each script file.
- getMetrics — Get metrics data for scripts, such as number of executions and active users.
- updateContent — Updates the content of the specified script project. This content is stored as the HEAD version, and is used when the script is executed as a trigger, in the script editor, in add-on preview mode, or as a web app or Apps Script API in development mode. This clears all the existing files in the project.
- deployments — Operations on the 'deployments' resource
- versions — Operations on the 'versions' resource
scripts
- run —
Discovering Commands
Before calling any API method, inspect it:
CODEBLOCK1
Use gws schema output to build your --params and --json flags.
apps-script (v1)
前提条件: 请先阅读 ../gws-shared/SKILL.md 了解认证、全局标志和安全规则。如果该文件缺失,请运行 gws generate-skills 创建。
bash
gws apps-script <资源> <方法> [标志]
辅助命令
| 命令 | 描述 |
|---|
| +push | 将本地文件上传到 Apps Script 项目 |
API 资源
processes
- list — 列出由用户或代表用户创建的进程信息,例如进程类型和当前状态。
- listScriptProcesses — 列出脚本已执行进程的信息,例如进程类型和当前状态。
projects
- create — 创建一个新的空脚本项目,不包含脚本文件,仅包含基础清单文件。
- get — 获取脚本项目的元数据。
- getContent — 获取脚本项目的内容,包括每个脚本文件的代码源和元数据。
- getMetrics — 获取脚本的指标数据,例如执行次数和活跃用户数。
- updateContent — 更新指定脚本项目的内容。此内容存储为 HEAD 版本,在脚本作为触发器执行、在脚本编辑器中、在插件预览模式下,或作为 Web 应用或开发模式下的 Apps Script API 时使用。此操作会清除项目中所有现有文件。
- deployments — 对 deployments 资源的操作
- versions — 对 versions 资源的操作
scripts
- run —
发现命令
在调用任何 API 方法之前,请先检查:
bash
浏览资源和方法
gws apps-script --help
检查方法的必需参数、类型和默认值
gws schema apps-script.<资源>.<方法>
使用 gws schema 的输出来构建你的 --params 和 --json 标志。