Skip to content

feat(xianyu): add publish command for listing items#1282

Open
hszhsz wants to merge 1 commit intojackwener:mainfrom
hszhsz:feat/xianyu-publish-clean
Open

feat(xianyu): add publish command for listing items#1282
hszhsz wants to merge 1 commit intojackwener:mainfrom
hszhsz:feat/xianyu-publish-clean

Conversation

@hszhsz
Copy link
Copy Markdown
Contributor

@hszhsz hszhsz commented May 3, 2026

Summary

Add opencli xianyu publish command for listing items on goofish.com.

Changes

  • clis/xianyu/publish.js — Main implementation

    • Navigate to https://www.goofish.com/publish
    • Fill title, description, price, condition, category via browser automation
    • Support --original_price, --location, --images optional args
    • Detect publish success by URL change or page text
    • Uses Strategy.COOKIE (requires logged-in browser session)
    • Images uploaded via CDP setFileInputFiles API
  • clis/xianyu/publish.test.js — Unit test for buildPublishUrl

Usage

opencli xianyu publish "<title>" "<description>" <price> <condition> <category> \
  [--original_price N] \
  [--location city] \
  [--images /path/a.jpg,/path/b.jpg]

Example

opencli xianyu publish "iPhone 15 Pro 99新" "无划痕 国行正品" 4500 "几乎全新" "手机"

- Add xianyu publish command to list items on goofish.com
- Support title, description, price, condition, category
- Optional: original_price, location, images (via CDP setFileInput)
- Uses browser automation with cookie strategy
- Add unit test for buildPublishUrl helper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant