{"_id":"ppspy-cli","_rev":"3-716b7cb2b9e09c6124c923024c565d44","name":"ppspy-cli","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"ppspy-cli","version":"0.1.0","keywords":["ppspy","cli","api","shopify","ads"],"license":"MIT","_id":"ppspy-cli@0.1.0","maintainers":[{"name":"livermore","email":"fanyanggod95@gmail.com"}],"bin":{"ppspy":"bin/ppspy.js"},"dist":{"shasum":"ac8e16f9b725f58286a4f74f59a0dd47c52c21a2","tarball":"https://registry.npmjs.org/ppspy-cli/-/ppspy-cli-0.1.0.tgz","fileCount":13,"integrity":"sha512-ph/Ajsroz1sto2XAOpOy+frUoDhsIji+aPbLL4OWwuERplD8+eQhfAUG4WYj3kXdqwn2Q5TiQORbWFuuQe6Bdw==","signatures":[{"sig":"MEUCIAQSs4dv+faHASIfW4/oLi8LW+3ellO6EfqXsHI4es+lAiEAvKmMG6qd/WuwClsB1ls/HM7SCY3kqjGA61IubMAmsAw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":215523},"type":"module","engines":{"node":">=20"},"gitHead":"4ba1be0d46b51e3e9319c427c7a9a790674c633b","private":false,"scripts":{"test":"node --test","start":"node ./src/index.js","pack:check":"npm pack --dry-run","build:commands":"node ./scripts/build-commands.js","prepublishOnly":"npm test && npm run pack:check"},"_npmUser":{"name":"livermore","email":"fanyanggod95@gmail.com"},"_npmVersion":"11.12.1","description":"CLI for executing PPSPY Open Platform APIs from generated markdown documentation.","directories":{},"_nodeVersion":"25.9.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ppspy-cli_0.1.0_1775113319730_0.24191873231900818","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"ppspy-cli","version":"0.1.1","keywords":["ppspy","cli","api","shopify","ads"],"license":"MIT","_id":"ppspy-cli@0.1.1","maintainers":[{"name":"livermore","email":"fanyanggod95@gmail.com"}],"bin":{"ppspy":"bin/ppspy.js"},"dist":{"shasum":"71b9aafd3b9f9e7fcdd7fda608d287772a40e6f4","tarball":"https://registry.npmjs.org/ppspy-cli/-/ppspy-cli-0.1.1.tgz","fileCount":13,"integrity":"sha512-ecOB3o0nl86c4RMuhFfLmV3ghz1fNLrfqt4gK9ZDETtbuf5Y/W2dFd0QXkg775wSFK641A6Q4tHS/fnvkZXOsg==","signatures":[{"sig":"MEUCIQC+W6SukComjzdZiHebOYHl2+Q32xU2znjGXZpxNBrR0gIgfvRPps8LWU/NnkCpqKhOJbGLbLogzk92AqctIkQyB8I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":215879},"type":"module","engines":{"node":">=20"},"gitHead":"7e802a04b0fe4e662709bf86d4c0bd37e33ebc29","private":false,"scripts":{"test":"node --test","start":"node ./src/index.js","pack:check":"npm pack --dry-run","build:commands":"node ./scripts/build-commands.js","prepublishOnly":"npm test && npm run pack:check"},"_npmUser":{"name":"livermore","email":"fanyanggod95@gmail.com"},"_npmVersion":"11.12.1","description":"CLI for executing PPSPY Open Platform APIs from generated markdown documentation.","directories":{},"_nodeVersion":"25.9.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ppspy-cli_0.1.1_1775113935335_0.0759761851799936","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"_id":"ppspy-cli@0.1.2","bin":{"ppspy":"bin/ppspy.js"},"dist":{"shasum":"0489c767b3f32adca2d74cb214c511ff8de9738d","tarball":"https://registry.npmjs.org/ppspy-cli/-/ppspy-cli-0.1.2.tgz","fileCount":14,"integrity":"sha512-kXxX/k7lY4rggU9Znwh7nyjSL/KrtYXaOk1CQzPH8E32mKb+9btWTKVApdqpOI0gNFEM3kiV+NEFg7b7vYExPw==","signatures":[{"sig":"MEQCIGexFZrZ7FdV6tFT1vA1YHJAw4l2G2vZMquITRZ+1sKsAiBCK1eYXGpfqQQkXpebnZ03UOMfOaEhPhLtY8ih8Fmjzw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD8+Dwq9Om0diTbP8iu3zETllT+AyqjX2PNK46FPMUK/AIhAJhF6vLU8ExSpBINykWPK1HYHuJr2+OMND2T8afE4eTo"}],"unpackedSize":228892},"name":"ppspy-cli","type":"module","_from":"file:ppspy-cli-0.1.2.tgz","engines":{"node":">=20"},"license":"MIT","private":false,"scripts":{"test":"node --test","start":"node ./src/index.js","pack:check":"npm pack --dry-run","build:commands":"node ./scripts/build-commands.js","prepublishOnly":"npm test && npm run pack:check"},"version":"0.1.2","_npmUser":{"name":"livermore","email":"fanyanggod95@gmail.com"},"keywords":["ppspy","cli","api","shopify","ads"],"_resolved":"/Users/sherlock/WorkSpace/Work/ppspy-cli/ppspy-cli-0.1.2.tgz","_integrity":"sha512-kXxX/k7lY4rggU9Znwh7nyjSL/KrtYXaOk1CQzPH8E32mKb+9btWTKVApdqpOI0gNFEM3kiV+NEFg7b7vYExPw==","_npmVersion":"11.12.1","description":"CLI for executing PPSPY Open Platform APIs from generated markdown documentation.","directories":{},"maintainers":[{"name":"livermore","email":"fanyanggod95@gmail.com"}],"_nodeVersion":"25.9.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ppspy-cli_0.1.2_1792489156215_0.5886703055381717"}}},"time":{"created":"2026-04-02T07:01:59.729Z","modified":"2026-10-20T09:39:16.561Z","0.1.0":"2026-04-02T07:01:59.881Z","0.1.1":"2026-04-02T07:12:15.485Z","0.1.2":"2026-10-20T09:39:16.368Z"},"license":"MIT","keywords":["ppspy","cli","api","shopify","ads"],"description":"CLI for executing PPSPY Open Platform APIs from generated markdown documentation.","maintainers":[{"name":"livermore","email":"fanyanggod95@gmail.com"}],"readme":"# ppspy-cli\n\nA Node.js CLI for PPSPY Open Platform APIs.\n\nIt uses package-internal command metadata from `generated/commands.json` to execute live API requests for endpoint commands. Pure reference docs such as enum lists remain local reference commands.\n\nThe catalog includes 59 API commands and 7 local reference commands.\n\n## Requirements\n\n- Node.js 20+\n- A PPSPY API key\n\n## Install\n\n### Local development\n\n```bash\nnpm install\nnpm test\n```\n\n### Install from npm\n\n```bash\nnpm install -g ppspy-cli@0.1.2\nppspy help\n```\n\n### Run directly from the repo\n\n```bash\nnode ./bin/ppspy.js help\n```\n\n## Authentication\n\nVisit the official website at `ppspy.com` to view real-time dashboard data and product UI.\n\nVisit the direct API site at `api.ppspy.com` to get your API key and manage billing/recharge.\n\nSet the environment variable:\n\n```bash\nexport PPSPY_API_KEY=your_api_key\n```\n\nYou can also pass the key explicitly:\n\n```bash\nppspy ad-filter-options list --api-key your_api_key\n```\n\nFlag precedence:\n\n- `--api-key` overrides `PPSPY_API_KEY`\n\nOptional base URL override for testing:\n\n```bash\nexport PPSPY_BASE_URL=http://127.0.0.1:3000\n```\n\n## Usage\n\nList domains and commands:\n\n```bash\nppspy help\n```\n\nShow help for a domain:\n\n```bash\nppspy shopify-store --help\n```\n\nShow help for a command:\n\n```bash\nppspy shopify-store details --help\n```\n\nRun endpoint commands:\n\n```bash\nppspy current credits\nppspy ad-filter-options list\nppspy shopify-store details --id 123\nppspy shopify-bestselling-product list --shop_id 123\nppspy ad-monitor create-group --name Popular\n```\n\n`ppspy current credits` queries the free `/open-api/v1/credits` endpoint and returns both normal and monitoring credit balances. It requires an API key.\n\nRun a reference command:\n\n```bash\nppspy reference ad-e-commerce-platform-list\n```\n\n## Parameter conventions\n\n- CLI parameters use `--field value`\n- Path parameters map from doc placeholders like `{id}` to flags like `--id`\n- Query parameters are appended to the request URL\n- Body parameters are serialized as JSON\n- Primitive values are validated against documented types; integer and number fields reject invalid values\n- Shopify store IDs and monitoring group IDs stay as exact strings, including IDs longer than JavaScript's safe integer range\n- JSON-like values such as arrays or objects can be passed as JSON strings\n- Nested body objects use flattened flag names derived from their path, such as `--extend_keywords_field`\n- Repeated nested leaf names are disambiguated by prefixing the parent path in the flag name\n- For object arrays such as `extend_keywords` and `exclude_keywords`, flattened flags create one array item; pass the parent flag as a JSON array for multiple items\n- Choose either the parent JSON flag or its flattened child flags for each object/array; mixing them returns an error\n- Required nested fields are checked only when their parent is supplied, including every item in a JSON array\n- Documented request headers are supplied automatically; explicit header options shown in command help override their defaults\n\nExamples:\n\n```bash\nppspy shopify-store details --id 123\nppspy ad-monitor-task list --page 1 --per_page 10\nppspy ad-monitor create-task --facebook_page_id_list '[\"100726615757315\"]' --group_id d7fffb6c5166af6c285438ecf5202a87\nppspy ad-product list --extend_keywords_field product_name --extend_keywords_value shoe --extend_keywords_logic_operator and --page 2 --per_page 20\nppspy ad-product list --extend_keywords '[{\"field\":\"product_name\",\"value\":\"shoe\",\"logic_operator\":\"and\"},{\"field\":\"product_name\",\"value\":\"boot\",\"logic_operator\":\"or\"}]'\nppspy sales-monitor create-task --urls '[\"shop.example\"]' --group_id null\n```\n\nIn the last example, `null` is sent as JSON null, not the string `\"null\"`. Array and object flags require valid JSON with the documented types. Missing option values and incomplete keyword objects fail locally before sending a request.\n\nFor `ppspy advertisement list`, pass `--search_after ''` on the first deep-pagination page, then pass the returned cursor as a JSON array such as `--search_after '[123,\"cursor\"]'`. Sales monitor creation accepts 1–50 nonempty URLs. Ad monitor creation needs at least one target list; when several are provided, the CLI sends only the highest-priority list and warns about the others.\n\nThe default request timeout is 30 seconds. Set `PPSPY_TIMEOUT_MS` or pass `--timeout-ms` to change it. A timeout aborts the local request, but a submitted operation may still have completed upstream; check its state before retrying.\n\n## Error handling\n\n- Missing API key returns a clear error\n- Missing required command parameters return an error and print command help\n- Non-2xx responses and non-200 PPSPY business codes return exit code 5; malformed success envelopes also fail\n- Network failures and timeouts return exit code 4; invalid options return exit code 2\n- `--help` on a command shows whether it is a live API command or local reference data\n\n## Development\n\nThe package ships with generated command data in `generated/commands.json`, so normal development, testing, and packaging do not require any external markdown docs.\n\nRun tests:\n\n```bash\nnpm test\n```\n\nRun packaging smoke check:\n\n```bash\nnpm run pack:check\n```\n\nRun the CLI locally:\n\n```bash\nnode ./bin/ppspy.js help\n```\n\nIf you need to refresh the generated command data manually for maintenance work:\n\n```bash\nPPSPY_DOCS_DIR=../API-Open-Platform-PPSPY/public/static/en npm run build:commands\n```\n\nUse the English API markdown directory: the generator reads its API headings and table columns. Review the generated changes and run `npm test` after refreshing the catalog.\n\n## Publish preparation\n\nBefore publishing to npm, verify:\n\n```bash\nnpm install\nnpm test\nnpm run pack:check\nnpm pack\nnpm install -g ./ppspy-cli-0.1.2.tgz\n```\n\nThen smoke-test commands locally without an API key:\n\n```bash\nppspy help\nppspy shopify-store list --help\nppspy reference response-status-code\n```\n\nTo publish the exact tested tarball manually:\n\n```bash\nnpm whoami\nnpm view ppspy-cli version\nnpm publish ./ppspy-cli-0.1.2.tgz --access public --ignore-scripts\nnpm view ppspy-cli@0.1.2 version dist.integrity --json\nnpm view ppspy-cli dist-tags --json\n```\n\nThe npm account must have permission to publish `ppspy-cli`. If `npm whoami` fails, run `npm login` and retry. The registry does not allow replacing an already-published name and version; if 0.1.2 exists, bump the version and rerun tests and tarball verification before publishing.\n\n## Package metadata checklist\n\nBefore publishing, add these fields to `package.json` if you want npm package metadata to link back to your repository:\n\n- `repository.url`\n- `homepage`\n- `bugs.url`\n\n## Notes\n\n- Command behavior is driven by the package-internal `generated/commands.json`\n- Enum/list commands are local reference outputs, not live API requests\n- Release-grade support is strongest for common path/query/body shapes; very irregular nested request schemas may still need targeted follow-up handling\n","readmeFilename":"README.md"}