用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/yashiels/takealot-cli --skill takealot命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | takealot |
| description | Shop on Takealot.com from the terminal. Search, add to cart, and checkout via pure API. |
Shop on Takealot.com from the terminal — search products, manage your cart, check out, and review order history. Talks directly to the Takealot mobile REST API; no browser required.
brew install yashiels/tap/takealot
Or download a standalone binary from the latest release.
Build from source (Node ≥ 18 required):
git clone https://github.com/yashiels/takealot-cli.git
cd takealot-cli
npm install && npm run build
npm link # puts `takealot` on your PATH
Credentials are managed by the takealot login command and cached automatically. The CLI stores email, plaintext password (protected only by filesystem permissions, chmod 0600), and cached tokens in ~/.config/takealot-cli/credentials.json (XDG-respecting, chmod 0600).
The login command prompts for your Takealot account email and password interactively, then caches the token set. If your account has two-step verification (2FA) enabled, you will also be prompted for an OTP code sent to your phone. Tokens auto-refresh on expiry; if refresh fails and full login is required, a 2FA account requires an interactive OTP prompt.
First-time login requires an interactive terminal:
takealot login in a real terminal so ~/.config/takealot-cli/credentials.json gets populated. After that, most calls work without interaction via token refresh.takealot login --reset unattended. It re-prompts for email/password and throws --reset needs an interactive terminal when there is no TTY. If credentials are wrong, ask the user to run takealot login --reset themselves.No saved credentials. Run 'takealot login' in an interactive terminal first. — surface that to the user rather than retrying; an agent cannot complete first-time login unattended.takealot search … --json always works.takealot checkout) and only pass --confirm --yes when the user has explicitly approved the order and total.takealot search <query>
takealot search <query> --limit <n> # max results (default 10)
takealot search <query> --json # machine-readable output
Examples:
takealot search "protein powder"
takealot search "pencils" --limit 5
takealot search "coffee" --json | jq '.[0]'
takealot cart # show current cart
takealot cart add <item> # add one item (preference-ranked match)
takealot cart basket "<item>; ..." # add several items at once
takealot cart clear # empty the cart
cart add accepts an optional leading quantity:
takealot cart add "3 pencils"
takealot cart add "2 packs sunscreen"
cart basket splits on commas, semicolons, or newlines and adds items in parallel:
takealot cart basket "milk; bread; eggs; coffee"
takealot cart basket "3 pens, notebook, sticky notes"
takealot checkout # dry-run: print totals, address, card — no charge
takealot checkout --confirm # place the order and pay with the saved card
takealot checkout --confirm --yes # skip the interactive confirmation prompt
The dry-run prints the full order summary (items, delivery address, payment method, total) so you can verify before committing.
takealot orders # list recent orders (default 20)
takealot orders --limit <n> # show more/fewer orders
takealot orders show <id> # full detail for one order
The preference engine learns from your order history and ranks search results for cart add.
takealot preferences # show the current preference cache
takealot preferences show # same
takealot preferences refresh # rebuild cache from full order history
Run preferences refresh after your first login to seed the cache.
takealot config # show config and credential status (secrets redacted)
takealot config show # same
Config lives in ~/.config/takealot-cli/ (respects $XDG_CONFIG_HOME):
| File | Contents |
|---|---|
config.json | API base URLs, preferred card, explicit brand list |
credentials.json | Email, plaintext password (protected only by filesystem permissions, chmod 0600), and cached tokens |
preferences.json | Order-history preference cache |
takealot login # log in, cache tokens
takealot login --reset # clear stored credentials and re-authenticate
| Flag | Effect |
|---|---|
--json | Machine-readable JSON output (works on every command) |
--verbose | Print debug logging to stderr |
--version | Print the version and exit |
--help | Show help for any command or subcommand |
Exit codes: 0 success · 1 general failure
When you run takealot cart add, the tool picks the best product match through a ranked funnel:
config.json → preferredBrandsSeed the cache once with takealot preferences refresh after your first login. The cache updates automatically as you order more.
# 1. Install
brew install yashiels/tap/takealot
# 2. Authenticate
takealot login
# 3. Seed the preference engine
takealot preferences refresh
# 4. Search and shop
takealot search "protein bar" --limit 5
takealot cart add "2 protein bars"
takealot cart basket "milk; bread; eggs"
takealot cart
# 5. Review and place order
takealot checkout # dry-run first
takealot checkout --confirm # then pay
基于 SOC 职业分类