Typescript cli tool to simplify and automate the listing of Pokémon items on eBay, such as cards, graded cards, boosters, displays and so on.
Clone the repository and install dependencies:
git clone https://github.com/Leoglme/PokeBay-CLI
cd PokeBay-CLI
npm installCreate a .env file based on .env.example provided, and fill in your eBay and imgbb API credentials:
# eBay Sandbox (for testing)
EBAY_APP_ID_SANDBOX=YourSandboxAppID
EBAY_DEV_ID_SANDBOX=YourSandboxDevID
EBAY_CERT_ID_SANDBOX=YourSandboxCertID
EBAY_AUTH_TOKEN_SANDBOX=YourSandboxAuthToken
# eBay Production (for live listings)
EBAY_APP_ID_PROD=YourProdAppID
EBAY_DEV_ID_PROD=YourProdDevID
EBAY_CERT_ID_PROD=YourProdCertID
EBAY_AUTH_TOKEN_PROD=YourProdAuthToken
# IMGBB (for image hosting)
IMGBB_API_KEY=YourImgbbAPIKey
Place images of the items you wish to list in the images directory at the root of the project.
Create an items.json file at the project root with the details of the items you wish to list. Use the provided example as a template:
[
{
"name": "Hisuian Samurott Vstar",
"number": "230/172",
"set": "s12a Vstar",
"language": "Japonaise",
"images": ["IMG_3417.jpg", "IMG_3418.jpg", "IMG_3419.jpg"],
"isGraded": false,
"condition": "Near Mint or Better",
"price": 8
}
]Here is the type of item in the items.json file:
type Card = {
name: string;
number: string;
set: string;
language: string;
images: string[];
isGraded: boolean;
grade?: number;
gradeCompany?: string;
startPrice?: number;
price?: number;
condition?: EbayConditions;
quantity?: number;
minimumBestOfferAmount?: number;
}To facilitate creating the items.json file, use this GPT prompt link. Provide details about your items, and ChatGPT will help structure your JSON file.
In addition to manually creating items.json or using ChatGPT to build it, PokeBay-CLI now supports automatic generation of this file using a new command:
npm run generateJsonThis command simplifies the process of listing Pokémon items on eBay by automatically filling in the necessary item information based on a set of predefined keywords.
-
Prepare a
baseInfosArray: First, define abaseInfosarray in thegenerateJson.tsscript. Each element of this array should include akeywordfor searching eBay and an array ofimagesfor the item.Example:
const baseInfos: BaseInfo[] = [ { keyword: '55/102', images: ['IMG_3018.jpg', 'IMG_3019.jpg'] } ];
-
Run the Command: Execute the command in your terminal:
npm run generateJson
This will search eBay for items matching each keyword, fetch details, and generate an
items.jsonfile at the project root, filled with the structured data for your listings.
Before running the command, ensure you have:
- Placed the images for your items in the
imagesdirectory as specified in yourbaseInfosarray.
This feature aims to streamline the setup process, making it quicker and easier to start listing your Pokémon items on eBay.
To start listing your Pokémon items on eBay, run:
npm run startEnsure you have completed the .env setup and prepared items.json and images as described above.
License: MIT dibodev