tool4seller-cli 1.0.2__tar.gz → 1.2.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.
- tool4seller_cli-1.2.0/PKG-INFO +238 -0
- tool4seller_cli-1.2.0/README.md +221 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/pyproject.toml +9 -2
- tool4seller_cli-1.2.0/src/tool4seller_cli/__init__.py +1 -0
- tool4seller_cli-1.2.0/src/tool4seller_cli/auth/__init__.py +1 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/src/tool4seller_cli/auth/login.py +14 -2
- tool4seller_cli-1.2.0/src/tool4seller_cli/cli.py +1331 -0
- tool4seller_cli-1.2.0/src/tool4seller_cli/data/openapi-v2.bundled.json +1 -0
- tool4seller_cli-1.2.0/src/tool4seller_cli/data/openapi-v2.ite-extensions.json +1 -0
- tool4seller_cli-1.2.0/src/tool4seller_cli/data/operation-policies.json +532 -0
- tool4seller_cli-1.2.0/src/tool4seller_cli/dynamic.py +155 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/src/tool4seller_cli/http_client.py +70 -11
- tool4seller_cli-1.2.0/src/tool4seller_cli/schema/policy.py +46 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/src/tool4seller_cli/schema/registry.py +61 -4
- tool4seller_cli-1.2.0/src/tool4seller_cli/schema/validation.py +499 -0
- tool4seller_cli-1.2.0/src/tool4seller_cli/skills/__init__.py +1 -0
- tool4seller_cli-1.2.0/src/tool4seller_cli/skills/tool4seller-account/SKILL.md +35 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/src/tool4seller_cli/skills/tool4seller-advertising/SKILL.md +27 -3
- tool4seller_cli-1.2.0/src/tool4seller_cli/skills/tool4seller-advertising-management/SKILL.md +106 -0
- tool4seller_cli-1.2.0/src/tool4seller_cli/skills/tool4seller-asin-search-terms/SKILL.md +36 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/src/tool4seller_cli/skills/tool4seller-inventory/SKILL.md +2 -2
- tool4seller_cli-1.2.0/src/tool4seller_cli/skills/tool4seller-keyword-rankings/SKILL.md +75 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/src/tool4seller_cli/skills/tool4seller-profit/SKILL.md +2 -2
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/src/tool4seller_cli/skills/tool4seller-sales/SKILL.md +7 -2
- tool4seller_cli-1.2.0/src/tool4seller_cli/skills/tool4seller-shared/SKILL.md +214 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/src/tool4seller_cli/skills/tool4seller-stores/SKILL.md +8 -2
- tool4seller_cli-1.2.0/src/tool4seller_cli/skills/tool4seller-top-search-terms/SKILL.md +51 -0
- tool4seller_cli-1.2.0/src/tool4seller_cli/skills_installer.py +186 -0
- tool4seller_cli-1.2.0/src/tool4seller_cli/write_safety.py +306 -0
- tool4seller_cli-1.2.0/src/tool4seller_cli.egg-info/PKG-INFO +238 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/src/tool4seller_cli.egg-info/SOURCES.txt +17 -1
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/src/tool4seller_cli.egg-info/requires.txt +1 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/tests/test_auth_login.py +58 -1
- tool4seller_cli-1.2.0/tests/test_cli_api.py +508 -0
- tool4seller_cli-1.2.0/tests/test_cli_asin_search_terms.py +108 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/tests/test_cli_auth.py +10 -6
- tool4seller_cli-1.2.0/tests/test_cli_campaigns.py +375 -0
- tool4seller_cli-1.2.0/tests/test_cli_core.py +230 -0
- tool4seller_cli-1.2.0/tests/test_cli_dynamic.py +319 -0
- tool4seller_cli-1.2.0/tests/test_cli_keyword_rankings.py +374 -0
- tool4seller_cli-1.2.0/tests/test_cli_schema.py +83 -0
- tool4seller_cli-1.2.0/tests/test_cli_top_search_terms.py +178 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/tests/test_http_client.py +63 -0
- tool4seller_cli-1.2.0/tests/test_openapi_refresh.py +249 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/tests/test_release_scripts.py +12 -0
- tool4seller_cli-1.2.0/tests/test_schema_registry.py +493 -0
- tool4seller_cli-1.2.0/tests/test_skills_installer.py +593 -0
- tool4seller_cli-1.2.0/tests/test_write_safety.py +373 -0
- tool4seller_cli-1.0.2/PKG-INFO +0 -81
- tool4seller_cli-1.0.2/README.md +0 -67
- tool4seller_cli-1.0.2/src/tool4seller_cli/__init__.py +0 -1
- tool4seller_cli-1.0.2/src/tool4seller_cli/auth/__init__.py +0 -1
- tool4seller_cli-1.0.2/src/tool4seller_cli/cli.py +0 -521
- tool4seller_cli-1.0.2/src/tool4seller_cli/data/openapi-v2.bundled.json +0 -1
- tool4seller_cli-1.0.2/src/tool4seller_cli/dynamic.py +0 -71
- tool4seller_cli-1.0.2/src/tool4seller_cli/skills/__init__.py +0 -1
- tool4seller_cli-1.0.2/src/tool4seller_cli/skills/tool4seller-shared/SKILL.md +0 -149
- tool4seller_cli-1.0.2/src/tool4seller_cli/skills_installer.py +0 -99
- tool4seller_cli-1.0.2/src/tool4seller_cli.egg-info/PKG-INFO +0 -81
- tool4seller_cli-1.0.2/tests/test_cli_api.py +0 -178
- tool4seller_cli-1.0.2/tests/test_cli_core.py +0 -138
- tool4seller_cli-1.0.2/tests/test_cli_dynamic.py +0 -133
- tool4seller_cli-1.0.2/tests/test_cli_schema.py +0 -42
- tool4seller_cli-1.0.2/tests/test_schema_registry.py +0 -136
- tool4seller_cli-1.0.2/tests/test_skills_installer.py +0 -360
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/setup.cfg +0 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/src/tool4seller_cli/auth/oauth.py +0 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/src/tool4seller_cli/auth/pkce.py +0 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/src/tool4seller_cli/auth/token_store.py +0 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/src/tool4seller_cli/config.py +0 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/src/tool4seller_cli/output.py +0 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/src/tool4seller_cli/schema/__init__.py +0 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/src/tool4seller_cli/schema/normalize.py +0 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/src/tool4seller_cli.egg-info/dependency_links.txt +0 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/src/tool4seller_cli.egg-info/entry_points.txt +0 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/src/tool4seller_cli.egg-info/top_level.txt +0 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/tests/test_auth_oauth.py +0 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/tests/test_config.py +0 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/tests/test_dynamic.py +0 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/tests/test_output.py +0 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/tests/test_package_metadata.py +0 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/tests/test_schema_normalize.py +0 -0
- {tool4seller_cli-1.0.2 → tool4seller_cli-1.2.0}/tests/test_token_store.py +0 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tool4seller-cli
|
|
3
|
+
Version: 1.2.0
|
|
4
|
+
Summary: Tool4Seller CLI for sales, advertising, market analysis, keyword rankings, inventory, account usage, and profit workflows
|
|
5
|
+
Project-URL: Homepage, https://www.tool4seller.com/
|
|
6
|
+
Project-URL: API Documentation, https://das-server.tool4seller.com/api/v3/api-docs/v2
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Requires-Dist: typer>=0.12
|
|
10
|
+
Requires-Dist: rich>=13.0
|
|
11
|
+
Requires-Dist: requests>=2.28
|
|
12
|
+
Requires-Dist: packaging>=23.0
|
|
13
|
+
Provides-Extra: dev
|
|
14
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
15
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
16
|
+
Requires-Dist: twine>=5.0; extra == "dev"
|
|
17
|
+
|
|
18
|
+
# Tool4seller CLI
|
|
19
|
+
|
|
20
|
+
Official Python CLI for Tool4seller sales, orders, advertising, market analysis, keyword rankings, inventory, account usage, and profit workflows. It combines OAuth authentication, an OpenAPI-driven command surface, packaged AI-agent skills, and guarded writes.
|
|
21
|
+
|
|
22
|
+
## Highlights
|
|
23
|
+
|
|
24
|
+
- Query sales, profit, inventory, inventory alerts, inbound shipments, reviews, and sales traffic.
|
|
25
|
+
- Inspect order details and current refund-flagged order status.
|
|
26
|
+
- Query package usage, limits, and remaining capacity.
|
|
27
|
+
- Query Amazon Brand Analytics Top Search Terms reports and weekly trends.
|
|
28
|
+
- Inspect an ASIN's natural search terms, natural rank, ABA enrichment, and variation availability.
|
|
29
|
+
- List and manage keyword-rank trackers, trends, and associated competitors.
|
|
30
|
+
- Analyze advertising performance by store, campaign, SKU, ASIN, search term, keyword target, and product target.
|
|
31
|
+
- Search campaigns and targets with attribute and aggregated metric filters.
|
|
32
|
+
- Retrieve Amazon target and bid recommendations for Sponsored Products, Sponsored Brands, and Sponsored Display.
|
|
33
|
+
- List, create, and update campaigns, ad groups, ads, keywords, negative keywords, product targets, and negative targets.
|
|
34
|
+
- Inspect every request contract from the bundled Tool4seller OpenAPI schema.
|
|
35
|
+
- Install workflow skills for Codex, Claude, WorkBuddy, Agents, and Doubao.
|
|
36
|
+
- Protect every state-changing request with validation and an exact one-time confirmation.
|
|
37
|
+
|
|
38
|
+
## Install
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pip install tool4seller-cli
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## First-Time Setup
|
|
45
|
+
|
|
46
|
+
After installation, install the packaged skills into your assistant environment:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
tool4seller skills install
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Then authenticate again:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
tool4seller auth login
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
After authentication succeeds, you can ask sales, advertising, inventory, and profit questions such as:
|
|
59
|
+
|
|
60
|
+
- "Show me yesterday's sales."
|
|
61
|
+
- "Analyze advertising ACOS for the last 7 days."
|
|
62
|
+
- "Find high-spend campaigns with no orders."
|
|
63
|
+
- "Get Amazon bid recommendations for these targets."
|
|
64
|
+
- "Create a Sponsored Products campaign."
|
|
65
|
+
- "Find low-stock SKUs."
|
|
66
|
+
- "Show my remaining keyword tracking quota."
|
|
67
|
+
- "List tracked keyword rankings and recent trends."
|
|
68
|
+
|
|
69
|
+
## Usage
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
tool4seller --version
|
|
73
|
+
tool4seller version --check
|
|
74
|
+
tool4seller auth login
|
|
75
|
+
tool4seller auth status
|
|
76
|
+
tool4seller schema list
|
|
77
|
+
tool4seller schema show sales.list-sales
|
|
78
|
+
tool4seller sales list-sales --start-date 2026-06-01 --end-date 2026-06-07
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Production is the default API environment. Use the named test environment only for explicit ITE testing:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
tool4seller --env test auth login
|
|
85
|
+
tool4seller --env test campaigns list --store-id SELLER:MARKETPLACE
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Account, Orders, Keyword Rankings, and Market Analysis
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
tool4seller account list-usages \
|
|
92
|
+
--resources KEYWORD_RANK_TRACKING_KEYWORDS
|
|
93
|
+
|
|
94
|
+
tool4seller sales list-orders \
|
|
95
|
+
--store-id SELLER:MARKETPLACE \
|
|
96
|
+
--start-at 2026-09-01T00:00:00Z \
|
|
97
|
+
--end-at 2026-09-02T00:00:00Z
|
|
98
|
+
|
|
99
|
+
tool4seller keyword-rankings list-trackers \
|
|
100
|
+
--product-type OWN_PRODUCT \
|
|
101
|
+
--tracking-scope PARENT
|
|
102
|
+
|
|
103
|
+
tool4seller keyword-rankings list-trends \
|
|
104
|
+
--store-id SELLER:MARKETPLACE \
|
|
105
|
+
--parent-asin B012345678 \
|
|
106
|
+
--keywords '["coffee mug"]' \
|
|
107
|
+
--start-date 2026-09-01 \
|
|
108
|
+
--end-date 2026-09-07
|
|
109
|
+
|
|
110
|
+
tool4seller top-search-terms get-configuration \
|
|
111
|
+
--marketplace-id ATVPDKIKX0DER
|
|
112
|
+
|
|
113
|
+
tool4seller top-search-terms search-reports \
|
|
114
|
+
--data '{"marketplaceId":"ATVPDKIKX0DER","mode":"EXACT","searchTerms":["coffee mug"]}'
|
|
115
|
+
|
|
116
|
+
tool4seller top-search-terms search-trends \
|
|
117
|
+
--data '{"marketplaceId":"ATVPDKIKX0DER","window":"HISTORY","searchTerms":["coffee mug"]}'
|
|
118
|
+
|
|
119
|
+
tool4seller asin-search-terms get-variation \
|
|
120
|
+
--marketplace-id ATVPDKIKX0DER \
|
|
121
|
+
--asin B08N5WRWNW
|
|
122
|
+
|
|
123
|
+
tool4seller asin-search-terms list-terms \
|
|
124
|
+
--marketplace-id ATVPDKIKX0DER \
|
|
125
|
+
--asin B08N5WRWNW
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Keyword-rank additions, removals, resumes, and competitor replacements accept `--data` or `--data-file` and use the same one-time write-confirmation flow described below.
|
|
129
|
+
|
|
130
|
+
Top Search Terms searches are read-only POST operations and do not require write confirmation. `searchVolume` is weekly search volume; `supplyDemandRatio` expresses weekly searches per competing listing rather than a percentage.
|
|
131
|
+
|
|
132
|
+
ASIN search-term operations are read-only GET operations. Natural rank is distinct from ABA Search Frequency Rank; current-week ABA enrichment can be null when no weekly match is available.
|
|
133
|
+
|
|
134
|
+
`sales list-orders --statuses REFUND` filters orders by their current synchronized refund flag. Its UTC time range still filters order purchase time, not refund-event time; it is not a refund-event report.
|
|
135
|
+
|
|
136
|
+
## Advertising Search and Recommendations
|
|
137
|
+
|
|
138
|
+
Operations with an OpenAPI JSON request body accept either inline JSON or a UTF-8 JSON file:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
tool4seller advertising-targeting-performance search-keyword-targets \
|
|
142
|
+
--data '{"storeId":"SELLER:MARKETPLACE","startDate":"2026-08-01","endDate":"2026-08-07"}'
|
|
143
|
+
|
|
144
|
+
tool4seller advertising-targeting-performance search-asin-targets \
|
|
145
|
+
--data-file request.json
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Recommendation APIs are read-only POST operations and do not require write confirmation:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
tool4seller advertising-targeting-performance get-target-recommendations \
|
|
152
|
+
--data-file target-recommendation-request.json
|
|
153
|
+
|
|
154
|
+
tool4seller advertising-targeting-performance get-bid-recommendations \
|
|
155
|
+
--data-file bid-recommendation-request.json
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Inspect the exact nested filters and request fields before preparing a payload:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
tool4seller schema show advertising-campaign-performance.search-campaigns
|
|
162
|
+
tool4seller schema show advertising-targeting-performance.get-target-recommendations
|
|
163
|
+
tool4seller schema show advertising-targeting-performance.get-bid-recommendations
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Advertising Management
|
|
167
|
+
|
|
168
|
+
Stable resource commands keep management workflows readable:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
tool4seller campaigns list --store-id SELLER:MARKETPLACE
|
|
172
|
+
tool4seller campaigns create --data-file campaign-create.json
|
|
173
|
+
tool4seller campaigns update --data-file campaign-update.json
|
|
174
|
+
|
|
175
|
+
tool4seller ad-groups create --data-file ad-group-create.json
|
|
176
|
+
tool4seller ads create --data-file ad-create.json
|
|
177
|
+
tool4seller keywords create --data-file keyword-create.json
|
|
178
|
+
tool4seller targets update --data-file target-update.json
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Equivalent `list`, `create`, and `update` commands are exposed where supported for ad groups, ads, keywords, negative keywords, targets, and negative targets. Portfolios currently expose `list` only.
|
|
182
|
+
|
|
183
|
+
## Write Confirmation
|
|
184
|
+
|
|
185
|
+
Every state-changing API request requires an exact, one-time customer confirmation. For operations in the bundled schema, the first invocation validates the payload and returns `confirmation_required` with a change preview, payload fingerprint, and ten-minute one-time confirmation token without sending the write request. Unknown non-GET requests still fail closed as writes, but cannot receive schema validation.
|
|
186
|
+
|
|
187
|
+
After the customer reviews and explicitly confirms that exact preview, execute the unchanged command with the returned one-time confirmation token. Replace the placeholders below with the same method, path, and payload used for the preview:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
tool4seller api PATCH /api/v2/WRITE_PATH \
|
|
191
|
+
--data-file write-request.json \
|
|
192
|
+
--confirm-write confirm_<one-time-token>
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
The token is consumed before the network request and cannot be replayed. Changing the environment, path, parameters, or request body also invalidates it. Unknown non-GET requests fail closed as writes. A partially successful batch must be reviewed item by item and must not be retried as a complete batch.
|
|
196
|
+
|
|
197
|
+
If a confirmed write returns `write_outcome_unknown`, the server may have applied it before the response failed. Do not retry the request. Read the affected resources and reconcile every item first; for create operations that cannot be reconciled unambiguously, stop instead of risking duplicates.
|
|
198
|
+
|
|
199
|
+
## Agent Skills
|
|
200
|
+
|
|
201
|
+
Install the packaged Tool4seller skills into the Tool4seller-managed skill store:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
tool4seller skills install
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
By default, this installs the packaged skills under `~/.tool4seller/skills/` and links them into existing agent directories for Codex, Claude, WorkBuddy, Agents, and Doubao. Missing agent directories are not created by the default install.
|
|
208
|
+
|
|
209
|
+
Manage links explicitly:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
tool4seller skills link --agent doubao
|
|
213
|
+
tool4seller skills link --all
|
|
214
|
+
tool4seller skills unlink --agent claude
|
|
215
|
+
tool4seller skills unlink --all
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Install skills into the current project's `.skills/` directory:
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
tool4seller skills install --local
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
To install into a custom directory, use:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
tool4seller skills install --destination ~/.codex/skills
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Upgrade
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
tool4seller update
|
|
234
|
+
tool4seller update --yes --target-version <latestVersion>
|
|
235
|
+
pip install -U tool4seller-cli
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
`tool4seller update` checks the latest PyPI release and prints an upgrade command pinned to that exact version using the Python interpreter that runs the current CLI. After reviewing that version, pass it to `tool4seller update --yes --target-version <latestVersion>`. When the target version is already installed, the command performs no installation.
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# Tool4seller CLI
|
|
2
|
+
|
|
3
|
+
Official Python CLI for Tool4seller sales, orders, advertising, market analysis, keyword rankings, inventory, account usage, and profit workflows. It combines OAuth authentication, an OpenAPI-driven command surface, packaged AI-agent skills, and guarded writes.
|
|
4
|
+
|
|
5
|
+
## Highlights
|
|
6
|
+
|
|
7
|
+
- Query sales, profit, inventory, inventory alerts, inbound shipments, reviews, and sales traffic.
|
|
8
|
+
- Inspect order details and current refund-flagged order status.
|
|
9
|
+
- Query package usage, limits, and remaining capacity.
|
|
10
|
+
- Query Amazon Brand Analytics Top Search Terms reports and weekly trends.
|
|
11
|
+
- Inspect an ASIN's natural search terms, natural rank, ABA enrichment, and variation availability.
|
|
12
|
+
- List and manage keyword-rank trackers, trends, and associated competitors.
|
|
13
|
+
- Analyze advertising performance by store, campaign, SKU, ASIN, search term, keyword target, and product target.
|
|
14
|
+
- Search campaigns and targets with attribute and aggregated metric filters.
|
|
15
|
+
- Retrieve Amazon target and bid recommendations for Sponsored Products, Sponsored Brands, and Sponsored Display.
|
|
16
|
+
- List, create, and update campaigns, ad groups, ads, keywords, negative keywords, product targets, and negative targets.
|
|
17
|
+
- Inspect every request contract from the bundled Tool4seller OpenAPI schema.
|
|
18
|
+
- Install workflow skills for Codex, Claude, WorkBuddy, Agents, and Doubao.
|
|
19
|
+
- Protect every state-changing request with validation and an exact one-time confirmation.
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install tool4seller-cli
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## First-Time Setup
|
|
28
|
+
|
|
29
|
+
After installation, install the packaged skills into your assistant environment:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
tool4seller skills install
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Then authenticate again:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
tool4seller auth login
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
After authentication succeeds, you can ask sales, advertising, inventory, and profit questions such as:
|
|
42
|
+
|
|
43
|
+
- "Show me yesterday's sales."
|
|
44
|
+
- "Analyze advertising ACOS for the last 7 days."
|
|
45
|
+
- "Find high-spend campaigns with no orders."
|
|
46
|
+
- "Get Amazon bid recommendations for these targets."
|
|
47
|
+
- "Create a Sponsored Products campaign."
|
|
48
|
+
- "Find low-stock SKUs."
|
|
49
|
+
- "Show my remaining keyword tracking quota."
|
|
50
|
+
- "List tracked keyword rankings and recent trends."
|
|
51
|
+
|
|
52
|
+
## Usage
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
tool4seller --version
|
|
56
|
+
tool4seller version --check
|
|
57
|
+
tool4seller auth login
|
|
58
|
+
tool4seller auth status
|
|
59
|
+
tool4seller schema list
|
|
60
|
+
tool4seller schema show sales.list-sales
|
|
61
|
+
tool4seller sales list-sales --start-date 2026-06-01 --end-date 2026-06-07
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Production is the default API environment. Use the named test environment only for explicit ITE testing:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
tool4seller --env test auth login
|
|
68
|
+
tool4seller --env test campaigns list --store-id SELLER:MARKETPLACE
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Account, Orders, Keyword Rankings, and Market Analysis
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
tool4seller account list-usages \
|
|
75
|
+
--resources KEYWORD_RANK_TRACKING_KEYWORDS
|
|
76
|
+
|
|
77
|
+
tool4seller sales list-orders \
|
|
78
|
+
--store-id SELLER:MARKETPLACE \
|
|
79
|
+
--start-at 2026-09-01T00:00:00Z \
|
|
80
|
+
--end-at 2026-09-02T00:00:00Z
|
|
81
|
+
|
|
82
|
+
tool4seller keyword-rankings list-trackers \
|
|
83
|
+
--product-type OWN_PRODUCT \
|
|
84
|
+
--tracking-scope PARENT
|
|
85
|
+
|
|
86
|
+
tool4seller keyword-rankings list-trends \
|
|
87
|
+
--store-id SELLER:MARKETPLACE \
|
|
88
|
+
--parent-asin B012345678 \
|
|
89
|
+
--keywords '["coffee mug"]' \
|
|
90
|
+
--start-date 2026-09-01 \
|
|
91
|
+
--end-date 2026-09-07
|
|
92
|
+
|
|
93
|
+
tool4seller top-search-terms get-configuration \
|
|
94
|
+
--marketplace-id ATVPDKIKX0DER
|
|
95
|
+
|
|
96
|
+
tool4seller top-search-terms search-reports \
|
|
97
|
+
--data '{"marketplaceId":"ATVPDKIKX0DER","mode":"EXACT","searchTerms":["coffee mug"]}'
|
|
98
|
+
|
|
99
|
+
tool4seller top-search-terms search-trends \
|
|
100
|
+
--data '{"marketplaceId":"ATVPDKIKX0DER","window":"HISTORY","searchTerms":["coffee mug"]}'
|
|
101
|
+
|
|
102
|
+
tool4seller asin-search-terms get-variation \
|
|
103
|
+
--marketplace-id ATVPDKIKX0DER \
|
|
104
|
+
--asin B08N5WRWNW
|
|
105
|
+
|
|
106
|
+
tool4seller asin-search-terms list-terms \
|
|
107
|
+
--marketplace-id ATVPDKIKX0DER \
|
|
108
|
+
--asin B08N5WRWNW
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Keyword-rank additions, removals, resumes, and competitor replacements accept `--data` or `--data-file` and use the same one-time write-confirmation flow described below.
|
|
112
|
+
|
|
113
|
+
Top Search Terms searches are read-only POST operations and do not require write confirmation. `searchVolume` is weekly search volume; `supplyDemandRatio` expresses weekly searches per competing listing rather than a percentage.
|
|
114
|
+
|
|
115
|
+
ASIN search-term operations are read-only GET operations. Natural rank is distinct from ABA Search Frequency Rank; current-week ABA enrichment can be null when no weekly match is available.
|
|
116
|
+
|
|
117
|
+
`sales list-orders --statuses REFUND` filters orders by their current synchronized refund flag. Its UTC time range still filters order purchase time, not refund-event time; it is not a refund-event report.
|
|
118
|
+
|
|
119
|
+
## Advertising Search and Recommendations
|
|
120
|
+
|
|
121
|
+
Operations with an OpenAPI JSON request body accept either inline JSON or a UTF-8 JSON file:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
tool4seller advertising-targeting-performance search-keyword-targets \
|
|
125
|
+
--data '{"storeId":"SELLER:MARKETPLACE","startDate":"2026-08-01","endDate":"2026-08-07"}'
|
|
126
|
+
|
|
127
|
+
tool4seller advertising-targeting-performance search-asin-targets \
|
|
128
|
+
--data-file request.json
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Recommendation APIs are read-only POST operations and do not require write confirmation:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
tool4seller advertising-targeting-performance get-target-recommendations \
|
|
135
|
+
--data-file target-recommendation-request.json
|
|
136
|
+
|
|
137
|
+
tool4seller advertising-targeting-performance get-bid-recommendations \
|
|
138
|
+
--data-file bid-recommendation-request.json
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Inspect the exact nested filters and request fields before preparing a payload:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
tool4seller schema show advertising-campaign-performance.search-campaigns
|
|
145
|
+
tool4seller schema show advertising-targeting-performance.get-target-recommendations
|
|
146
|
+
tool4seller schema show advertising-targeting-performance.get-bid-recommendations
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Advertising Management
|
|
150
|
+
|
|
151
|
+
Stable resource commands keep management workflows readable:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
tool4seller campaigns list --store-id SELLER:MARKETPLACE
|
|
155
|
+
tool4seller campaigns create --data-file campaign-create.json
|
|
156
|
+
tool4seller campaigns update --data-file campaign-update.json
|
|
157
|
+
|
|
158
|
+
tool4seller ad-groups create --data-file ad-group-create.json
|
|
159
|
+
tool4seller ads create --data-file ad-create.json
|
|
160
|
+
tool4seller keywords create --data-file keyword-create.json
|
|
161
|
+
tool4seller targets update --data-file target-update.json
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Equivalent `list`, `create`, and `update` commands are exposed where supported for ad groups, ads, keywords, negative keywords, targets, and negative targets. Portfolios currently expose `list` only.
|
|
165
|
+
|
|
166
|
+
## Write Confirmation
|
|
167
|
+
|
|
168
|
+
Every state-changing API request requires an exact, one-time customer confirmation. For operations in the bundled schema, the first invocation validates the payload and returns `confirmation_required` with a change preview, payload fingerprint, and ten-minute one-time confirmation token without sending the write request. Unknown non-GET requests still fail closed as writes, but cannot receive schema validation.
|
|
169
|
+
|
|
170
|
+
After the customer reviews and explicitly confirms that exact preview, execute the unchanged command with the returned one-time confirmation token. Replace the placeholders below with the same method, path, and payload used for the preview:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
tool4seller api PATCH /api/v2/WRITE_PATH \
|
|
174
|
+
--data-file write-request.json \
|
|
175
|
+
--confirm-write confirm_<one-time-token>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
The token is consumed before the network request and cannot be replayed. Changing the environment, path, parameters, or request body also invalidates it. Unknown non-GET requests fail closed as writes. A partially successful batch must be reviewed item by item and must not be retried as a complete batch.
|
|
179
|
+
|
|
180
|
+
If a confirmed write returns `write_outcome_unknown`, the server may have applied it before the response failed. Do not retry the request. Read the affected resources and reconcile every item first; for create operations that cannot be reconciled unambiguously, stop instead of risking duplicates.
|
|
181
|
+
|
|
182
|
+
## Agent Skills
|
|
183
|
+
|
|
184
|
+
Install the packaged Tool4seller skills into the Tool4seller-managed skill store:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
tool4seller skills install
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
By default, this installs the packaged skills under `~/.tool4seller/skills/` and links them into existing agent directories for Codex, Claude, WorkBuddy, Agents, and Doubao. Missing agent directories are not created by the default install.
|
|
191
|
+
|
|
192
|
+
Manage links explicitly:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
tool4seller skills link --agent doubao
|
|
196
|
+
tool4seller skills link --all
|
|
197
|
+
tool4seller skills unlink --agent claude
|
|
198
|
+
tool4seller skills unlink --all
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Install skills into the current project's `.skills/` directory:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
tool4seller skills install --local
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
To install into a custom directory, use:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
tool4seller skills install --destination ~/.codex/skills
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## Upgrade
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
tool4seller update
|
|
217
|
+
tool4seller update --yes --target-version <latestVersion>
|
|
218
|
+
pip install -U tool4seller-cli
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
`tool4seller update` checks the latest PyPI release and prints an upgrade command pinned to that exact version using the Python interpreter that runs the current CLI. After reviewing that version, pass it to `tool4seller update --yes --target-version <latestVersion>`. When the target version is already installed, the command performs no installation.
|
|
@@ -4,16 +4,21 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tool4seller-cli"
|
|
7
|
-
version = "1.0
|
|
8
|
-
description = "Tool4Seller CLI for
|
|
7
|
+
version = "1.2.0"
|
|
8
|
+
description = "Tool4Seller CLI for sales, advertising, market analysis, keyword rankings, inventory, account usage, and profit workflows"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
11
11
|
dependencies = [
|
|
12
12
|
"typer>=0.12",
|
|
13
13
|
"rich>=13.0",
|
|
14
14
|
"requests>=2.28",
|
|
15
|
+
"packaging>=23.0",
|
|
15
16
|
]
|
|
16
17
|
|
|
18
|
+
[project.urls]
|
|
19
|
+
Homepage = "https://www.tool4seller.com/"
|
|
20
|
+
"API Documentation" = "https://das-server.tool4seller.com/api/v3/api-docs/v2"
|
|
21
|
+
|
|
17
22
|
[project.optional-dependencies]
|
|
18
23
|
dev = [
|
|
19
24
|
"pytest>=8.0",
|
|
@@ -32,4 +37,6 @@ include = ["tool4seller_cli*"]
|
|
|
32
37
|
tool4seller_cli = [
|
|
33
38
|
"data/*.json",
|
|
34
39
|
"skills/*/SKILL.md",
|
|
40
|
+
"skills/*/agents/*.yaml",
|
|
41
|
+
"skills/*/references/*.md",
|
|
35
42
|
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.2.0"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Authentication helpers for the Tool4seller CLI."""
|
|
@@ -20,7 +20,7 @@ LOGIN_COMPLETE_HTML = """<!doctype html>
|
|
|
20
20
|
<head>
|
|
21
21
|
<meta charset="utf-8">
|
|
22
22
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
23
|
-
<title>
|
|
23
|
+
<title>Tool4seller CLI Login Complete</title>
|
|
24
24
|
<link rel="icon" href="https://static.tool4seller.com/assets/favicon.ico">
|
|
25
25
|
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
|
26
26
|
<style>
|
|
@@ -124,7 +124,7 @@ def login_with_browser(base_url: str) -> TokenSet:
|
|
|
124
124
|
code_verifier, code_challenge, _ = create_pkce_pair()
|
|
125
125
|
authorize_url = build_authorize_url(base_url, CLIENT_ID, redirect_uri, state, code_challenge)
|
|
126
126
|
|
|
127
|
-
code = wait_for_callback(state, on_ready=lambda:
|
|
127
|
+
code = wait_for_callback(state, on_ready=lambda: _try_open_browser(authorize_url))
|
|
128
128
|
return exchange_authorization_code(
|
|
129
129
|
base_url,
|
|
130
130
|
code=code,
|
|
@@ -134,6 +134,18 @@ def login_with_browser(base_url: str) -> TokenSet:
|
|
|
134
134
|
)
|
|
135
135
|
|
|
136
136
|
|
|
137
|
+
def _try_open_browser(url: str) -> None:
|
|
138
|
+
try:
|
|
139
|
+
browser_opened = webbrowser.open(url)
|
|
140
|
+
except Exception:
|
|
141
|
+
browser_opened = False
|
|
142
|
+
|
|
143
|
+
if not browser_opened:
|
|
144
|
+
print("\nPlease open the following URL in your browser to authorize Tool4seller CLI:")
|
|
145
|
+
print(f"{url}\n")
|
|
146
|
+
print("Waiting for authorization callback. This authorization URL is valid for 5 minutes.\n")
|
|
147
|
+
|
|
148
|
+
|
|
137
149
|
def wait_for_callback(
|
|
138
150
|
expected_state: str,
|
|
139
151
|
on_ready: Callable[[], object] | None = None,
|