nexscope-ecommerce-skills
127 portable ecommerce skills for marketplace research, product discovery, keyword analysis, trends, sourcing, patent screening, multimodal tasks, and GEO workflows.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Check it deeper on your machine
It has changed since its scan on 11 Nov 2026. Its scripts were only partly scanned.
As a Claude Code plugin, install it and then ask Claude Code:
/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/nexscope-ai/nexscope-ecommerce-skills with scanskillsafety
Or from a terminal, clone it and run it:
git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/nexscope-ai/nexscope-ecommerce-skills'
It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.
Badge for your README
Markdown
[](/listings/nexscope-ai--nexscope-ecommerce-skills)HTML
<a href="/listings/nexscope-ai--nexscope-ecommerce-skills"><img src="/api/listings/nexscope-ai--nexscope-ecommerce-skills/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
1. Clone the collection
git clone https://github.com/nexscope-ai/nexscope-ecommerce-skills.git cd nexscope-ecommerce-skills
2. Install the skills you need
Preview every available skill with the Skills CLI:
npx skills add nexscope-ai/nexscope-ecommerce-skills --list
Install one skill:
npx skills add nexscope-ai/nexscope-ecommerce-skills --skill ecommerce-amazon-search
Each top-level `ecommerce-*` directory is an individual skill package. You can also copy a complete directory into the skills location used by your assistant. Keep its `SKILL.md`, scripts, references, assets, and manifest files together.
Example:
cp -R ecommerce-amazon-search <your-agent-skills-directory>/
You can also install the whole collection if your agent supports loading multiple skill directories from one repository. See the [external skills setup guide](https://www.nexscope.ai/help/skills-external-access?co-from=githubNS) for agent-specific instructions.
> **Naming update:** Earlier clones used dotted names such as `ecommerce.amazon-search`. Current Agent Skills-compatible names use hyphens, such as `ecommerce-amazon-search`. Replace old dotted directories instead of keeping both copies.
3. Configure API access
Most API-backed skills require these environment variables:
export NEXSCOPE_PROXY_BASE=https://api.nexscope.ai/ export NEXSCOPE_API_KEY=<your_api_key>
Get or manage an API key on the [Nexscope API Keys page](https://www.nexscope.ai/seller/api-access?co-from=githubNS). API calls may consume credits; check the selected skill's `SKILL.md` before running additional queries or retries.
4. Ask naturally
Examples:
> "Search Amazon US for wireless earbuds and show the current organic and sponsored results."
> "Find TikTok Shop beauty products with strong 30-day sales and at least a 10% commission rate."
> "Show Ozon products for this seller and summarize their pricing and sales metrics."
> "Search 1688 for visually similar suppliers using this product image."
> "Check this product image for similar design patents."
> "Score this product page for SEO and GEO readiness."
> "Evaluate whether AI search engines mention and recommend this product."
---
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
README.md · README · 355 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.
- 
- <div align="center">
- # E-commerce Skills by Nexscope
- **141 portable skills for ecommerce research, marketplace intelligence, product discovery, keyword analysis, trend research, sourcing, patent and trademark screening, multimodal tasks, and GEO workflows.**
- [](#all-141-skills)
- [](#quick-start)
- [](#license)
- For Amazon, TikTok Shop, Ozon, 1688, Shopify, Temu, Walmart, Shopee, Etsy, eBay, and more.
- </div>
- ---
- ## Quick Start
- ### 1. Clone the collection
- ```bash
- git clone https://github.com/nexscope-ai/nexscope-ecommerce-skills.git
- cd nexscope-ecommerce-skills
- ```
- ### 2. Install the skills you need
- Preview every available skill with the Skills CLI:
- ```bash
- npx skills add nexscope-ai/nexscope-ecommerce-skills --list
- ```
- Install one skill:
- ```bash
- npx skills add nexscope-ai/nexscope-ecommerce-skills --skill ecommerce-amazon-search
- ```
- Each top-level `ecommerce-*` directory is an individual skill package. You can also copy a complete directory into the skills location used by your assistant. Keep its `SKILL.md`, scripts, references, assets, and manifest files together.
- Example:
- ```bash
- cp -R ecommerce-amazon-search <your-agent-skills-directory>/
- ```
- You can also install the whole collection if your agent supports loading multiple skill directories from one repository. See the [external skills setup guide](https://www.nexscope.ai/help/skills-external-access?co-from=githubNS) for agent-specific instructions.
- > **Naming update:** Earlier clones used dotted names such as `ecommerce.amazon-search`. Current Agent Skills-compatible names use hyphens, such as `ecommerce-amazon-search`. Replace old dotted directories instead of keeping both copies.
- ### 3. Configure API access
- Most API-backed skills require these environment variables:
- ```bash
- export NEXSCOPE_PROXY_BASE=https://api.nexscope.ai/
- export NEXSCOPE_API_KEY=<your_api_key>
- ```
- Get or manage an API key on the [Nexscope API Keys page](https://www.nexscope.ai/seller/api-access?co-from=githubNS). API calls may consume credits; check the selected skill's `SKILL.md` before running additional queries or retries.
- ### 4. Ask naturally
- Examples:
- > "Search Amazon US for wireless earbuds and show the current organic and sponsored results."
- > "Find TikTok Shop beauty products with strong 30-day sales and at least a 10% commission rate."
- > "Show Ozon products for this seller and summarize their pricing and sales metrics."
- > "Search 1688 for visually similar suppliers using this product image."
- > "Check this product image for similar design patents."
- > "Score this product page for SEO and GEO readiness."
- > "Evaluate whether AI search engines mention and recommend this product."
- ---
- ## Collection at a Glance
- | Category | Skills |
- |---|---:|
- | Amazon Intelligence | 42 |
- | TikTok Shop Intelligence | 23 |
- | Ozon Intelligence | 13 |
- | Patent, Trademark & Compliance | 25 |
- | 1688 Sourcing | 5 |
- | Other Marketplaces & Storefronts | 23 |
- | Web, Trends, Multimodal & GEO | 10 |
- | **Total** | **141** |
- ---
- ## All 141 Skills
- ### Amazon Intelligence (42)
- | Skill | What it does |
- |---|---|
- | [`amazon-ads-sp-insights-report`](./ecommerce-amazon-ads-sp-insights-report/) | Create, poll, and download Sponsored Products audience and search-term impression-share reports using an authorized Amazon Ads connection. |
- | [`amazon-ads-api-access`](./ecommerce-amazon-ads-api-access/) | Authorize Amazon Ads accounts and inspect connection and profile metadata. |
- | [`amazon-ads-reporting-api`](./ecommerce-amazon-ads-reporting-api/) | Create, poll, resume, download, and save Amazon Ads v3 reports. |
- | [`amazon-advertising-api`](./ecommerce-amazon-advertising-api/) | Authorize Amazon Ads accounts, manage SP, SB, and SD entities, and retrieve reports. |
- | [`amazon-ads-manager`](./ecommerce-amazon-ads-manager/) | Read and mutate SP, SB, and SD campaigns, ad groups, ads, targeting, and budget rules. |
- | [`amazon-alexa-search`](./ecommerce-amazon-alexa-search/) | Search Amazon Alexa shopping results. |
- | [`amazon-asin-keywords`](./ecommerce-amazon-asin-keywords/) | Retrieve keywords associated with an Amazon ASIN. |
- | [`amazon-asin-traffic-summary`](./ecommerce-amazon-asin-traffic-summary/) | Retrieve an Amazon ASIN traffic summary. |
- | [`amazon-broad-product-search`](./ecommerce-amazon-broad-product-search/) | Search broadly for Amazon products. |
- | [`amazon-category-lookup`](./ecommerce-amazon-category-lookup/) | Browse Amazon category nodes by parent identifier or search category metadata by name. |
- | [`amazon-competitor-lookup`](./ecommerce-amazon-competitor-lookup/) | Look up competing Amazon products. |
- | [`amazon-keyword-expansion`](./ecommerce-amazon-keyword-expansion/) | Expand an Amazon keyword. |
- | [`amazon-keyword-intelligence`](./ecommerce-amazon-keyword-intelligence/) | Query Amazon keyword intelligence data. |
- | [`amazon-keyword-overview`](./ecommerce-amazon-keyword-overview/) | Retrieve an overview for an Amazon keyword. |
- | [`amazon-keyword-search-history`](./ecommerce-amazon-keyword-search-history/) | Retrieve historical Amazon keyword search volume. |
- | [`amazon-keyword-share-of-voice`](./ecommerce-amazon-keyword-share-of-voice/) | Retrieve Amazon keyword share of voice. |
- | [`amazon-keyword-summary`](./ecommerce-amazon-keyword-summary/) | Retrieve a summary for an Amazon keyword. |
- | [`amazon-market-product-detail`](./ecommerce-amazon-market-product-detail/) | Retrieve Amazon marketplace product details. |
- | [`amazon-market-product-search`](./ecommerce-amazon-market-product-search/) | Search for products in the Amazon marketplace. |
- | [`amazon-market-research`](./ecommerce-amazon-market-research/) | Research an Amazon market. |
- | [`amazon-market-statistics`](./ecommerce-amazon-market-statistics/) | Analyze Amazon market statistics. |
- | [`amazon-niche-info`](./ecommerce-amazon-niche-info/) | Retrieve Amazon niche information. |
- | [`amazon-niche-info-by-asin`](./ecommerce-amazon-niche-info-by-asin/) | Retrieve Amazon niche information by ASIN. |
- | [`amazon-niche-info-by-keyword`](./ecommerce-amazon-niche-info-by-keyword/) | Retrieve Amazon niche information by keyword. |
- | [`amazon-niche-reviews-by-keyword`](./ecommerce-amazon-niche-reviews-by-keyword/) | Retrieve Amazon niche reviews by keyword. |
- | [`amazon-opportunity-report-by-keyword`](./ecommerce-amazon-opportunity-report-by-keyword/) | Retrieve Amazon opportunity reports by keyword. |
- | [`amazon-opportunity-search-by-metrics`](./ecommerce-amazon-opportunity-search-by-metrics/) | Search Amazon opportunities by metrics. |
- | [`amazon-policy-feed`](./ecommerce-amazon-policy-feed/) | Retrieve marketplace policy updates and full article details. |
- | [`amazon-product-database`](./ecommerce-amazon-product-database/) | Query the Amazon product database. |
- | [`amazon-product-database-search`](./ecommerce-amazon-product-database-search/) | Search the Amazon product database. |
- | [`amazon-product-detail`](./ecommerce-amazon-product-detail/) | Retrieve Amazon product details. |
- | [`amazon-product-discovery`](./ecommerce-amazon-product-discovery/) | Discover Amazon products. |
- | [`amazon-product-history`](./ecommerce-amazon-product-history/) | Retrieve Amazon product history and product details. |
- | [`amazon-product-price-series`](./ecommerce-amazon-product-price-series/) | Retrieve Amazon product price and metric series. |
- | [`amazon-product-research-api`](./ecommerce-amazon-product-research-api/) | Route Amazon product research across market, keyword, competitor, trend, review, and profitability capabilities. |
- | [`amazon-related-asins`](./ecommerce-amazon-related-asins/) | Retrieve Amazon ASINs related to an ASIN. |
- | [`amazon-reviews-list`](./ecommerce-amazon-reviews-list/) | Retrieve Amazon product reviews. |
- | [`amazon-sales-estimates`](./ecommerce-amazon-sales-estimates/) | Estimate historical daily sales for an Amazon product. |
- | [`amazon-traffic-gap-analyst`](./ecommerce-amazon-traffic-gap-analyst/) | Analyze variant-aware traffic gaps with evidence-linked local HTML reports. |
- | [`amazon-search`](./ecommerce-amazon-search/) | Search Amazon products. |
- | [`amazon-search-by-image`](./ecommerce-amazon-search-by-image/) | Search for visually similar products on Amazon using an image across eight marketplaces. |
- | [`amazon-traffic-keywords`](./ecommerce-amazon-traffic-keywords/) | Research Amazon traffic keywords. |
- ### TikTok Shop Intelligence (23)
- | Skill | What it does |
- |---|---|
- | [`chuhaijiang-tiktok-product`](./ecommerce-chuhaijiang-tiktok-product/) | Search TikTok products and inspect details, trends, creators, videos, and related commerce data. |
- | [`chuhaijiang-tiktok-shop`](./ecommerce-chuhaijiang-tiktok-shop/) | Search TikTok shops and inspect shop details, rankings, products, creators, and videos. |
- | [`chuhaijiang-tiktok-creator`](./ecommerce-chuhaijiang-tiktok-creator/) | Search TikTok creators and inspect profiles, rankings, products, videos, and live streams. |
- | [`chuhaijiang-tiktok-live`](./ecommerce-chuhaijiang-tiktok-live/) | Inspect TikTok live streams, rankings, and related products. |
- | [`chuhaijiang-tiktok-video`](./ecommerce-chuhaijiang-tiktok-video/) | Search TikTok videos and inspect details, rankings, and related products. |
- | [`chuhaijiang-tiktok-ads`](./ecommerce-chuhaijiang-tiktok-ads/) | Search TikTok ads and creatives and inspect details and related products. |
- | [`tiktok-batch-product-detail`](./ecommerce-tiktok-batch-product-detail/) | Retrieve batch TikTok product details. |
- | [`tiktok-creator-analytics`](./ecommerce-tiktok-creator-analytics/) | Retrieve TikTok creator rankings and creator-level analytics. |
- | [`tiktok-creator-search-api`](./ecommerce-tiktok-creator-search-api/) | Search TikTok ecommerce creator rankings by market and date range. |
- | [`tiktok-livestream-analytics`](./ecommerce-tiktok-livestream-analytics/) | Retrieve TikTok livestream rankings and livestream details. |
- | [`tiktok-new-product-rank`](./ecommerce-tiktok-new-product-rank/) | Retrieve TikTok new-product rankings. |
- | [`tiktok-product-analytics`](./ecommerce-tiktok-product-analytics/) | Retrieve TikTok product rankings and product details. |
- | [`tiktok-product-analytics-api`](./ecommerce-tiktok-product-analytics-api/) | Retrieve price, sales, revenue, commission, lifecycle, and shop data for a TikTok product. |
- | [`tiktok-product-discovery`](./ecommerce-tiktok-product-discovery/) | Discover TikTok products. |
- | [`tiktok-product-search`](./ecommerce-tiktok-product-search/) | Search TikTok products. |
- | [`tiktok-seller-detail`](./ecommerce-tiktok-seller-detail/) | Get detailed metrics and attributes for one TikTok Shop seller. |
- | [`tiktok-shop-analytics`](./ecommerce-tiktok-shop-analytics/) | Retrieve TikTok shop rankings and shop details. |
- | [`tiktok-shop-product-detail`](./ecommerce-tiktok-shop-product-detail/) | Retrieve TikTok Shop product details by product ID or URL. |
- | [`tiktok-top-selling-products`](./ecommerce-tiktok-top-selling-products/) | Retrieve TikTok Shop top-selling product rankings. |
- | [`tiktok-video-analytics`](./ecommerce-tiktok-video-analytics/) | Retrieve TikTok video rankings and video details. |
- | [`tiktok-video-download-url`](./ecommerce-tiktok-video-download-url/) | Retrieve a TikTok video download URL. |
- | [`tiktok-video-rank`](./ecommerce-tiktok-video-rank/) | Retrieve ranked TikTok videos by market, date, and ranking metric. |
- | [`tiktok-video-search`](./ecommerce-tiktok-video-search/) | Search TikTok videos by market, creator, product, engagement, and publication filters. |
- ### Ozon Intelligence (13)
- | Skill | What it does |
- |---|---|
- | [`ozon-brand-products`](./ecommerce-ozon-brand-products/) | Retrieve Ozon products for a brand. |
- | [`ozon-category-products`](./ecommerce-ozon-category-products/) | Retrieve Ozon products for a category. |
- | [`ozon-category-search`](./ecommerce-ozon-category-search/) | Search Ozon category products. |
- | [`ozon-keyword-back-search`](./ecommerce-ozon-keyword-back-search/) | Find Ozon keywords associated with product SKUs. |
- | [`ozon-keyword-mining`](./ecommerce-ozon-keyword-mining/) | Mine related Ozon search keywords. |
- | [`ozon-market-keyword-search`](./ecommerce-ozon-market-keyword-search/) | Search Ozon marketplace keyword metrics. |
- | [`ozon-product-detail`](./ecommerce-ozon-product-detail/) | Retrieve Ozon product details for one SKU per call. |
- | [`ozon-product-detail-search`](./ecommerce-ozon-product-detail-search/) | Retrieve Ozon product detail history. |
- | [`ozon-product-report-search`](./ecommerce-ozon-product-report-search/) | Search Ozon product reports. |
- | [`ozon-product-search`](./ecommerce-ozon-product-search/) | Search Ozon products by keyword or product ID. |
- | [`ozon-product-trend`](./ecommerce-ozon-product-trend/) | Retrieve daily Ozon product trends. |
- | [`ozon-seller-products`](./ecommerce-ozon-seller-products/) | Retrieve Ozon products for a seller. |
- | [`ozon-shop-search`](./ecommerce-ozon-shop-search/) | Search Ozon shops and seller metrics. |
- ### Patent, Trademark & Compliance (25)
- | Skill | What it does |
- |---|---|
- | [`design-similarity-search`](./ecommerce-design-similarity-search/) | Find visually similar design-patent candidates from a product image using SIF. |
- | [`google-patent-search`](./ecommerce-google-patent-search/) | Search Google Patents by keyword and filters. |
- | [`maidalv-product-tro-detection`](./ecommerce-maidalv-product-tro-detection/) | Assess product imagery for TRO, trademark, patent, and copyright infringement risk. |
- | [`patent-abstract-image-data`](./ecommerce-patent-abstract-image-data/) | Retrieve patent abstract image data. |
- | [`patent-cited-by`](./ecommerce-patent-cited-by/) | Retrieve patents that cite a specified patent. |
- | [`patent-claims`](./ecommerce-patent-claims/) | Retrieve original patent claims and claim counts. |
- | [`patent-claims-translation`](./ecommerce-patent-claims-translation/) | Retrieve translated patent claims. |
- | [`patent-core-bibliography`](./ecommerce-patent-core-bibliography/) | Retrieve core patent bibliography data. |
- | [`patent-description-data`](./ecommerce-patent-description-data/) | Retrieve original patent description data. |
- | [`patent-description-data-translation`](./ecommerce-patent-description-data-translation/) | Retrieve translated patent description data. |
- | [`patent-detailed-bibliography`](./ecommerce-patent-detailed-bibliography/) | Retrieve detailed patent bibliography data. |
- | [`patent-fulltext-images`](./ecommerce-patent-fulltext-images/) | Retrieve patent full-text image data. |
- | [`patent-family-data`](./ecommerce-patent-family-data/) | Retrieve patent family data. |
- | [`patent-legal-status-data`](./ecommerce-patent-legal-status-data/) | Retrieve patent legal status data. |
- | [`patent-references`](./ecommerce-patent-references/) | Retrieve references cited by a patent. |
- | [`patent-search-api`](./ecommerce-patent-search-api/) | Search patents with Analytics query expressions and return matching patent identifiers and publication numbers. |
- | [`patent-title-abstract-translation`](./ecommerce-patent-title-abstract-translation/) | Retrieve translated patent titles and abstracts. |
- | [`ruiguan-copyright-detection`](./ecommerce-ruiguan-copyright-detection/) | Detect image copyright infringement risks by comparing against a database of registered copyrighted works. |
- | [`ruiguan-detection-patent-design`](./ecommerce-ruiguan-detection-patent-design/) | Detect design patent infringement risks by comparing a product image against a global design patent database across more than 25 jurisdictions. |
- | [`ruiguan-gun-parts-search`](./ecommerce-ruiguan-gun-parts-search/) | Check product images against a database of policy-violating items using visual similarity. |
- | [`ruiguan-trademark-graphic-detection`](./ecommerce-ruiguan-trademark-graphic-detection/) | Detect graphic trademarks in product images by comparing against registered trademark databases across multiple regions. |
- | [`text-trademark-detector`](./ecommerce-text-trademark-detector/) | Detect trademark risks in product titles and text. |
- | [`utility-patent-detector`](./ecommerce-utility-patent-detector/) | Check products for utility patent similarity. |
- | [`zhihuiya-patent-image-search`](./ecommerce-zhihuiya-patent-image-search/) | Search for visually similar design patents using an image, with country, legal status, and date filters. |
- | [`zhihuiya-utility-patent-image-search`](./ecommerce-zhihuiya-utility-patent-image-search/) | Search for visually similar utility model patents using an image, with country, legal status, and date filters. |
- These skills support research and screening workflows. Their results are not legal advice and do not replace review by a qualified intellectual property professional.
- ### 1688 Sourcing (5)
- | Skill | What it does |
- |---|---|
- | [`1688-procurement`](./ecommerce-1688-procurement/) | Authorize your own 1688 buyer account and manage addresses, SKUs, order previews, confirmed orders, payments, logistics and invoices across 14 operations. |
- | [`1688-product-detail`](./ecommerce-1688-product-detail/) | Retrieve 1688 product details by offer ID. |
- | [`1688-product-billboard`](./ecommerce-1688-product-billboard/) | Retrieve 1688 bestseller ranking data. |
- | [`1688-product-search`](./ecommerce-1688-product-search/) | Search 1688 products with sourcing and sales filters. |
- | [`1688-search-by-image`](./ecommerce-1688-search-by-image/) | Search for visually similar products on 1688 using an image. |
- ### Other Marketplaces & Storefronts (23)
- | Skill | What it does |
- |---|---|
- | [`ebay-search`](./ecommerce-ebay-search/) | Search eBay products and completed listings. The upstream sold-only filter is unavailable; completed listings are not verified sales. |
- | [`etsy-category-search`](./ecommerce-etsy-category-search/) | Search Etsy marketplace categories. |
- | [`etsy-product-detail`](./ecommerce-etsy-product-detail/) | Retrieve Etsy product details from a listing URL. |
- | [`etsy-product-query`](./ecommerce-etsy-product-query/) | Query Etsy product listings and performance data. |
- | [`etsy-store-query`](./ecommerce-etsy-store-query/) | Query Etsy stores and performance data. |
- | [`mercado-market-intelligence`](./ecommerce-mercado-market-intelligence/) | Research Mercado Libre categories, products, trends, sellers, and reviews. |
- | [`mercado-product-selection`](./ecommerce-mercado-product-selection/) | Research Mercado Libre products, catalogs, keywords, categories, trends, sellers, and reviews. |
- | [`shopee-product-detail`](./ecommerce-shopee-product-detail/) | Retrieve Shopee product details from a product URL. |
- | [`shopee-product-search`](./ecommerce-shopee-product-search/) | Search Shopee product information and metrics. |
- | [`shopify-product-query`](./ecommerce-shopify-product-query/) | Query Shopify products with filters. |
- | [`shopify-store-query`](./ecommerce-shopify-store-query/) | Query Shopify stores with filters. |
- | [`geekbi-temu-market-research`](./ecommerce-geekbi-temu-market-research/) | Inspect Temu market trends, category opportunities, and sales distributions. |
- | [`geekbi-temu-product`](./ecommerce-geekbi-temu-product/) | Search Temu products and inspect product details and recent history. |
- | [`geekbi-temu-search-by-image`](./ecommerce-geekbi-temu-search-by-image/) | Find visually similar Temu products using the supported temporary image upload workflow. |
- | [`geekbi-temu-shop`](./ecommerce-geekbi-temu-shop/) | Search Temu shops and inspect shop details and recent performance. |
- | [`temu-category-search`](./ecommerce-temu-category-search/) | Search Temu categories. |
- | [`temu-product-source-query`](./ecommerce-temu-product-source-query/) | Query Temu products for sourcing research. |
- | [`temu-store-source-query`](./ecommerce-temu-store-source-query/) | Query Temu stores for sourcing research. |
- | [`walmart-category-market`](./ecommerce-walmart-category-market/) | Analyze Walmart category market data. |
- | [`walmart-keyword-research`](./ecommerce-walmart-keyword-research/) | Research Walmart keyword demand and competition. |
- | [`walmart-product-analysis`](./ecommerce-walmart-product-analysis/) | Analyze Walmart product performance and details. |
- | [`walmart-product-detail`](./ecommerce-walmart-product-detail/) | Retrieve Walmart product details. |
- | [`walmart-search`](./ecommerce-walmart-search/) | Search Walmart products. |
- ### Web, Trends, Multimodal & GEO (10)
- | Skill | What it does |
- |---|---|
- | [`geo-score-check`](./ecommerce-geo-score-check/) | Score an ecommerce URL for SEO and GEO readiness from crawlable evidence. |
- | [`google-ai-mode-search`](./ecommerce-google-ai-mode-search/) | Search Google AI Mode results. |
- | [`google-trends-by-keywords`](./ecommerce-google-trends-by-keywords/) | Retrieve Google Trends data for keywords. |
- | [`google-trends-by-time`](./ecommerce-google-trends-by-time/) | Retrieve Google Trends data by time range. |
- | [`multimodal-generate-image`](./ecommerce-multimodal-generate-image/) | Generate and edit images from text prompts and optional reference images. |
- | [`multimodal-recognize-image`](./ecommerce-multimodal-recognize-image/) | Analyze images and extract information with multimodal AI recognition. |
- | [`product-ai-visibility`](./ecommerce-product-ai-visibility/) | Evaluate product mentions and recommendation positions across AI search engines. |
- | [`product-description-generator-api`](./ecommerce-product-description-generator-api/) | Generate ecommerce descriptions and other text asynchronously, and retrieve task results. |
- | [`reverse-product-image-search-api`](./ecommerce-reverse-product-image-search-api/) | Find visual or keyword-derived competitors from a product image or URL. |
- | [`web-search`](./ecommerce-web-search/) | Search the web for a keyword. |
- ---
- ## How Each Skill Works
- Start with the selected directory's `SKILL.md`. It defines:
- - when the skill should trigger;
- - required and optional inputs;
- - supported marketplaces, filters, and limits;
- - the API endpoint or local workflow;
- - safe handling for credits, retries, missing data, and errors;
- - the expected output format.
- Most API-backed packages also include:
- ```text
- ecommerce-example-skill/
- ├── SKILL.md
- ├── manifest.json
- ├── references/
- │ └── api.md
- └── scripts/
- └── example_skill.py
- ```
- Do not copy only `SKILL.md` when a package contains scripts, references, assets, configuration, or manifest files.
- ---
- ## Usage Notes
- - **Evidence first:** Results depend on the data returned for the exact marketplace, keyword, product, seller, date range, and filters used.
- - **No automatic extra spend:** Many API-backed skills instruct the agent not to retry with changed parameters or fetch additional pages without approval.
- - **Marketplace differences:** Supported countries, domains, languages, currencies, and available fields vary by skill.
- - **Image workflows:** Image-search and image-analysis skills may require an accessible image URL or the included upload helper.
- - **Readiness is not visibility:** `ecommerce-geo-score-check` evaluates crawlable SEO/GEO readiness. It does not measure live AI mentions.
- - **Time-bound AI results:** `ecommerce-product-ai-visibility` evaluates current AI responses; results can change as models and source content change.
- ---
- ## Troubleshooting
- ### Missing credentials
- ```text
- NEXSCOPE_PROXY_BASE and NEXSCOPE_API_KEY are required
- ```
- Set both environment variables in the same shell or runtime that launches the skill.
- ### Authentication or credit errors
- Confirm that the API key is valid and that the account has enough credits for the requested call. Manage access on the [Nexscope API Keys page](https://www.nexscope.ai/seller/api-access?co-from=githubNS).
- ### Skill not detected
- - Copy the complete `ecommerce-*` directory into the correct skills location.
- - Keep the folder name unchanged.
- - Restart or reload the agent if it discovers skills only at startup.
- - Read the agent-specific [setup guide](https://www.nexscope.ai/help/skills-external-access?co-from=githubNS).
- ### Request or response details
- Read the selected skill's `references/api.md` and script usage section. Parameters and supported marketplaces differ between skills.
- ---
- ## License
- These skills are proprietary software owned by Nexscope. API-backed usage requires valid Nexscope access and may consume credits.
- © 2026 Nexscope AI
- ---
- Built by **[Nexscope](https://www.nexscope.ai/?co-from=githubNS)** — an ecommerce data and creative platform for marketplace research, online image and video generation, and developer integrations.
ecommerce-amazon-product-research-api/scripts/onboarding.py · Bundled script · 598 lines · 1 finding marked
- #!/usr/bin/env python3
- """Provider-neutral implementation documentation."""
- from __future__ import annotations
- import sys as _nexscope_help_sys
- if "--help" in _nexscope_help_sys.argv or "-h" in _nexscope_help_sys.argv:
- print('Usage: python onboarding.py [arguments]')
- raise SystemExit(0)
- import argparse
- import base64
- import io
- import json
- import os
- import re
- import secrets
- import sys
- import tempfile
- import time
- import urllib.error
- from urllib.request import urlopen, Request
- # Windows implementation GBK,reconfigure implementation QR ASCII implementation。
- for _s in (sys.stdout, sys.stderr):
- if hasattr(_s, "reconfigure"):
- try:
- _s.reconfigure(encoding="utf-8")
- except Exception:
- pass
- try:
- import requests
- except ImportError:
- requests = None # implementation/agent-user implementation
- TAG = "[real]"
- UA = ("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
- "(KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36")
- # implementation uid header(implementation)
- _LOGIN_FIXED_UID = (os.environ.get("NEXSCOPE_LOGIN_FIXED_UID")
- or "eyJhX2lkIjoiNmEyMmM4YjA1YmM5MTZhIiwiZF9pZCI6IiJ9")
- Note: Contains a long base64-looking blob — not necessarily malicious, but worth inspecting what it decodes to
- Line 43 on GitHub
- AGREEMENTS = {
- "user_agreement": "",
- "service_agreement": "",
- "privacy_policy": "",
- }
- PAY_METHOD_MAP = {"wechat": "WX_PAY", "alipay": "ALI_PAY"}
- _ORDER_STATE_MAP = {
- "wait_pay": "unpaid", "paid": "paid", "finished": "paid",
- "expire": "expired", "expired": "expired",
- "cancel": "cancelled", "cancelled": "cancelled",
- }
- # ============================================================
- # Env / implementation
- # ============================================================
- def _env_base(name: str, default: str, *fallbacks: str) -> str:
- for n in (name, *fallbacks):
- v = os.environ.get(n)
- if v:
- return v.rstrip("/")
- return default.rstrip("/")
- def _agent_base() -> str:
- return _env_base("NEXSCOPE_AGENT_API_BASE", "")
- def _login_base() -> str:
- return _env_base("NEXSCOPE_LOGIN_API_BASE", "")
- def _agent_user_base() -> str:
- return _env_base("NEXSCOPE_AGENT_USER_API_BASE", "")
- def _api_key() -> str:
- return os.environ.get("NEXSCOPE_API_KEY") or os.environ.get("NEXSCOPE_API_KEY") or ""
- def _mask_phone(phone: str) -> str:
- return f"{phone[:3]}****{phone[-4:]}" if len(phone) >= 7 else phone
- def _b64url_json(part: str) -> dict:
- """base64url value JWT value(value padding),value dict。"""
- try:
- return json.loads(base64.urlsafe_b64decode(part + "=" * (-len(part) % 4)))
- except Exception:
- return {}
- def _uid_header(access_token: str, user_id: str) -> str:
- """base64url({"a_id":<JWT header.a>,"d_id":<userId>})。"""
- parts = (access_token or "").split(".")
- hdr = _b64url_json(parts[1]) if len(parts) >= 2 else {}
- raw = json.dumps({"a_id": hdr.get("a", ""), "d_id": str(user_id)}, separators=(",", ":")).encode()
- return base64.urlsafe_b64encode(raw).decode()
- def _jwt_uid() -> dict:
- """value NEXSCOPE_API_KEY value JWT payload value。value dict。"""
- parts = _api_key().split(".")
- return _b64url_json(parts[1]) if len(parts) >= 2 else {}
- # ============================================================
- # implementation + implementation
- # ============================================================
- _SESSION_ROOT: str | None = None
- def _nexscope_root() -> str:
- global _SESSION_ROOT
- if _SESSION_ROOT:
- return _SESSION_ROOT
- candidates = []
- acpx = (os.environ.get("NEXSCOPE_WORKSPACES") or "").strip().split(os.pathsep)[0].strip()
- if acpx:
- candidates.append(os.path.join(acpx, "nexscope"))
- candidates += [
- os.path.join(os.getcwd(), "nexscope"),
- os.path.join(os.path.expanduser("~"), "nexscope"),
- os.path.join(tempfile.gettempdir(), "nexscope"),
- ]
- for root in candidates:
- try:
- os.makedirs(root, exist_ok=True)
- probe = os.path.join(root, ".write_probe")
- with open(probe, "w", encoding="utf-8"):
- pass
- os.remove(probe)
- _SESSION_ROOT = os.path.abspath(root)
- return _SESSION_ROOT
- except OSError:
- continue
- _SESSION_ROOT = os.path.abspath(candidates[-1])
- return _SESSION_ROOT
- def session_dir() -> str:
- ts = time.time()
- sid = (os.environ.get("SESSION_ID") or "").strip() or (
- time.strftime("%H%M%S", time.localtime(ts)) + "-" + secrets.token_hex(3))
- path = os.path.join(_nexscope_root(), time.strftime("%Y-%m-%d", time.localtime(ts)), sid)
- os.makedirs(path, exist_ok=True)
- return path
- def render_qr(content: str, out_dir: str) -> dict:
- try:
- import qrcode
- except ImportError:
- err = "missing qrcode value,value: pip install qrcode pillow"
- print(f"{TAG} render_qr: {err}", file=sys.stderr)
- return {"png_path": None, "ascii_qr": None, "error": err}
- os.makedirs(out_dir, exist_ok=True)
- png_path = os.path.join(out_dir, f"qr-{int(time.time() * 1_000_000)}.png")
- qr = qrcode.QRCode(border=1)
- qr.add_data(content)
- qr.make(fit=True)
- qr.make_image(fill_color="black", back_color="white").save(png_path)
- buf = io.StringIO()
- qr.print_ascii(out=buf, invert=True)
- return {"png_path": png_path, "ascii_qr": buf.getvalue()}
- # ============================================================
- # HTTP:requests implementation/agent-user implementation,urllib implementation
- # ============================================================
- def _require_requests() -> None:
- if requests is None:
- raise RuntimeError("missing requests value,value: pip install requests")
- def _http_post(url: str, body: dict, headers: dict, timeout: int = 30) -> dict:
- """value requests POST,value JSON value {_error, _body}。"""
- try:
- _require_requests()
- except RuntimeError as e:
- return {"_error": str(e)}
- try:
- r = requests.post(url, json=body or {}, headers=headers, timeout=timeout)
- return r.json()
- except Exception as e:
- body_text = ""
- resp = getattr(e, "response", None)
- if resp is not None:
- try:
- body_text = resp.text[:500]
- except Exception:
- pass
- return {"_error": str(e), "_body": body_text}
- def _headers(source: str, origin_host: str, *, access_token: str = "",
- user_id: str = "", group_id: str = "") -> dict:
- """value headers;access_token value authorization+uid。"""
- h = {
- "Accept": "application/json, text/plain, */*",
- "Content-Type": "application/json;charset=UTF-8",
- "Origin": f"https://{origin_host}",
- "Referer": f"https://{origin_host}/",
- "source": source,
- "User-Agent": UA,
- }
- if access_token:
- h["authorization"] = access_token
- h["uid"] = _uid_header(access_token, user_id) if user_id else _LOGIN_FIXED_UID
- if group_id:
- h["tid"] = group_id
- return h
- def _login_post(path: str, body: dict) -> dict:
- return _http_post(f"{_login_base()}{path}", body,
- _headers("ai-nexscope-web", "ai.nexscope.com", access_token=""))
- def _gateway(method: str, path: str, body: dict | None = None) -> dict:
- """value HTTP。401/402/403 value,5xx value 3 value。"""
- url = f"{_agent_base()}{path}"
- body_bytes = json.dumps(body or {}).encode() if method == "POST" else None
- last_exc: Exception = RuntimeError("unknownError")
- for attempt in range(3):
- if attempt:
- time.sleep(1 << (attempt - 1))
- headers = {"Authorization": _api_key()}
- if method == "POST":
- headers["Content-Type"] = "application/json"
- req = Request(url, method=method, data=body_bytes, headers=headers)
- try:
- with urlopen(req, timeout=30) as resp:
- return json.loads(resp.read().decode())
- except urllib.error.HTTPError as e:
- status = e.code
- raw = e.read().decode()[:300]
- if status == 401:
- raise RuntimeError(f"text(401),text NEXSCOPE_API_KEY text NEXSCOPE_API_KEY:{raw}")
- if status == 402:
- raise RuntimeError(f"text(402),text:{raw}")
- if status == 403:
- raise RuntimeError(f"text(403):{raw}")
- last_exc = RuntimeError(f"HTTP {status}: {raw}")
- if status not in (408, 429, 500, 502, 503, 504):
- raise last_exc
- except Exception as e:
- last_exc = RuntimeError(f"text: {e}")
- print(f"{TAG} gateway_{method.lower()} attempt {attempt+1}/3 text: {e}", file=sys.stderr)
- raise last_exc
- # ============================================================
- # implementation:implementation / implementation / implementation
- # ============================================================
- def _check_biz(resp: dict, tag: str) -> dict:
- if resp.get("errcode") not in (None, 200):
- raise RuntimeError(f"{tag} textError: {resp}")
- return resp
- def fetch_user_info() -> dict:
- return _check_biz(_gateway("GET", "/account/currentByAPI"), "currentByAPI")
- def fetch_packages(package_type: int) -> list:
- resp = _check_biz(_gateway("POST", "/package/getByTypeByAPI", {"packageType": package_type}),
- "getByTypeByAPI")
- return resp.get("packageList") or []
- def normalize_package(p: dict) -> dict | None:
- """value(price=0)value None value。"""
- if float(p.get("packagePrice", 0) or 0) == 0:
- return None
- try:
- ext = json.loads(p.get("extJson") or "{}")
- except Exception:
- ext = {}
- return {
- "plan_id": p.get("packageId", ""),
- "name": p.get("packageName", ""),
- "price": p.get("packagePrice", 0),
- "price_string": p.get("packagePriceString", ""),
- "original_price": p.get("originalPrice", 0),
- "original_price_string": p.get("originalPriceString", ""),
- "currency": "CNY",
- "credits": p.get("creditAmount", 0),
- "validity_period": p.get("validityPeriod", ""),
- "validity_period_type": p.get("validityPeriodType", ""),
- "description": p.get("description", ""),
- "is_recommend": bool(ext.get("isRecommend", False)),
- "logo_url": ext.get("logo", ""),
- "features": ext.get("features", []),
- "available_methods": ["wechat", "alipay"],
- }
- def create_order(plan_id: str, method: str) -> dict:
- if method not in PAY_METHOD_MAP:
- raise ValueError(f"text {method},text wechat/alipay")
- user = fetch_user_info()
- is_team = bool(user.get("isTeamUser"))
- member_id = _jwt_uid().get("uid", "")
- if not member_id:
- raise RuntimeError("value JWT value uid,value NEXSCOPE_API_KEY value NEXSCOPE_API_KEY")
- body = {
- "packageId": plan_id, "payType": PAY_METHOD_MAP[method], "payDeviceType": "PC",
- "memberId": member_id, "groupId": user.get("currentGroupId", ""),
- }
- path = "/order/createTeamOrderByAPI" if is_team else "/order/createByAPI"
- print(f"{TAG} text path={path} isTeamUser={is_team} groupId={body['groupId']}", file=sys.stderr)
- resp = _check_biz(_gateway("POST", path, body), "value")
- return {
- "order_id": resp.get("orderId", ""),
- "qr_content": resp.get("payQrcode") or resp.get("payUrl", ""),
- "pay_url": resp.get("payUrl", ""),
- "pay_price": resp.get("payPrice", ""),
- "original_price": resp.get("originalPrice", ""),
- "discount_price": resp.get("discountPrice", ""),
- "state": resp.get("state", ""),
- "time_left": resp.get("timeLeft", 0),
- "expire_date": resp.get("expireDate", ""),
- "trade_no": resp.get("tradeNo", ""),
- "product": resp.get("product", ""),
- "pay_type": resp.get("payType", ""),
- }
- def query_order(order_id: str) -> dict:
- resp = _check_biz(_gateway("POST", "/order/getByAPI", {"orderId": order_id}), "value")
- state = resp.get("state", "")
- return {
- "order_id": order_id,
- "status": _ORDER_STATE_MAP.get(state, "unknown"),
- "state": state,
- "paid_at": resp.get("payDate") or None,
- "pay_price": resp.get("payPrice", ""),
- "time_left": resp.get("timeLeft", 0),
- "expire_date": resp.get("expireDate", ""),
- "trade_no": resp.get("tradeNo", ""),
- "product": resp.get("product", ""),
- }
- # ============================================================
- # implementation + implementation key
- # ============================================================
- def send_verify_code(phone: str) -> dict:
- masked = _mask_phone(phone)
- if not re.fullmatch(r"\d{11}", phone):
- return {"sent": False, "phone": masked, "errmsg": f"text(text 11 text): {phone}"}
- resp = _login_post("/user/v1/web/login", {
- "type": "sms", "method": "getVerifyCode",
- "data": {"authPhone": phone, "areaCode": "+86", "clientChannel": "NexscopeAgent"},
- })
- if "_error" in resp:
- return {"sent": False, "phone": masked, "errmsg": resp.get("_body") or resp["_error"]}
- if resp.get("success") or resp.get("code") == "OK":
- return {"sent": True, "phone": masked, "area_code": "+86", "agreements": AGREEMENTS}
- return {"sent": False, "phone": masked, "errmsg": resp.get("message") or json.dumps(resp, ensure_ascii=False)}
- def _login_v3(phone: str, code: str, channel: str) -> dict:
- resp = _login_post("/user/v3/web/login", {
- "type": "sms", "method": "login", "systemId": "NexscopeAgent",
- "data": {"areaCode": "+86", "authPhone": phone, "authCode": code,
- "sourceChannel": channel or "skill"},
- })
- if "_error" in resp:
- return {"error": f"login: {resp.get('_body') or resp['_error']}"}
- if not (resp.get("success") or resp.get("code") == "OK"):
- return {"error": f"login: {resp.get('message') or json.dumps(resp, ensure_ascii=False)}"}
- data = resp.get("data") or {}
- access_token, user_id = data.get("accessToken"), data.get("userId")
- if not access_token or not user_id:
- return {"error": f"login: text accessToken/userId: {json.dumps(resp, ensure_ascii=False)}"}
- return {
- "access_token": access_token,
- "refresh_token": data.get("refreshToken", "") or "",
- "user_id": str(user_id),
- "nick_name": data.get("userName", ""),
- "is_new_user": bool(data.get("newUser") or data.get("isFirstRegister")),
- }
- def _login_by_token(access_token: str, refresh_token: str) -> dict:
- """value。value。"""
- resp = _http_post(f"{_agent_user_base()}/account/loginByToken", {
- "token": access_token, "refreshToken": refresh_token,
- "device": {"aid": "3026344186", "did": "", "type": "Windows",
- "os": "10", "model": "149.0.0.0", "brand": "Chrome"},
- }, _headers("agent-nexscope-web", "agent.nexscope.com", access_token=access_token))
- if "_error" in resp:
- return {"error": f"loginByToken: {resp.get('_body') or resp['_error']}"}
- if resp.get("errcode") != 200:
- return {"error": f"loginByToken: {resp.get('errmsg') or json.dumps(resp, ensure_ascii=False)}"}
- print(f"{TAG} loginByToken text,text", file=sys.stderr)
- return {}
- def _fetch_user_info_v3(access_token: str, user_id: str) -> dict:
- """value userInfo value group_id / member_id。"""
- resp = _http_post(f"{_login_base()}/nexscopeApp/api/userCenter/userInfo", {},
- _headers("agent-nexscope-web", "agent.nexscope.com",
- access_token=access_token, user_id=user_id))
- if "_error" in resp:
- return {"error": f"userInfo: {resp.get('_body') or resp['_error']}"}
- if resp.get("code") != "OK":
- return {"error": f"userInfo: {resp.get('message') or json.dumps(resp, ensure_ascii=False)}"}
- teams = (resp.get("data") or {}).get("teamList") or []
- if not teams:
- return {"error": "userInfo: value,value value"}
- selected = (next((t for t in teams if t.get("isSelect") == 1 and t.get("agentTeamId")), None)
- or next((t for t in teams if t.get("agentTeamId")), None))
- if not selected:
- return {"error": "userInfo: value agent value,value value"}
- gid, mid = selected.get("agentTeamId"), selected.get("agentMemberId")
- if not gid or not mid:
- return {"error": f"userInfo: text agentTeamId/agentMemberId: {json.dumps(selected, ensure_ascii=False)}"}
- return {"group_id": str(gid), "member_id": str(mid), "team_name": selected.get("teamName", "")}
- _TOKEN_KEYS = ("token", "apiToken", "api_token", "apiKey", "api_key")
- def _extract_token(resp: dict) -> str:
- if not isinstance(resp, dict):
- return ""
- for src in (resp, resp.get("data") if isinstance(resp.get("data"), dict) else {}):
- for k in _TOKEN_KEYS:
- v = src.get(k)
- if isinstance(v, str) and v:
- return v
- d = resp.get("data")
- return d if isinstance(d, str) and d else ""
- def _get_or_generate_api_token(access_token: str, user_id: str, group_id: str) -> dict:
- hdr = _headers("agent-nexscope-web", "ai.nexscope.com",
- access_token=access_token, user_id=user_id, group_id=group_id)
- for path, source in (("/group/getApiToken", "existing"),
- ("/group/generateApiToken", "generated")):
- resp = _http_post(f"{_agent_user_base()}{path}", {"id": group_id}, hdr)
- if "_error" in resp:
- return {"error": f"{path.rsplit('/', 1)[-1]}: {resp.get('_body') or resp['_error']}"}
- tok = _extract_token(resp)
- if tok:
- return {"api_key": tok, "source": source}
- return {"error": f"generateApiToken: text token,text: {json.dumps(resp, ensure_ascii=False)}"}
- def login_and_get_key(phone: str, code: str, channel: str) -> dict:
- masked = _mask_phone(phone)
- if not re.fullmatch(r"\d{11}", phone):
- return {"error": f"login: text: {phone}", "phone": masked}
- if not re.fullmatch(r"\d{4,8}", code):
- return {"error": f"login: text: {code}", "phone": masked}
- lg = _login_v3(phone, code, channel)
- if "error" in lg:
- return {"error": lg["error"], "phone": masked}
- if lg.get("is_new_user"):
- lbt = _login_by_token(lg["access_token"], lg["refresh_token"])
- if "error" in lbt:
- print(f"{TAG} {lbt['error']}(text key)", file=sys.stderr)
- info = _fetch_user_info_v3(lg["access_token"], lg["user_id"])
- if "error" in info:
- return {"error": info["error"], "phone": masked}
- tok = _get_or_generate_api_token(lg["access_token"], lg["user_id"], info["group_id"])
- if "error" in tok:
- return {"error": tok["error"], "phone": masked}
- return {
- "api_key": tok["api_key"], "phone": masked,
- "group_id": info["group_id"], "member_id": info["member_id"],
- "source": tok["source"], "nick_name": lg.get("nick_name", ""),
- "team_name": info.get("team_name", ""),
- "is_new_user": lg.get("is_new_user", False),
- }
- # ============================================================
- # argparse implementation
- # ============================================================
- def _emit(obj: dict) -> None:
- print(json.dumps(obj, ensure_ascii=False, indent=2))
- def _cmd_send_code(args) -> int:
- r = send_verify_code(args.phone.strip())
- _emit(r)
- if r.get("sent"):
- print(f"{TAG} text {r['phone']}", file=sys.stderr)
- return 0 if r.get("sent") else 1
- def _cmd_login(args) -> int:
- r = login_and_get_key(args.phone.strip(), args.code.strip(), args.channel)
- _emit(r)
- if "api_key" in r:
- print(f"{TAG} text API key(text: {r['source']})", file=sys.stderr)
- return 0
- return 1
- def _cmd_list_plans(args) -> int:
- try:
- payload = _jwt_uid()
- if payload:
- print(f"{TAG} JWT uid={payload.get('uid')} name={payload.get('name')}", file=sys.stderr)
- user = fetch_user_info()
- is_team = bool(user.get("isTeamUser"))
- nick = user.get("nickName", "")
- print(f"{TAG} text {nick} isTeamUser={is_team}", file=sys.stderr)
- pkgs = fetch_packages(7 if is_team else 1)
- plans = [n for n in (normalize_package(p) for p in pkgs) if n is not None]
- _emit({"plans": plans, "user": {"nickName": nick, "isTeamUser": is_team}})
- return 0
- except RuntimeError as e:
- _emit({"error": True, "message": str(e)})
- return 1
- def _cmd_order(args) -> int:
- try:
- pkgs = fetch_packages(7 if bool(fetch_user_info().get("isTeamUser")) else 1)
- match = next((n for n in (normalize_package(p) for p in pkgs)
- if n and n["plan_id"] == args.plan_id), None)
- if match is None:
- _emit({"error": True, "message": f"unknowntext plan_id={args.plan_id}"})
- return 1
- if args.method not in match.get("available_methods", []):
- _emit({"error": True,
- "message": f"text {args.plan_id} text {args.method},text {match['available_methods']}"})
- return 1
- order = create_order(args.plan_id, args.method)
- except (RuntimeError, ValueError) as e:
- _emit({"error": True, "message": str(e)})
- return 1
- qr = render_qr(order["qr_content"], session_dir())
- order["png_path"] = qr.get("png_path")
- order["ascii_qr"] = qr.get("ascii_qr")
- if qr.get("error"):
- order["qr_render_error"] = qr["error"]
- _emit(order)
- return 0
- def _cmd_query(args) -> int:
- try:
- _emit(query_order(args.order_id))
- return 0
- except RuntimeError as e:
- _emit({"error": True, "message": str(e)})
- return 1
- def main(argv: list[str] | None = None) -> int:
- parser = argparse.ArgumentParser(prog="onboarding", description="Nexscope value CLI")
- sub = parser.add_subparsers(dest="cmd", required=True)
- p = sub.add_parser("send-code", help="value")
- p.add_argument("phone", help="11 value")
- p.set_defaults(func=_cmd_send_code)
- p = sub.add_parser("login", help="value API key")
- p.add_argument("phone")
- p.add_argument("code", help="value")
- p.add_argument("--channel", default="skill",
- help="value,value skill;workbuddy value workbuddy")
- p.set_defaults(func=_cmd_login)
- sub.add_parser("list-plans", help="value").set_defaults(func=_cmd_list_plans)
- p = sub.add_parser("order", help="value")
- p.add_argument("plan_id")
- p.add_argument("method", choices=["wechat", "alipay"])
- p.set_defaults(func=_cmd_order)
- p = sub.add_parser("query", help="value")
- p.add_argument("order_id")
- p.set_defaults(func=_cmd_query)
- args = parser.parse_args(argv)
- return args.func(args)
- if __name__ == "__main__":
- sys.exit(main())
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.