openboost-cli 2.0.2__tar.gz → 3.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {openboost_cli-2.0.2/src/openboost_cli.egg-info → openboost_cli-3.0.0}/PKG-INFO +25 -5
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/README.md +22 -2
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/pyproject.toml +3 -3
- openboost_cli-3.0.0/src/openboost_cli/__init__.py +25 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/cli/main.py +192 -33
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/client.py +19 -1
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/parse_result.py +27 -27
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/registry.py +30 -1
- openboost_cli-3.0.0/src/openboost_cli/schemas/account/__init__.py +1 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/account/account_catalog.json +17 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/account/account_info.json +8 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/account/account_links.json +8 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/account/account_order_create.json +20 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/account/account_order_status.json +16 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/account/account_orders.json +17 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_aba_research_trends.json +26 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_aba_research_weekly.json +132 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/amazon/amz_category_query.json +4 -4
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_category_query_v2.json +28 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_google_trends.json +26 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_hot_amz_hot_cat_tree.json +25 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_hot_amz_hot_list_v2.json +33 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_keyword_miner.json +152 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_keyword_order.json +46 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_keyword_research.json +148 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_keyword_research_trends.json +21 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_market_brand.json +33 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_market_goods.json +37 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_market_price.json +33 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_market_rating.json +33 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_market_ratings.json +33 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_market_research.json +260 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_market_seller.json +33 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_market_seller_location.json +29 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_market_seller_type.json +29 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_market_shelf_time.json +33 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_market_shelf_trend.json +33 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_market_statistics.json +36 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_product_competitor.json +68 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_product_selection.json +228 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_research_monthly.json +132 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/amazon/amz_review_query.json +4 -4
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_sales_prediction_bsr.json +26 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/amazon/amz_sales_query.json +4 -4
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_sku_query.json +20 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_traffic_extend.json +153 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_traffic_keyword.json +157 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_traffic_keyword_stat.json +25 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_traffic_listing_page.json +46 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_traffic_listing_stat.json +21 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/amazon/amz_traffic_source.json +41 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/patent/patent_abstract_image.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/patent/patent_abstract_translated.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/patent/patent_bibliography.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/patent/patent_claim_data.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/patent/patent_claim_translated.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/patent/patent_description.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/patent/patent_description_translated.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/patent/patent_family.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/patent/patent_fulltext_image.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/patent/patent_image_search_multiple.json +9 -6
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/patent/patent_image_search_single.json +9 -6
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/patent/patent_legal_status.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/patent/patent_pdf.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/patent/patent_query_count.json +8 -5
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/patent/patent_query_search.json +8 -5
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/patent/patent_query_search_with_agg.json +8 -5
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/patent/patent_semantic_search.json +8 -5
- openboost_cli-3.0.0/src/openboost_cli/schemas/social/__init__.py +1 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/social/instagram_fetch_hashtag_posts.json +21 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/social/instagram_fetch_post_comments.json +20 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/social/instagram_fetch_post_info.json +20 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/social/instagram_fetch_reel_info.json +16 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/social/instagram_fetch_user_info.json +20 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/social/instagram_fetch_user_reels.json +21 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/social/reddit_fetch_post_comments.json +24 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/social/reddit_fetch_post_details.json +20 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/social/youtube_fetch_post_comments.json +25 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/social/youtube_fetch_post_info.json +20 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/social/youtube_fetch_user_info.json +20 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tk_expert_sale_show.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_commodity_detail.json +4 -4
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_commodity_expert_draw_expert_trend.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_commodity_get_commodity_cat_tree.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_commodity_info_list.json +10 -10
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_commodity_sales_trend.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_commodity_statistics_get_category_statistics.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_commodity_statistics_get_expert_statistics.json +3 -3
- openboost_cli-3.0.0/src/openboost_cli/schemas/tiktok/tt_commodity_statistics_get_price_statistics.json +28 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_commodity_statistics_get_total_statistics.json +9 -5
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_commodity_voice_analyze.json +3 -3
- openboost_cli-3.0.0/src/openboost_cli/schemas/tiktok/tt_commodity_voice_read.json +41 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/tiktok/tt_dashboard_overview.json +28 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_expert_basic_analyze.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_expert_category_analyze.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_expert_detail.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_expert_fans_analyze.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_expert_fans_portrait.json +3 -3
- openboost_cli-3.0.0/src/openboost_cli/schemas/tiktok/tt_expert_info_list.json +176 -0
- openboost_cli-3.0.0/src/openboost_cli/schemas/tiktok/tt_hashtag_list.json +48 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_shop_commodity_account_list.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_shop_detail.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_shop_info_list.json +3 -3
- openboost_cli-3.0.0/src/openboost_cli/schemas/tiktok/tt_shop_market_info.json +28 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_shop_sales_trend.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_video_content.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_video_detail.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_video_info_list.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_video_new_video_summary.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_video_script_diy_query.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_video_voice_read.json +4 -4
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/tt_video_voice_summary.json +3 -3
- {openboost_cli-2.0.2 → openboost_cli-3.0.0/src/openboost_cli.egg-info}/PKG-INFO +25 -5
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli.egg-info/SOURCES.txt +51 -2
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/tests/test_cli.py +59 -20
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/tests/test_config.py +3 -2
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/tests/test_mcp_client.py +18 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/tests/test_schemas_and_parsing.py +25 -17
- openboost_cli-2.0.2/src/openboost_cli/__init__.py +0 -21
- openboost_cli-2.0.2/src/openboost_cli/schemas/amazon/amz_hot_amz_hot_cat_tree.json +0 -25
- openboost_cli-2.0.2/src/openboost_cli/schemas/amazon/amz_hot_amz_hot_list.json +0 -33
- openboost_cli-2.0.2/src/openboost_cli/schemas/amazon/amz_market_price.json +0 -28
- openboost_cli-2.0.2/src/openboost_cli/schemas/amazon/amz_product_selection.json +0 -140
- openboost_cli-2.0.2/src/openboost_cli/schemas/amazon/amz_sku_query.json +0 -20
- openboost_cli-2.0.2/src/openboost_cli/schemas/tiktok/tt_commodity_statistics_get_price_statistics.json +0 -28
- openboost_cli-2.0.2/src/openboost_cli/schemas/tiktok/tt_expert_info_list.json +0 -180
- openboost_cli-2.0.2/src/openboost_cli/schemas/tiktok/tt_sale_channel_sale_channel.json +0 -26
- openboost_cli-2.0.2/src/openboost_cli/schemas/tiktok/tt_shop_market_info.json +0 -28
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/LICENSE +0 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/setup.cfg +0 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/cli/__init__.py +0 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/cli/interactive.py +0 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/coerce_args.py +0 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/config.py +0 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/mcp_client.py +0 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/__init__.py +0 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/amazon/__init__.py +0 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/patent/__init__.py +0 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas/tiktok/__init__.py +0 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli/schemas_loader.py +0 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli.egg-info/dependency_links.txt +0 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli.egg-info/entry_points.txt +0 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli.egg-info/requires.txt +0 -0
- {openboost_cli-2.0.2 → openboost_cli-3.0.0}/src/openboost_cli.egg-info/top_level.txt +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: openboost-cli
|
|
3
|
-
Version:
|
|
4
|
-
Summary: Unified CLI and Python client for OpenBoost TikTok, Patent, and
|
|
3
|
+
Version: 3.0.0
|
|
4
|
+
Summary: Unified CLI and Python client for OpenBoost TikTok, Patent, Amazon, Social, and Account MCP tools.
|
|
5
5
|
Author: OpenBoost CLI
|
|
6
6
|
License-Expression: MIT
|
|
7
|
-
Keywords: mcp,cli,openboost,tiktok,patent,amazon
|
|
7
|
+
Keywords: mcp,cli,openboost,tiktok,patent,amazon,social
|
|
8
8
|
Classifier: Environment :: Console
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -22,7 +22,11 @@ Dynamic: license-file
|
|
|
22
22
|
|
|
23
23
|
# openboost-cli
|
|
24
24
|
|
|
25
|
-
OpenBoost MCP 的统一命令行工具和 Python 客户端,支持 TikTok、Patent
|
|
25
|
+
OpenBoost MCP 的统一命令行工具和 Python 客户端,支持 TikTok、Patent、Amazon、Social 四类业务工具,以及账号、套餐和订单工具。
|
|
26
|
+
|
|
27
|
+
- 业务工具:TikTok 32、Patent 17、Amazon 36、Social 11,共 96 个
|
|
28
|
+
- 账号工具:6 个
|
|
29
|
+
- 合计:102 个工具
|
|
26
30
|
|
|
27
31
|
- PyPI 包名:`openboost-cli`
|
|
28
32
|
- 命令行入口:`openboost`
|
|
@@ -56,7 +60,7 @@ openboost config set --secret-key "your-secret-key"
|
|
|
56
60
|
|
|
57
61
|
```bash
|
|
58
62
|
openboost config set --mcp amazon --secret-key "your-secret-key"
|
|
59
|
-
openboost config set --mcp amazon --base-url "
|
|
63
|
+
openboost config set --mcp amazon --base-url "https://mcp.openboostai.com/mcp-servers/openboost-all-mcp/sse"
|
|
60
64
|
```
|
|
61
65
|
|
|
62
66
|
默认配置文件位于:
|
|
@@ -73,9 +77,13 @@ OPENBOOST_SECRET_KEY
|
|
|
73
77
|
OPENBOOST_TIKTOK_SECRET_KEY
|
|
74
78
|
OPENBOOST_PATENT_SECRET_KEY
|
|
75
79
|
OPENBOOST_AMAZON_SECRET_KEY
|
|
80
|
+
OPENBOOST_SOCIAL_SECRET_KEY
|
|
81
|
+
OPENBOOST_ACCOUNT_SECRET_KEY
|
|
76
82
|
OPENBOOST_TIKTOK_BASE_URL
|
|
77
83
|
OPENBOOST_PATENT_BASE_URL
|
|
78
84
|
OPENBOOST_AMAZON_BASE_URL
|
|
85
|
+
OPENBOOST_SOCIAL_BASE_URL
|
|
86
|
+
OPENBOOST_ACCOUNT_BASE_URL
|
|
79
87
|
```
|
|
80
88
|
|
|
81
89
|
密钥也可仅对一次调用通过顶层 `--key` 参数提供。不要将密钥提交到代码仓库。
|
|
@@ -101,6 +109,8 @@ openboost docs tiktok tt_commodity_info_list
|
|
|
101
109
|
openboost tiktok commodity category-tree
|
|
102
110
|
openboost patent search count "TACD: virtual reality"
|
|
103
111
|
openboost amazon hot cat-tree --site 1 --rank-type "Best Seller"
|
|
112
|
+
openboost social youtube post-info "video-id"
|
|
113
|
+
openboost account info
|
|
104
114
|
```
|
|
105
115
|
|
|
106
116
|
使用通用调用命令:
|
|
@@ -143,6 +153,9 @@ patents = client.patent.patent_query_search(
|
|
|
143
153
|
query_text="TACD: virtual reality",
|
|
144
154
|
limit=10,
|
|
145
155
|
)
|
|
156
|
+
|
|
157
|
+
video = client.social.youtube_fetch_post_info(media_id="video-id")
|
|
158
|
+
account = client.account.account_info()
|
|
146
159
|
```
|
|
147
160
|
|
|
148
161
|
也可以按名称取得某个 MCP 客户端:
|
|
@@ -163,6 +176,13 @@ uv run pytest
|
|
|
163
176
|
uv build
|
|
164
177
|
```
|
|
165
178
|
|
|
179
|
+
维护者可使用具有完整权限的密钥从统一 MCP 同步公开工具元数据和参数 Schema。脚本不会保存或输出密钥:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
OPENBOOST_SECRET_KEY="your-secret-key" \
|
|
183
|
+
uv run python scripts/sync_mcp_schemas.py --apply
|
|
184
|
+
```
|
|
185
|
+
|
|
166
186
|
单元测试不会访问真实接口。真实接口 smoke test 必须同时显式设置开关和密钥:
|
|
167
187
|
|
|
168
188
|
```bash
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# openboost-cli
|
|
2
2
|
|
|
3
|
-
OpenBoost MCP 的统一命令行工具和 Python 客户端,支持 TikTok、Patent
|
|
3
|
+
OpenBoost MCP 的统一命令行工具和 Python 客户端,支持 TikTok、Patent、Amazon、Social 四类业务工具,以及账号、套餐和订单工具。
|
|
4
|
+
|
|
5
|
+
- 业务工具:TikTok 32、Patent 17、Amazon 36、Social 11,共 96 个
|
|
6
|
+
- 账号工具:6 个
|
|
7
|
+
- 合计:102 个工具
|
|
4
8
|
|
|
5
9
|
- PyPI 包名:`openboost-cli`
|
|
6
10
|
- 命令行入口:`openboost`
|
|
@@ -34,7 +38,7 @@ openboost config set --secret-key "your-secret-key"
|
|
|
34
38
|
|
|
35
39
|
```bash
|
|
36
40
|
openboost config set --mcp amazon --secret-key "your-secret-key"
|
|
37
|
-
openboost config set --mcp amazon --base-url "
|
|
41
|
+
openboost config set --mcp amazon --base-url "https://mcp.openboostai.com/mcp-servers/openboost-all-mcp/sse"
|
|
38
42
|
```
|
|
39
43
|
|
|
40
44
|
默认配置文件位于:
|
|
@@ -51,9 +55,13 @@ OPENBOOST_SECRET_KEY
|
|
|
51
55
|
OPENBOOST_TIKTOK_SECRET_KEY
|
|
52
56
|
OPENBOOST_PATENT_SECRET_KEY
|
|
53
57
|
OPENBOOST_AMAZON_SECRET_KEY
|
|
58
|
+
OPENBOOST_SOCIAL_SECRET_KEY
|
|
59
|
+
OPENBOOST_ACCOUNT_SECRET_KEY
|
|
54
60
|
OPENBOOST_TIKTOK_BASE_URL
|
|
55
61
|
OPENBOOST_PATENT_BASE_URL
|
|
56
62
|
OPENBOOST_AMAZON_BASE_URL
|
|
63
|
+
OPENBOOST_SOCIAL_BASE_URL
|
|
64
|
+
OPENBOOST_ACCOUNT_BASE_URL
|
|
57
65
|
```
|
|
58
66
|
|
|
59
67
|
密钥也可仅对一次调用通过顶层 `--key` 参数提供。不要将密钥提交到代码仓库。
|
|
@@ -79,6 +87,8 @@ openboost docs tiktok tt_commodity_info_list
|
|
|
79
87
|
openboost tiktok commodity category-tree
|
|
80
88
|
openboost patent search count "TACD: virtual reality"
|
|
81
89
|
openboost amazon hot cat-tree --site 1 --rank-type "Best Seller"
|
|
90
|
+
openboost social youtube post-info "video-id"
|
|
91
|
+
openboost account info
|
|
82
92
|
```
|
|
83
93
|
|
|
84
94
|
使用通用调用命令:
|
|
@@ -121,6 +131,9 @@ patents = client.patent.patent_query_search(
|
|
|
121
131
|
query_text="TACD: virtual reality",
|
|
122
132
|
limit=10,
|
|
123
133
|
)
|
|
134
|
+
|
|
135
|
+
video = client.social.youtube_fetch_post_info(media_id="video-id")
|
|
136
|
+
account = client.account.account_info()
|
|
124
137
|
```
|
|
125
138
|
|
|
126
139
|
也可以按名称取得某个 MCP 客户端:
|
|
@@ -141,6 +154,13 @@ uv run pytest
|
|
|
141
154
|
uv build
|
|
142
155
|
```
|
|
143
156
|
|
|
157
|
+
维护者可使用具有完整权限的密钥从统一 MCP 同步公开工具元数据和参数 Schema。脚本不会保存或输出密钥:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
OPENBOOST_SECRET_KEY="your-secret-key" \
|
|
161
|
+
uv run python scripts/sync_mcp_schemas.py --apply
|
|
162
|
+
```
|
|
163
|
+
|
|
144
164
|
单元测试不会访问真实接口。真实接口 smoke test 必须同时显式设置开关和密钥:
|
|
145
165
|
|
|
146
166
|
```bash
|
|
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "openboost-cli"
|
|
7
|
-
version = "
|
|
8
|
-
description = "Unified CLI and Python client for OpenBoost TikTok, Patent, and
|
|
7
|
+
version = "3.0.0"
|
|
8
|
+
description = "Unified CLI and Python client for OpenBoost TikTok, Patent, Amazon, Social, and Account MCP tools."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
11
11
|
license = "MIT"
|
|
@@ -13,7 +13,7 @@ license-files = ["LICENSE"]
|
|
|
13
13
|
authors = [
|
|
14
14
|
{ name = "OpenBoost CLI" },
|
|
15
15
|
]
|
|
16
|
-
keywords = ["mcp", "cli", "openboost", "tiktok", "patent", "amazon"]
|
|
16
|
+
keywords = ["mcp", "cli", "openboost", "tiktok", "patent", "amazon", "social"]
|
|
17
17
|
classifiers = [
|
|
18
18
|
"Environment :: Console",
|
|
19
19
|
"Programming Language :: Python :: 3",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""Unified OpenBoost MCP CLI and Python client."""
|
|
2
|
+
|
|
3
|
+
__version__ = "3.0.0"
|
|
4
|
+
|
|
5
|
+
DEFAULT_BASE_URLS = {
|
|
6
|
+
"tiktok": "https://mcp.openboostai.com/mcp-servers/openboost-all-mcp/sse",
|
|
7
|
+
"patent": "https://mcp.openboostai.com/mcp-servers/openboost-all-mcp/sse",
|
|
8
|
+
"amazon": "https://mcp.openboostai.com/mcp-servers/openboost-all-mcp/sse",
|
|
9
|
+
"social": "https://mcp.openboostai.com/mcp-servers/openboost-all-mcp/sse",
|
|
10
|
+
"account": "https://mcp.openboostai.com/mcp-servers/openboost-all-mcp/sse",
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
MCP_LABELS = {
|
|
14
|
+
"tiktok": "TikTok",
|
|
15
|
+
"patent": "Patent",
|
|
16
|
+
"amazon": "Amazon",
|
|
17
|
+
"social": "Social",
|
|
18
|
+
"account": "Account",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
MCP_NAMES = tuple(DEFAULT_BASE_URLS.keys())
|
|
22
|
+
|
|
23
|
+
from .client import OpenBoost
|
|
24
|
+
|
|
25
|
+
__all__ = ["DEFAULT_BASE_URLS", "MCP_LABELS", "MCP_NAMES", "OpenBoost", "__version__"]
|
|
@@ -34,7 +34,7 @@ console = Console()
|
|
|
34
34
|
|
|
35
35
|
app = typer.Typer(
|
|
36
36
|
name="openboost",
|
|
37
|
-
help="OpenBoost CLI — 统一调用 TikTok / Patent / Amazon MCP",
|
|
37
|
+
help="OpenBoost CLI — 统一调用 TikTok / Patent / Amazon / Social MCP 与账号工具",
|
|
38
38
|
no_args_is_help=False,
|
|
39
39
|
add_completion=False,
|
|
40
40
|
)
|
|
@@ -52,11 +52,18 @@ patent_image_app = typer.Typer(help="专利图像检索")
|
|
|
52
52
|
amazon_app = typer.Typer(help="Amazon MCP")
|
|
53
53
|
amazon_product_app = typer.Typer(help="Amazon 商品与市场")
|
|
54
54
|
amazon_hot_app = typer.Typer(help="Amazon 榜单")
|
|
55
|
+
social_app = typer.Typer(help="Social MCP")
|
|
56
|
+
instagram_app = typer.Typer(help="Instagram 实时采集")
|
|
57
|
+
reddit_app = typer.Typer(help="Reddit 实时采集")
|
|
58
|
+
youtube_app = typer.Typer(help="YouTube 实时采集")
|
|
59
|
+
account_app = typer.Typer(help="账号、套餐与订单工具")
|
|
55
60
|
|
|
56
61
|
app.add_typer(config_app, name="config")
|
|
57
62
|
app.add_typer(tiktok_app, name="tiktok")
|
|
58
63
|
app.add_typer(patent_app, name="patent")
|
|
59
64
|
app.add_typer(amazon_app, name="amazon")
|
|
65
|
+
app.add_typer(social_app, name="social")
|
|
66
|
+
app.add_typer(account_app, name="account")
|
|
60
67
|
tiktok_app.add_typer(tiktok_statistics_app, name="statistics")
|
|
61
68
|
tiktok_app.add_typer(tiktok_commodity_app, name="commodity")
|
|
62
69
|
tiktok_app.add_typer(tiktok_expert_app, name="expert")
|
|
@@ -67,12 +74,15 @@ patent_app.add_typer(patent_detail_app, name="detail")
|
|
|
67
74
|
patent_app.add_typer(patent_image_app, name="image-search")
|
|
68
75
|
amazon_app.add_typer(amazon_product_app, name="product")
|
|
69
76
|
amazon_app.add_typer(amazon_hot_app, name="hot")
|
|
77
|
+
social_app.add_typer(instagram_app, name="instagram")
|
|
78
|
+
social_app.add_typer(reddit_app, name="reddit")
|
|
79
|
+
social_app.add_typer(youtube_app, name="youtube")
|
|
70
80
|
|
|
71
81
|
_state: dict[str, str | None] = {"secret_key": None, "base_url": None}
|
|
72
82
|
|
|
73
83
|
KeyOpt = Annotated[Optional[str], typer.Option("--key", "-k", help="secret-key")]
|
|
74
84
|
BaseUrlOpt = Annotated[Optional[str], typer.Option("--base-url", "-u", help="MCP SSE URL")]
|
|
75
|
-
McpArg = Annotated[str, typer.Argument(help="
|
|
85
|
+
McpArg = Annotated[str, typer.Argument(help="工具分组: tiktok / patent / amazon / social / account")]
|
|
76
86
|
CountryOpt = Annotated[str, typer.Option("--country-region", "--country", help="国家/地区,如 美国")]
|
|
77
87
|
CurrentOpt = Annotated[Optional[int], typer.Option("--current", help="当前页码")]
|
|
78
88
|
SizeOpt = Annotated[Optional[int], typer.Option("--size", help="每页条数")]
|
|
@@ -80,6 +90,7 @@ DataPeriodOpt = Annotated[Optional[str], typer.Option("--data-period", help="数
|
|
|
80
90
|
DateOpt = Annotated[Optional[str], typer.Option("--date", help="数据日期")]
|
|
81
91
|
OrderTypeOpt = Annotated[Optional[str], typer.Option("--order-type", help="排序类型")]
|
|
82
92
|
ExtraArg = Annotated[Optional[list[str]], typer.Argument(help="额外参数 key=value ...")]
|
|
93
|
+
PriorityOpt = Annotated[Optional[int], typer.Option("--priority", help="采集优先级")]
|
|
83
94
|
|
|
84
95
|
|
|
85
96
|
@app.callback(invoke_without_command=True)
|
|
@@ -90,23 +101,23 @@ def main_callback(ctx: typer.Context, key: KeyOpt = None, base_url: BaseUrlOpt =
|
|
|
90
101
|
interactive.run_interactive(secret_key=key, base_url=base_url)
|
|
91
102
|
|
|
92
103
|
|
|
93
|
-
def _print_json(data: Any) -> None:
|
|
94
|
-
if isinstance(data, (dict, list)):
|
|
95
|
-
if sys.stdout.isatty():
|
|
96
|
-
console.print_json(json.dumps(data, ensure_ascii=False))
|
|
97
|
-
else:
|
|
98
|
-
sys.stdout.write(json.dumps(data, ensure_ascii=True, separators=(",", ":")) + "\n")
|
|
99
|
-
else:
|
|
100
|
-
_print_text(str(data))
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
def _print_text(text: str) -> None:
|
|
104
|
-
if sys.stdout.isatty():
|
|
105
|
-
console.print(text)
|
|
106
|
-
else:
|
|
107
|
-
sys.stdout.write(text)
|
|
108
|
-
if not text.endswith("\n"):
|
|
109
|
-
sys.stdout.write("\n")
|
|
104
|
+
def _print_json(data: Any) -> None:
|
|
105
|
+
if isinstance(data, (dict, list)):
|
|
106
|
+
if sys.stdout.isatty():
|
|
107
|
+
console.print_json(json.dumps(data, ensure_ascii=False))
|
|
108
|
+
else:
|
|
109
|
+
sys.stdout.write(json.dumps(data, ensure_ascii=True, separators=(",", ":")) + "\n")
|
|
110
|
+
else:
|
|
111
|
+
_print_text(str(data))
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def _print_text(text: str) -> None:
|
|
115
|
+
if sys.stdout.isatty():
|
|
116
|
+
console.print(text)
|
|
117
|
+
else:
|
|
118
|
+
sys.stdout.write(text)
|
|
119
|
+
if not text.endswith("\n"):
|
|
120
|
+
sys.stdout.write("\n")
|
|
110
121
|
|
|
111
122
|
|
|
112
123
|
def _props(mcp: str, tool_name: str) -> dict[str, Any]:
|
|
@@ -149,9 +160,9 @@ def _run_tool(mcp: str, tool_name: str, arguments: dict[str, Any], *, verbatim:
|
|
|
149
160
|
console.print(str(exc), style="red")
|
|
150
161
|
raise typer.Exit(2) from exc
|
|
151
162
|
|
|
152
|
-
text = extract_result_text(result)
|
|
153
|
-
if verbatim:
|
|
154
|
-
_print_text(text)
|
|
163
|
+
text = extract_result_text(result)
|
|
164
|
+
if verbatim:
|
|
165
|
+
_print_text(text)
|
|
155
166
|
raise typer.Exit(3 if result.isError else 0)
|
|
156
167
|
if result.isError:
|
|
157
168
|
console.print(text or "(tool error)", style="red")
|
|
@@ -160,10 +171,10 @@ def _run_tool(mcp: str, tool_name: str, arguments: dict[str, Any], *, verbatim:
|
|
|
160
171
|
if isinstance(structured, (dict, list)):
|
|
161
172
|
_print_json(structured)
|
|
162
173
|
return
|
|
163
|
-
try:
|
|
164
|
-
_print_json(decode_embedded_payload(text))
|
|
165
|
-
except ValueError:
|
|
166
|
-
_print_text(text)
|
|
174
|
+
try:
|
|
175
|
+
_print_json(decode_embedded_payload(text))
|
|
176
|
+
except ValueError:
|
|
177
|
+
_print_text(text)
|
|
167
178
|
|
|
168
179
|
|
|
169
180
|
@app.command("version")
|
|
@@ -181,7 +192,7 @@ def tui_cmd() -> None:
|
|
|
181
192
|
@config_app.command("set")
|
|
182
193
|
def config_set_cmd(
|
|
183
194
|
secret_key: Annotated[Optional[str], typer.Option("--secret-key", "-k", help="secret-key")] = None,
|
|
184
|
-
mcp: Annotated[Optional[str], typer.Option("--mcp", help="
|
|
195
|
+
mcp: Annotated[Optional[str], typer.Option("--mcp", help="仅配置某个分组: tiktok / patent / amazon / social / account")] = None,
|
|
185
196
|
base_url: BaseUrlOpt = None,
|
|
186
197
|
) -> None:
|
|
187
198
|
"""保存通用或单 MCP 配置"""
|
|
@@ -287,6 +298,31 @@ def call_tool_cmd(
|
|
|
287
298
|
|
|
288
299
|
|
|
289
300
|
# TikTok shortcuts
|
|
301
|
+
@tiktok_statistics_app.command("overview")
|
|
302
|
+
def tiktok_statistics_overview(
|
|
303
|
+
country_region: CountryOpt = "美国",
|
|
304
|
+
data_period: DataPeriodOpt = "last7d",
|
|
305
|
+
category_id: Annotated[Optional[str], typer.Option("--category-id", help="一级类目 ID")] = None,
|
|
306
|
+
second_category_id: Annotated[Optional[str], typer.Option("--second-category-id", help="二级类目 ID,需同时传 --category-id")] = None,
|
|
307
|
+
extra: ExtraArg = None,
|
|
308
|
+
) -> None:
|
|
309
|
+
_run_tool(
|
|
310
|
+
"tiktok",
|
|
311
|
+
"tt_dashboard_overview",
|
|
312
|
+
_with_extra(
|
|
313
|
+
"tiktok",
|
|
314
|
+
"tt_dashboard_overview",
|
|
315
|
+
{
|
|
316
|
+
"countryRegion": country_region,
|
|
317
|
+
"dataPeriod": data_period,
|
|
318
|
+
"categoryId": category_id,
|
|
319
|
+
"secondCategoryId": second_category_id,
|
|
320
|
+
},
|
|
321
|
+
extra,
|
|
322
|
+
),
|
|
323
|
+
)
|
|
324
|
+
|
|
325
|
+
|
|
290
326
|
@tiktok_statistics_app.command("total")
|
|
291
327
|
def tiktok_statistics_total(country_region: CountryOpt = "美国", data_period: DataPeriodOpt = "last7d", date: DateOpt = None, extra: ExtraArg = None) -> None:
|
|
292
328
|
_run_tool("tiktok", "tt_commodity_statistics_get_total_statistics", _with_extra("tiktok", "tt_commodity_statistics_get_total_statistics", {"countryRegion": country_region, "dataPeriod": data_period, "date": date}, extra))
|
|
@@ -333,11 +369,6 @@ def tiktok_commodity_voice(commodity_id: Annotated[str, typer.Argument(help="商
|
|
|
333
369
|
_run_tool("tiktok", "tt_commodity_voice_analyze", {"countryRegion": country_region, "commodityId": commodity_id, "size": size})
|
|
334
370
|
|
|
335
371
|
|
|
336
|
-
@tiktok_commodity_app.command("channel")
|
|
337
|
-
def tiktok_commodity_channel(product_id: Annotated[str, typer.Argument(help="商品 ID")], country_region: CountryOpt = "美国", sale_type: Annotated[int, typer.Option("--sale-type")] = 1) -> None:
|
|
338
|
-
_run_tool("tiktok", "tt_sale_channel_sale_channel", {"countryRegion": country_region, "productId": product_id, "saleType": sale_type})
|
|
339
|
-
|
|
340
|
-
|
|
341
372
|
@tiktok_commodity_app.command("expert-trend")
|
|
342
373
|
def tiktok_commodity_expert_trend(commodity_id: Annotated[str, typer.Argument(help="商品 ID")], country_region: CountryOpt = "美国") -> None:
|
|
343
374
|
_run_tool("tiktok", "tt_commodity_expert_draw_expert_trend", {"countryRegion": country_region, "commodityId": commodity_id})
|
|
@@ -563,7 +594,7 @@ def amazon_product_price(node_id: Annotated[str, typer.Argument(help="类目节
|
|
|
563
594
|
|
|
564
595
|
@amazon_hot_app.command("list")
|
|
565
596
|
def amazon_hot_list(web_site_id: Annotated[str, typer.Option("--web-site-id", "--site")], rank_type: Annotated[str, typer.Option("--rank-type")], cat_id: Annotated[Optional[str], typer.Option("--cat-id")] = None, current_page: Annotated[int, typer.Option("--current-page")] = 1, page_size: Annotated[int, typer.Option("--page-size")] = 10) -> None:
|
|
566
|
-
_run_tool("amazon", "
|
|
597
|
+
_run_tool("amazon", "amz_hot_amz_hot_list_v2", {"webSiteId": web_site_id, "rankType": rank_type, "catId": cat_id, "currentPage": current_page, "pageSize": page_size})
|
|
567
598
|
|
|
568
599
|
|
|
569
600
|
@amazon_hot_app.command("cat-tree")
|
|
@@ -571,6 +602,134 @@ def amazon_hot_cat_tree(web_site_id: Annotated[str, typer.Option("--web-site-id"
|
|
|
571
602
|
_run_tool("amazon", "amz_hot_amz_hot_cat_tree", {"webSiteId": web_site_id, "rankType": rank_type, "keyword": keyword})
|
|
572
603
|
|
|
573
604
|
|
|
605
|
+
# Social shortcuts
|
|
606
|
+
@instagram_app.command("hashtag-posts")
|
|
607
|
+
def instagram_hashtag_posts(
|
|
608
|
+
hashtag: Annotated[str, typer.Argument(help="话题标签,不含 #")],
|
|
609
|
+
max_pages: Annotated[int, typer.Option("--max-pages")],
|
|
610
|
+
) -> None:
|
|
611
|
+
_run_tool("social", "instagram_fetch_hashtag_posts", {"hashtag": hashtag, "max_pages": max_pages})
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
@instagram_app.command("post-comments")
|
|
615
|
+
def instagram_post_comments(
|
|
616
|
+
post_id: Annotated[str, typer.Argument(help="帖子 shortcode")],
|
|
617
|
+
priority: PriorityOpt = None,
|
|
618
|
+
) -> None:
|
|
619
|
+
_run_tool("social", "instagram_fetch_post_comments", {"post_id": post_id, "priority": priority})
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
@instagram_app.command("post-info")
|
|
623
|
+
def instagram_post_info(
|
|
624
|
+
post_id: Annotated[str, typer.Argument(help="帖子 shortcode")],
|
|
625
|
+
priority: PriorityOpt = None,
|
|
626
|
+
) -> None:
|
|
627
|
+
_run_tool("social", "instagram_fetch_post_info", {"post_id": post_id, "priority": priority})
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
@instagram_app.command("reel-info")
|
|
631
|
+
def instagram_reel_info(post_id: Annotated[str, typer.Argument(help="Reel shortcode")]) -> None:
|
|
632
|
+
_run_tool("social", "instagram_fetch_reel_info", {"post_id": post_id})
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
@instagram_app.command("user-info")
|
|
636
|
+
def instagram_user_info(
|
|
637
|
+
user_id: Annotated[str, typer.Argument(help="Instagram 用户数字 ID")],
|
|
638
|
+
priority: PriorityOpt = None,
|
|
639
|
+
) -> None:
|
|
640
|
+
_run_tool("social", "instagram_fetch_user_info", {"user_id": user_id, "priority": priority})
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
@instagram_app.command("user-reels")
|
|
644
|
+
def instagram_user_reels(
|
|
645
|
+
user_id: Annotated[str, typer.Argument(help="Instagram 用户数字 ID")],
|
|
646
|
+
max_pages: Annotated[int, typer.Option("--max-pages")],
|
|
647
|
+
) -> None:
|
|
648
|
+
_run_tool("social", "instagram_fetch_user_reels", {"user_id": user_id, "max_pages": max_pages})
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
@reddit_app.command("post-comments")
|
|
652
|
+
def reddit_post_comments(
|
|
653
|
+
media_url: Annotated[str, typer.Argument(help="Reddit 帖子 URL")],
|
|
654
|
+
sort: Annotated[Optional[str], typer.Option("--sort")] = None,
|
|
655
|
+
priority: PriorityOpt = None,
|
|
656
|
+
) -> None:
|
|
657
|
+
_run_tool("social", "reddit_fetch_post_comments", {"media_url": media_url, "sort": sort, "priority": priority})
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
@reddit_app.command("post-details")
|
|
661
|
+
def reddit_post_details(
|
|
662
|
+
media_url: Annotated[str, typer.Argument(help="Reddit 帖子 URL")],
|
|
663
|
+
priority: PriorityOpt = None,
|
|
664
|
+
) -> None:
|
|
665
|
+
_run_tool("social", "reddit_fetch_post_details", {"media_url": media_url, "priority": priority})
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
@youtube_app.command("post-info")
|
|
669
|
+
def youtube_post_info(
|
|
670
|
+
media_id: Annotated[str, typer.Argument(help="YouTube 视频 ID")],
|
|
671
|
+
priority: PriorityOpt = None,
|
|
672
|
+
) -> None:
|
|
673
|
+
_run_tool("social", "youtube_fetch_post_info", {"media_id": media_id, "priority": priority})
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
@youtube_app.command("post-comments")
|
|
677
|
+
def youtube_post_comments(
|
|
678
|
+
media_id: Annotated[str, typer.Argument(help="YouTube 视频 ID")],
|
|
679
|
+
review_token: Annotated[str, typer.Option("--review-token", help="由 post-info 返回")],
|
|
680
|
+
priority: PriorityOpt = None,
|
|
681
|
+
) -> None:
|
|
682
|
+
_run_tool("social", "youtube_fetch_post_comments", {"media_id": media_id, "review_token": review_token, "priority": priority})
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
@youtube_app.command("user-info")
|
|
686
|
+
def youtube_user_info(
|
|
687
|
+
author_id: Annotated[str, typer.Argument(help="UC 开头的频道 ID")],
|
|
688
|
+
priority: PriorityOpt = None,
|
|
689
|
+
) -> None:
|
|
690
|
+
_run_tool("social", "youtube_fetch_user_info", {"author_id": author_id, "priority": priority})
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
# Account shortcuts
|
|
694
|
+
@account_app.command("catalog")
|
|
695
|
+
def account_catalog(
|
|
696
|
+
scope: Annotated[Optional[str], typer.Option("--scope", help="all / mcp / api")] = None,
|
|
697
|
+
platform: Annotated[Optional[str], typer.Option("--platform", help="amazon / tiktok / patent / social")] = None,
|
|
698
|
+
) -> None:
|
|
699
|
+
_run_tool("account", "account_catalog", {"scope": scope, "platform": platform})
|
|
700
|
+
|
|
701
|
+
|
|
702
|
+
@account_app.command("info")
|
|
703
|
+
def account_info() -> None:
|
|
704
|
+
_run_tool("account", "account_info", {})
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
@account_app.command("links")
|
|
708
|
+
def account_links() -> None:
|
|
709
|
+
_run_tool("account", "account_links", {})
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
@account_app.command("order-create")
|
|
713
|
+
def account_order_create(
|
|
714
|
+
plan_id: Annotated[str, typer.Argument(help="套餐 planId")],
|
|
715
|
+
payment_method: Annotated[Optional[str], typer.Option("--payment-method")] = None,
|
|
716
|
+
) -> None:
|
|
717
|
+
_run_tool("account", "account_order_create", {"planId": plan_id, "paymentMethod": payment_method})
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
@account_app.command("order-status")
|
|
721
|
+
def account_order_status(mch_order_no: Annotated[str, typer.Argument(help="商户订单号")]) -> None:
|
|
722
|
+
_run_tool("account", "account_order_status", {"mchOrderNo": mch_order_no})
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
@account_app.command("orders")
|
|
726
|
+
def account_orders(
|
|
727
|
+
page: Annotated[Optional[int], typer.Option("--page")] = None,
|
|
728
|
+
page_size: Annotated[Optional[int], typer.Option("--page-size")] = None,
|
|
729
|
+
) -> None:
|
|
730
|
+
_run_tool("account", "account_orders", {"page": page, "pageSize": page_size})
|
|
731
|
+
|
|
732
|
+
|
|
574
733
|
def main() -> None:
|
|
575
734
|
app()
|
|
576
735
|
|
|
@@ -6,7 +6,7 @@ from openboost_cli.mcp_client import McpClient
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class OpenBoost:
|
|
9
|
-
"""Unified Python client for OpenBoost MCP
|
|
9
|
+
"""Unified Python client for OpenBoost MCP tools.
|
|
10
10
|
|
|
11
11
|
Usage:
|
|
12
12
|
|
|
@@ -16,6 +16,8 @@ class OpenBoost:
|
|
|
16
16
|
client.tiktok.tt_video_content(countryRegion="美国", videoId="...")
|
|
17
17
|
client.patent.patent_query_search(query_text="TACD: virtual reality")
|
|
18
18
|
client.amazon.amz_product_selection(webSiteId="1")
|
|
19
|
+
client.social.youtube_fetch_post_info(media_id="...")
|
|
20
|
+
client.account.account_info()
|
|
19
21
|
"""
|
|
20
22
|
|
|
21
23
|
def __init__(
|
|
@@ -25,9 +27,13 @@ class OpenBoost:
|
|
|
25
27
|
tiktok_secret_key: str | None = None,
|
|
26
28
|
patent_secret_key: str | None = None,
|
|
27
29
|
amazon_secret_key: str | None = None,
|
|
30
|
+
social_secret_key: str | None = None,
|
|
31
|
+
account_secret_key: str | None = None,
|
|
28
32
|
tiktok_base_url: str | None = None,
|
|
29
33
|
patent_base_url: str | None = None,
|
|
30
34
|
amazon_base_url: str | None = None,
|
|
35
|
+
social_base_url: str | None = None,
|
|
36
|
+
account_base_url: str | None = None,
|
|
31
37
|
connect_timeout_sec: float = 30,
|
|
32
38
|
read_timeout_sec: float = 300,
|
|
33
39
|
) -> None:
|
|
@@ -53,6 +59,18 @@ class OpenBoost:
|
|
|
53
59
|
base_url=amazon_base_url,
|
|
54
60
|
**shared,
|
|
55
61
|
)
|
|
62
|
+
self.social = McpClient(
|
|
63
|
+
"social",
|
|
64
|
+
secret_key=social_secret_key or secret_key,
|
|
65
|
+
base_url=social_base_url,
|
|
66
|
+
**shared,
|
|
67
|
+
)
|
|
68
|
+
self.account = McpClient(
|
|
69
|
+
"account",
|
|
70
|
+
secret_key=account_secret_key or secret_key,
|
|
71
|
+
base_url=account_base_url,
|
|
72
|
+
**shared,
|
|
73
|
+
)
|
|
56
74
|
|
|
57
75
|
def client(self, mcp: str) -> McpClient:
|
|
58
76
|
return getattr(self, mcp)
|
|
@@ -5,25 +5,25 @@ import re
|
|
|
5
5
|
from typing import Any
|
|
6
6
|
|
|
7
7
|
_JSON_FENCE_RE = re.compile(r"```(?:json)?\s*([\s\S]*?)```", re.IGNORECASE)
|
|
8
|
-
_MARKER = "响应数据(JSON)"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def _loads_json(text: str) -> Any:
|
|
12
|
-
value = json.loads(text)
|
|
13
|
-
for _ in range(4):
|
|
14
|
-
if not isinstance(value, str):
|
|
15
|
-
break
|
|
16
|
-
nested = value.strip()
|
|
17
|
-
if not nested.startswith(("{", "[")):
|
|
18
|
-
break
|
|
19
|
-
try:
|
|
20
|
-
value = json.loads(nested)
|
|
21
|
-
except json.JSONDecodeError:
|
|
22
|
-
break
|
|
23
|
-
return value
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
def _last_longest_json_value(text: str) -> tuple[Any | None, int]:
|
|
8
|
+
_MARKER = "响应数据(JSON)"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def _loads_json(text: str) -> Any:
|
|
12
|
+
value = json.loads(text)
|
|
13
|
+
for _ in range(4):
|
|
14
|
+
if not isinstance(value, str):
|
|
15
|
+
break
|
|
16
|
+
nested = value.strip()
|
|
17
|
+
if not nested.startswith(("{", "[")):
|
|
18
|
+
break
|
|
19
|
+
try:
|
|
20
|
+
value = json.loads(nested)
|
|
21
|
+
except json.JSONDecodeError:
|
|
22
|
+
break
|
|
23
|
+
return value
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _last_longest_json_value(text: str) -> tuple[Any | None, int]:
|
|
27
27
|
decoder = json.JSONDecoder()
|
|
28
28
|
best: Any | None = None
|
|
29
29
|
best_len = -1
|
|
@@ -40,25 +40,25 @@ def _last_longest_json_value(text: str) -> tuple[Any | None, int]:
|
|
|
40
40
|
return best, best_len
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
def decode_embedded_payload(text: str) -> Any:
|
|
44
|
-
stripped = text.strip()
|
|
45
|
-
try:
|
|
46
|
-
return _loads_json(stripped)
|
|
43
|
+
def decode_embedded_payload(text: str) -> Any:
|
|
44
|
+
stripped = text.strip()
|
|
45
|
+
try:
|
|
46
|
+
return _loads_json(stripped)
|
|
47
47
|
except json.JSONDecodeError:
|
|
48
48
|
pass
|
|
49
49
|
|
|
50
50
|
marker_idx = text.find(_MARKER)
|
|
51
51
|
if marker_idx >= 0:
|
|
52
|
-
tail = text[marker_idx + len(_MARKER) :].lstrip("\n:")
|
|
52
|
+
tail = text[marker_idx + len(_MARKER) :].lstrip("\n:")
|
|
53
53
|
try:
|
|
54
54
|
return decode_embedded_payload(tail)
|
|
55
55
|
except ValueError:
|
|
56
56
|
pass
|
|
57
57
|
|
|
58
58
|
for match in _JSON_FENCE_RE.finditer(text):
|
|
59
|
-
block = match.group(1).strip()
|
|
60
|
-
try:
|
|
61
|
-
return _loads_json(block)
|
|
59
|
+
block = match.group(1).strip()
|
|
60
|
+
try:
|
|
61
|
+
return _loads_json(block)
|
|
62
62
|
except json.JSONDecodeError:
|
|
63
63
|
continue
|
|
64
64
|
|