
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@optima-chat/google-ads-cli
Advanced tools
为客户创建和管理 Google Ads 广告的专业工具 - 专为服务提供商和 Claude Code 设计
本工具专为 Google Ads 广告主设计,让您轻松管理自己的广告投放。
# 安装
npm install -g @optima-chat/google-ads-cli@latest
# 复制环境变量模板
cp .env.example .env
# 编辑 .env 文件,填入 Agency 提供的凭据:
# - GOOGLE_ADS_DEVELOPER_TOKEN
# - GOOGLE_ADS_CLIENT_ID
# - GOOGLE_ADS_CLIENT_SECRET
# - GOOGLE_ADS_MANAGER_ACCOUNT_ID (MCC 账号 ID)
# OAuth2 登录授权
google-ads auth login
# 一次性提供所有参数(无需交互)
google-ads account create \
--email your@gmail.com \
--name "Your Company Name" \
--customer-id 1234567890 \
--json
# Customer ID 从哪里来?
# 1. 访问 https://ads.google.com/
# 2. 用 Gmail 登录,切换到"专家模式"
# 3. 创建账号(不创建广告系列)
# 4. 记录 Customer ID(10位数字)
# 运行命令,CLI 会引导你创建账号
google-ads account create --email your@gmail.com --name "Your Company Name"
# CLI 会:
# 1. 显示手动创建步骤(引导在 Google Ads UI 中操作)
# 2. 交互式提示输入 Customer ID
# 3. 自动保存配置到 CLI config
# 验证账号配置
google-ads account check
下一步:
详细教程:
docs/客户创建账号指南.mddocs/AI-使用指南.md# 查看广告系列
google-ads campaign list
# 创建广告系列
google-ads campaign create -n "我的广告系列" -b 50
# 查看关键词
google-ads keyword list
# 执行 GAQL 查询分析广告表现
google-ads query -q "SELECT campaign.id, campaign.name, metrics.impressions FROM campaign" --pretty
# 查看当前配置
google-ads config show
# 重置配置(重新创建账号)
google-ads config reset
# 查看配置文件路径
google-ads config path
# 1. 创建广告系列
google-ads campaign create -n "春季促销活动" -b 100
# 2. 创建广告组
google-ads ad-group create --campaign-id 12345678 -n "iPhone 15" -b 2.5
# 3. 添加关键词
google-ads keyword add 98765432 --keywords "iPhone 15,iPhone 15 Pro,苹果手机"
# 4. 查看广告系列表现
google-ads query -q "SELECT campaign.name, metrics.impressions, metrics.clicks, metrics.cost_micros FROM campaign WHERE segments.date DURING LAST_7_DAYS" --pretty
# 5. 暂停表现不佳的广告系列
google-ads campaign delete 12345678
Claude Code 可以直接调用这些命令:
你:帮我创建一个预算 50 美元的春季促销广告系列
Claude:google-ads campaign create -n "春季促销" -b 50
你:查看最近 7 天表现最好的 5 个广告系列
Claude:google-ads query -q "SELECT campaign.name, metrics.clicks FROM campaign WHERE segments.date DURING LAST_7_DAYS ORDER BY metrics.clicks DESC LIMIT 5" --pretty
Agency (提供 MCC 凭据)
↓
客户安装 google-ads-cli
↓
运行 account create → 创建子账号 + 发送邀请
↓
客户接受邀请 + 设置账单
↓
Claude Code / AI 调用 CLI
↓
google-ads-cli (TypeScript)
↓ (Google Ads API SDK)
Google Ads API
↓
客户的 Google Ads 账号
设计理念:
由 Agency 提供,客户只需复制粘贴到 .env 文件:
# Developer Token(Agency 提供)
GOOGLE_ADS_DEVELOPER_TOKEN=your-developer-token
# OAuth2 客户端凭据(Agency 提供)
GOOGLE_ADS_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_ADS_CLIENT_SECRET=your-client-secret
# MCC 管理账号 ID(Agency 提供)
GOOGLE_ADS_MANAGER_ACCOUNT_ID=123-456-7890
# OAuth2 Refresh Token(运行 google-ads auth login 后自动生成)
GOOGLE_ADS_REFRESH_TOKEN=your-refresh-token
运行 google-ads account create 后,以下信息会自动保存:
配置文件位置:~/.config/google-ads-cli/config.json
查看配置:google-ads config show
google-ads --version - 查看版本google-ads --help - 查看帮助google-ads auth)login - OAuth2 登录logout - 退出登录status - 查看认证状态google-ads account)create --email <email> --name <name> [--currency <code>] [--timezone <tz>] - 创建您的 Google Ads 账号check [--json] - 检查账号配置状态(账单、权限等)google-ads campaign)list [--status <status>] [--limit <n>] [--json] - 列出广告系列info <campaign-id> [--json] - 查看广告系列详情create -n <name> -b <budget> [--status <status>] - 创建广告系列delete <campaign-id> - 删除广告系列google-ads ad-group)list --campaign-id <id> [--json] - 列出广告组create --campaign-id <id> -n <name> -b <bid> - 创建广告组delete <ad-group-id> - 删除广告组google-ads keyword)list [--campaign-id <id>] [--status <status>] [--limit <n>] [--json] - 列出关键词add <ad-group-id> --keywords <words> [--match-type <type>] - 添加关键词delete <keyword-id> - 删除关键词google-ads config)show [--json] - 显示当前配置reset [--force] - 重置配置path - 显示配置文件路径google-ads query)query -q "<gaql>" [--json] [--pretty] - 执行 GAQL 查询query -f <file> [--json] [--pretty] - 从文件执行查询查看 完整命令文档 了解更多。
简单、明确、LLM 易理解
# 管理您的广告
google-ads campaign list
google-ads campaign create -n "广告系列名称" -b 100
google-ads keyword add <ad-group-id> --keywords "产品关键词1,产品关键词2"
灵活、强大、适合复杂分析
google-ads query "
SELECT
campaign.name,
metrics.impressions,
metrics.clicks,
metrics.cost_micros
FROM campaign
WHERE segments.date DURING LAST_7_DAYS
ORDER BY metrics.clicks DESC
"
当前版本:v0.4.0
google-ads config reset 切换本项目使用 GitHub Actions 自动发布到 NPM:
# 更新版本号(patch/minor/major)
npm version patch
# 推送 tag 触发自动发布
git push --follow-tags
GitHub Actions 会自动:
查看最新发布:https://github.com/Optima-Chat/google-ads-cli/releases
欢迎提交 Issue 和 Pull Request!
MIT License - 详见 LICENSE
FAQs
用自然语言管理 Google Ads 广告投放 - 专为 Claude Code 设计的对话式 CLI 工具
The npm package @optima-chat/google-ads-cli receives a total of 28 weekly downloads. As such, @optima-chat/google-ads-cli popularity was classified as not popular.
We found that @optima-chat/google-ads-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.