Bootstrap Google Tools 标志

Bootstrap Google Tools

组织热门
google
bootstrap-google-tools

Install/auth CLIs the sandbox lacks - `gws` (Drive, Gmail, Sheets, Calendar), `gcloud`, `agents-cli`, `mcp-cli` (MCP servers). Use on "command not found" or before GCP/Workspace/MCP work.

概览

发布者google
代码仓库adk-recipes
技能名称bootstrap-google-tools
星标数
10.4K
复刻数
2.9K
附带文件
仅含指令
许可协议Apache-2.0
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 google 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Bootstrap Google Tools AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/google/adk-recipes/tree/main/core/python/long-horizon-harness/horizon/builtin_skills/bootstrap-google-tools
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/google/adk-recipes.git /tmp/adk-recipes
mkdir -p .claude/skills
cp -r /tmp/adk-recipes/core/python/long-horizon-harness/horizon/builtin_skills/bootstrap-google-tools .claude/skills/bootstrap-google-tools
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Bootstrap Google Tools,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Bootstrap Google Tools。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Bootstrap Google Tools 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Install & authenticate CLIs in the sandbox

The sandbox ships lean — Node, gws, gcloud, agents-cli, and mcp-cli are not prebaked. This skill is the verified install + auth recipe for each. The tools are independent: install only the one the task needs. This is a menu, not a sequence — there's no 1-2-3 to run in order.

Persistence model — binaries in ~/.local, credentials in /workspace

Two different durability rules, because the sandbox has two boundaries:

  • Across normal sessions the sandbox reattaches, so everything ($HOME included) persists. Install once, reuse next session.
  • Across a runtime-image upgrade the sandbox is re-provisioned and only /workspace is migrated — and that migration is a zip that drops symlinks and strips executable bits (and is best-effort). So it can't carry installed CLIs at all; it's only safe for plain data files.

That dictates the split:

WhatWhereOn upgrade
CLI binaries~/.local (bin dir ~/.local/bin is on PATH)gone — reinstalled (cheap, automatic via the command -v check)
Credentials / config/workspace/lha/config/ (gws/, gcloud/, mcp_servers.json)migrated — logins survive

So: install binaries the normal way, but point each tool's config dir at /workspace/lha/config (via its own env var, shown per tool) so the expensive part — the OAuth client + tokens — survives upgrades. Don't put binaries on /workspace: they can't migrate anyway, and bloating the migration zip risks the credentials that can. ~/.local/bin is already on PATH (runtime image), and the bash shell is non-login (no ~/.profile), so that image PATH is what makes installs resolve.

Pick what you need

TaskToolNeeds first
Google Workspace — Drive / Gmail / Sheets / Calendar / ChatgwsNode
Raw GCP, or creating a gws OAuth client by handgcloud—
Call another agent deployed remotely (A2A / ADK)agents-cli— (uv is present)
Use tools exposed by an MCP servermcp-cli— (standalone binary)

Each tool's usage lives in its own skill (google-workspace, mcp-cli's shipped skill, the google-agents-cli-* set). This skill only gets a tool installed and authed, then hands off.

Before installing: check first

Within a session (and across sessions without an upgrade) a tool may already be present — check before installing, and install only what's missing:

bash(command="command -v gws")   # or gcloud / agents-cli / mcp-cli / node

Node + npm (prerequisite for gws)

The sandbox is Debian x86_64 with curl and tar but no xz. So you must download the .tar.gz build, not the .tar.xz. Pick a current LTS version:

bash(command='mkdir -p ~/.local/bin && cd ~ && V=v22.x.x && \
  curl -fsSLo node.tgz "https://nodejs.org/dist/$V/node-$V-linux-x64.tar.gz" && \
  tar -xzf node.tgz -C ~/.local && rm node.tgz && \
  ln -sf ~/.local/node-$V-linux-x64/bin/node ~/.local/node-$V-linux-x64/bin/npm ~/.local/node-$V-linux-x64/bin/npx ~/.local/bin/')

Replace v22.x.x with the real current LTS. The ln -sf … ~/.local/bin/ step puts node/npm/npx on PATH. Then verify:

bash(command="node --version && npm --version")
  • Use .tar.gz — .tar.xz will fail to extract (xz is absent).

gws — Google Workspace CLI

Install the npm global into ~/.local (needs Node on PATH — see above) with --prefix, so the binary lands at ~/.local/bin/gws:

bash(command='npm install -g --prefix ~/.local @googleworkspace/cli && gws --version')

Expect 0.22.x. gws self-identifies as "not an officially supported Google product."

Keep gws credentials on /workspace. By default gws reads/writes ~/.config/gws — which is not migrated on a runtime upgrade. Point it at /workspace and use the file keyring (no OS keyring headless) on every gws command so the OAuth client, token, and encryption key survive:

export GOOGLE_WORKSPACE_CLI_CONFIG_DIR=/workspace/lha/config/gws
export GOOGLE_WORKSPACE_CLI_KEYRING_BACKEND=file

First, always: probe the pre-injected token. When the user has used "Connect Workspace" in the web UI, the GOOGLE_WORKSPACE_CLI_TOKEN secret is auto-injected into every bash command — gws's highest-priority auth source. Don't inspect the environment or ask; just run a cheap read against the surface you need and see if it works:

bash(command="export GOOGLE_WORKSPACE_CLI_CONFIG_DIR=/workspace/lha/config/gws GOOGLE_WORKSPACE_CLI_KEYRING_BACKEND=file && gws gmail messages list --params '{\"maxResults\": 1}'")

If it returns data, you're done — no OAuth client, no gws auth login, no loopback bridge. It's a ~1h token (no refresh); the user re-clicks Connect when it lapses. The token only carries the surfaces + access level (read-only by default) the user picked — a gws call outside those scopes fails (403/scope error), which means "reconnect with more surfaces or read-write," not that the token is missing. Don't trust gws auth status — with the env token it reports auth_method: none / credential_source: token_env_var even while reads succeed, so a real read is the only reliable check. Only if the probe 401s (truly no token) do you fall through to the OAuth-client options below.

Otherwise, point gws at an OAuth client — gws ships none of its own. Pick one:

  1. Drop a client_secret.json into /workspace/lha/config/gws/ (must be a Desktop app OAuth client — see the google-workspace skill).
  2. Set GOOGLE_WORKSPACE_CLI_CLIENT_ID + GOOGLE_WORKSPACE_CLI_CLIENT_SECRET.
  3. Service account: GOOGLE_APPLICATION_CREDENTIALS=/workspace/lha/config/gws/key.json — for fully unattended automation (no interactive login).
  4. gws auth setup — provisions a project + OAuth client, but is a full-screen TUI that can't be driven headless; prefer option 1 in the sandbox.

gws auth login is loopback-browser only, but does complete headless — you bridge the OAuth redirect by hand (start it backgrounded, relay the auth URL to the user, then curl their pasted localhost:<port>/?code=... redirect back to the waiting listener). The google-workspace skill has the full auth recipe (Desktop-app client type, Internal audience, the loopback bridge) plus command shapes (Drive, Docs, Sheets, Gmail, Calendar, Chat). For fully unattended jobs with no user present to paste the redirect, use the service-account option.

Under a routine, the Google/gcloud token is present only if you declared its secret name (GOOGLE_WORKSPACE_CLI_TOKEN / CLOUDSDK_AUTH_ACCESS_TOKEN) in the routine's secrets:.

Once gws is set up, strongly suggest installing Google's official gws skills. They live in the googleworkspace/cli repo and go deeper than the builtin google-workspace skill — one per surface. Install the ones the user needs (gws-shared is the common base the others build on):

bash(command="npx --yes skills add googleworkspace/cli@gws-shared -y")
bash(command="npx --yes skills add googleworkspace/cli@gws-gmail -y")
# also: gws-drive, gws-docs, gws-docs-write, gws-sheets, gws-calendar,
#       gws-events, gws-chat-send

The Skills CLI stages each under .agents/skills/<skill>/, which Horizon auto-discovers — just load_skill(action="reload"), no move needed (see the find-skills skill for details). (npx --yes skills find gws lists the current set with install counts.)

gcloud

Install under ~/.local (slim — don't add extra components) and symlink the entrypoints onto PATH:

bash(command='mkdir -p ~/.local/bin && cd ~/.local && \
  curl -fsSLo gcloud.tgz "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-linux-x86_64.tar.gz" && \
  tar -xzf gcloud.tgz && rm gcloud.tgz && \
  ./google-cloud-sdk/install.sh --quiet --usage-reporting=false --path-update=false && \
  ln -sf ~/.local/google-cloud-sdk/bin/gcloud ~/.local/google-cloud-sdk/bin/gsutil ~/.local/google-cloud-sdk/bin/bq ~/.local/bin/')

No durable gcloud credentials are kept in the sandbox. GCP access is via the short-lived token-as-secret path below, which persists nothing — no refresh token, no ADC file, no key. (You may set CLOUDSDK_CONFIG=/workspace/lha/config/gcloud as a scratch config dir, but there is no login state to persist across upgrades.)

Verify:

bash(command="gcloud --version")

Security: GCP creds is a high-trust combination

Logging in deposits credentials the agent can use, in a sandbox with open outbound internet egress. An injected agent could read the user's GCP data, bq extract / gsutil cp it to a foreign bucket, mint a service-account key, or grant external IAM — all over *.googleapis.com. Layer A (exfil_guard) still gates credential/secret exfil and uploads to non-allowlisted hosts, and still blocks the GCP metadata server; it has no GCP-action awareness (it can't see what a gcloud call does). The real control is credential minimization:

  • Use the short-lived token-as-secret path only (below). We keep no durable credential (refresh token / ADC file / SA key) in the sandbox, so a single injection can't become standing access that outlives the ~1 h token.
  • Mint the token with the narrowest scopes the task needs; cloud-platform (everything the user's IAM allows) is a broad, high-trust default — not a free one.
  • Confirm the user actually wants the agent acting as them on GCP before adding the token.

Authenticate — short-lived access token as a secret (the only GCP path)

The lowest-trust, least-friction path, and the only one we use (works for corp / org-restricted accounts too): the user mints a short-lived access token on their own machine (already gcloud-authed there, so the org's device/CAA policy is satisfied) and hands it to the agent as a secret. Nothing durable lands in the sandbox, and the token self-expires in ~1 hour.

  1. The user runs locally, in their own terminal (authed as the right account):
    gcloud auth print-access-token
  2. The user saves it as a secret named CLOUDSDK_AUTH_ACCESS_TOKEN in the /lha/secrets UI — never pasted into chat (it's a live credential).
  3. Secrets are auto-injected as env vars into every bash command, and gcloud reads CLOUDSDK_AUTH_ACCESS_TOKEN from the environment — so the agent just runs commands, no login / ADC / OAuth client at all:
    bash(command="export CLOUDSDK_CONFIG=/workspace/lha/config/gcloud && gcloud projects list")
    gsutil and bq read the same env token. Don't name the token in a curl/wget (-H "Authorization: Bearer $CLOUDSDK_AUTH_ACCESS_TOKEN"): the exfil guard hard-blocks a network command that references a secret env var (by design — it stops the agent exfiltrating the token). Use the gcloud-family CLIs, which pick it up from the environment without naming it; a raw REST call that must carry the token needs a /grant.

Why this is the default:

  • Short-lived (~1 h): a single injection can't become standing access; on expiry the user re-mints and updates the secret.
  • Nothing durable in the sandbox — no refresh token on /workspace to reuse.
  • Corp-clean: consent already happened through the user's org-approved local gcloud — no Account restricted, no custom OAuth client, no remote-bootstrap.
  • It still acts as the user for that window (short lifetime bounds misuse, doesn't eliminate it) and carries the user's login scopes. For a long unattended job the token expires (~1 h) and must be re-minted and the secret updated — by design we keep no durable credential in the sandbox to fall back on.

agents-cli — call a remote agent (A2A / ADK)

To hand a task to another agent deployed remotely (Cloud Run, Vertex Agent Runtime, or any A2A endpoint), shell out to agents-cli — no in-process wiring needed. This is the outbound counterpart to in-process subagent(): the remote agent is its own service with its own state; you just send a prompt over HTTP.

Install (one-time; uv is already in the sandbox — it installs to ~/.local/bin):

bash(command="command -v agents-cli || uv tool install google-agents-cli")
bash(command="agents-cli --version")

(Install pulls from wherever google-agents-cli is published — if the sandbox can't reach that index, that's the same egress dependency as the Node/gcloud downloads.)

Invoke:

bash(command='agents-cli run "summarize this repo" --url https://my-agent-xxxx.run.app --mode a2a')
  • --mode a2a for the A2A protocol; --mode adk for ADK SSE (/run_sse, or :streamQuery on Agent Runtime). --mode is required with --url.
  • --app-name <name> to target a specific agent at that endpoint.
  • --session-id <id> to continue a conversation; -v for full JSON events.
  • stdout is the remote agent's final response — that is your result (blocking). For a long-running remote task, run it with process(action='spawn', command=...) and poll via the process tool (fire-and-forget).

Auth — usually automatic. agents-cli auto-detects Google credentials from the sandbox identity: an ID token (audience = service URL) for Cloud Run, an access token for Vertex AI / Agent Runtime. For this to yield a usable token, the sandbox/Cloud Run service account needs the right IAM on the target (roles/run.invoker for Cloud Run; Vertex perms for Agent Runtime) — a 401/403 is almost always missing IAM, not a CLI problem.

User-delegated auth (call as the user): pass the token explicitly, which overrides auto-detect:

bash(command='agents-cli run "..." --url https://... --mode a2a -H "Authorization: Bearer $USER_TOKEN"')

Source the token from the secrets / headless-auth subsystem (never inline a raw secret into chat).

--url is a thin client — it loads no local skills (the remote agent's skills are its own concern). If you need agents-cli's broader toolchain (scaffold, deploy, eval, observability, publish, workflow), install those skills on demand via the find-skills skill.

mcp-cli — use tools exposed by an MCP server

To call tools served by an MCP server (GitHub, filesystem, databases, third-party APIs) from the sandbox. This is the client side — using external MCP servers via bash, not running one. (Auth is static token only — inject the server's bearer via ${VAR} headers, below; there is no OAuth/consent flow. For GCP, use the token-as-secret path in the gcloud section, not MCP.)

Install — install.sh downloads a checksum-verified, self-contained prebuilt binary (mcp-cli-linux-x64, ~100 MB) to ~/.local/bin/mcp-cli. It's compiled with Bun but needs no Bun/Node at install or runtime — it's standalone.

Don't pipe-to-bash. curl … | bash is blocked by the tool policy (piping remote content to a shell). Download the script, then run it from a file:

bash(command="command -v mcp-cli || (curl -fsSLo /tmp/mcp_install.sh https://raw.githubusercontent.com/philschmid/mcp-cli/main/install.sh && bash /tmp/mcp_install.sh)")
bash(command="mcp-cli --version")

(Optionally read('/tmp/mcp_install.sh') first — it just fetches the latest release binary and verifies its SHA256.) It installs to ~/.local/bin.

Configure servers — this is the real onboarding work. mcp-cli is config-driven: it reads mcp_servers.json. Keep it on /workspace (config is a data file — it migrates) and point mcp-cli at it with MCP_CONFIG_PATH (its highest-priority resolver); the default ~/.config/mcp/… is not migrated:

export MCP_CONFIG_PATH=/workspace/lha/config/mcp_servers.json

Write that file (Claude-Desktop / Gemini / VS-Code compatible):

json
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/workspace"]
    },
    "remote-api": {
      "url": "https://mcp.example.com",
      "headers": { "Authorization": "Bearer ${MCP_TOKEN}" }
    }
  }
}
  • stdio server → command + args the sandbox can spawn (install the server too, e.g. via npx/uvx).
  • HTTP server → url (+ headers).
  • Auth: ${VAR} in headers is substituted from the environment at config load (missing var errors unless MCP_STRICT_ENV=false). Source that token from the secrets subsystem (env-injection) — never inline a raw secret.

Use (or install mcp-cli's own usage skill via find-skills for the full reference):

bash(command="mcp-cli")                                              # list servers + tools
bash(command="mcp-cli info filesystem read_file")                    # tool schema
bash(command="mcp-cli call filesystem read_file '{\"path\": \"./README.md\"}'")

Use call to invoke and info to inspect — mcp-cli <server> <tool> directly is ambiguous and errors.

Failure cheat-sheet

SymptomCause / fix
any tool "command not found" after a runtime upgradebinaries live in $HOME and aren't migrated — reinstall per this skill (the command -v check does this)
node/gcloud: command not found after installthe ln -sf … ~/.local/bin/ symlink step was skipped; re-run it (~/.local/bin is on PATH, the versioned/SDK bin dir isn't)
tar: ... cannot exec xzdownloaded .tar.xz; use the .tar.gz build instead
gws asks to log in again after an upgradeits credentials were written under $HOME (not migrated); set GOOGLE_WORKSPACE_CLI_CONFIG_DIR to the /workspace/lha/config/* path on every call (gcloud keeps no persisted login — re-add the token secret)
gws login token not saved / no keyringset GOOGLE_WORKSPACE_CLI_KEYRING_BACKEND=file (alongside the config-dir export)
gws auth status says auth_method: none but reads workexpected when GOOGLE_WORKSPACE_CLI_TOKEN is the source — auth status doesn't reflect the env token. Confirm with a real read, not auth status; don't start a login dance
gws auth login hangs on the listenerexpected headless — bridge the redirect (see google-workspace skill) or use a service account if no user is present
403 access_denied "Account restricted"Context-Aware Access on the OAuth client — don't fight it. Use the token-as-secret path: user runs gcloud auth print-access-token locally and stores it as the secret CLOUDSDK_AUTH_ACCESS_TOKEN
network command blocked: "reads a credential path or secret env var"Don't name $CLOUDSDK_AUTH_ACCESS_TOKEN (or any *_TOKEN/*_KEY) in a curl/wget — the exfil guard hard-blocks it. Let gcloud/gsutil/bq read the token from the env instead; a raw REST call needs a /grant
Unattended job has no GCP tokenthe CLOUDSDK_AUTH_ACCESS_TOKEN secret is missing or expired; surface "needs a fresh token" and stop — don't loop
agents-cli: command not founduv tool install google-agents-cli (uv is already in the sandbox)
remote agents-cli run --url 401/403missing IAM on the target (roles/run.invoker / Vertex perms), not a CLI bug
--mode is required when using --urladd --mode a2a (or --mode adk) to the remote call
mcp-cli: command not founddownload install.sh then bash the file (don't | bash — policy blocks it); installs to ~/.local/bin
mcp-cli AMBIGUOUS_COMMANDuse mcp-cli call/info <server> <tool>, not mcp-cli <server> <tool>
mcp-cli ${VAR} missing at config loadexport the token (from the secrets subsystem) or set MCP_STRICT_ENV=false

常见问题

Bootstrap Google Tools AI 技能有什么作用?

Install/auth CLIs the sandbox lacks - `gws` (Drive, Gmail, Sheets, Calendar), `gcloud`, `agents-cli`, `mcp-cli` (MCP servers). Use on "command not found" or before GCP/Workspace/MCP work.

为什么在 TypingMind 中使用 Bootstrap Google Tools?

因为您只需安装一次,就能搭配任何模型使用。Bootstrap Google Tools 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Bootstrap Google Tools?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/google/adk-recipes/tree/main/core/python/long-horizon-harness/horizon/builtin_skills/bootstrap-google-tools。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Bootstrap Google Tools?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Bootstrap Google Tools 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Bootstrap Google Tools 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Bootstrap Google Tools AI 技能免费吗?

是的。google 已在 GitHub 上根据 Apache-2.0 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇