plexmint 0.1.0 → 0.1.1
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.
- package/dist/index.js +26 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -52,6 +52,7 @@ var PlexMintClient = class {
|
|
|
52
52
|
if (options.model) params.set("model", options.model);
|
|
53
53
|
if (options.sort) params.set("sort", options.sort);
|
|
54
54
|
if (options.limit) params.set("limit", options.limit.toString());
|
|
55
|
+
if (options.offset) params.set("offset", options.offset.toString());
|
|
55
56
|
const qs = params.toString();
|
|
56
57
|
return this.request(`/prompts${qs ? `?${qs}` : ""}`);
|
|
57
58
|
}
|
|
@@ -231,22 +232,30 @@ async function browseCommand(options) {
|
|
|
231
232
|
const spinner = ora2("Browsing PlexMint marketplace...").start();
|
|
232
233
|
try {
|
|
233
234
|
const client = new PlexMintClient(getApiKey(), getBaseUrl());
|
|
235
|
+
const limit = options.limit ? parseInt(options.limit) : 20;
|
|
236
|
+
const page = options.page ? Math.max(1, parseInt(options.page)) : 1;
|
|
237
|
+
const offset = (page - 1) * limit;
|
|
234
238
|
const result = await client.browse({
|
|
235
239
|
category: options.category,
|
|
236
240
|
model: options.model,
|
|
237
241
|
sort: options.sort || "trending",
|
|
238
|
-
limit
|
|
242
|
+
limit,
|
|
243
|
+
offset
|
|
239
244
|
});
|
|
240
245
|
spinner.stop();
|
|
241
|
-
const { items } = result.data;
|
|
246
|
+
const { items, hasMore } = result.data;
|
|
242
247
|
if (items.length === 0) {
|
|
243
|
-
|
|
248
|
+
if (page > 1) {
|
|
249
|
+
console.log(chalk2.yellow("\n No more prompts. You've reached the end.\n"));
|
|
250
|
+
} else {
|
|
251
|
+
console.log(chalk2.yellow("\n No prompts found.\n"));
|
|
252
|
+
}
|
|
244
253
|
return;
|
|
245
254
|
}
|
|
246
255
|
const sortLabel = options.sort || "trending";
|
|
247
256
|
console.log(
|
|
248
257
|
chalk2.bold(`
|
|
249
|
-
PlexMint Marketplace`) + chalk2.gray(` \u2014 sorted by ${sortLabel}
|
|
258
|
+
PlexMint Marketplace`) + chalk2.gray(` \u2014 sorted by ${sortLabel}`) + chalk2.gray(` \u2014 page ${page}
|
|
250
259
|
`)
|
|
251
260
|
);
|
|
252
261
|
const table = new Table2({
|
|
@@ -274,6 +283,17 @@ async function browseCommand(options) {
|
|
|
274
283
|
]);
|
|
275
284
|
}
|
|
276
285
|
console.log(table.toString());
|
|
286
|
+
const footer = [];
|
|
287
|
+
if (page > 1) {
|
|
288
|
+
footer.push(chalk2.gray(" \u25C0 Previous: ") + chalk2.white(`plexmint browse --page ${page - 1}`));
|
|
289
|
+
}
|
|
290
|
+
if (hasMore) {
|
|
291
|
+
footer.push(chalk2.gray(" \u25B6 Next: ") + chalk2.white(`plexmint browse --page ${page + 1}`));
|
|
292
|
+
}
|
|
293
|
+
if (footer.length > 0) {
|
|
294
|
+
console.log("");
|
|
295
|
+
footer.forEach((f) => console.log(f));
|
|
296
|
+
}
|
|
277
297
|
console.log(
|
|
278
298
|
chalk2.gray("\n Get details: ") + chalk2.white("plexmint info <TICKER>") + chalk2.gray(" | Install: ") + chalk2.white("plexmint install <TICKER>\n")
|
|
279
299
|
);
|
|
@@ -698,8 +718,8 @@ var BANNER = `
|
|
|
698
718
|
${chalk7.gray("https://plexmint.com")}
|
|
699
719
|
`;
|
|
700
720
|
program.name("plexmint").description("Browse, install, and manage AI prompts from the PlexMint marketplace").version("0.1.0").addHelpText("before", BANNER);
|
|
701
|
-
program.command("search <query>").description("Search for prompts by keyword").option("-c, --category <category>", "Filter by category (business, writing, code, seo, design, education, data, social-media, personal)").option("-m, --model <model>", "Filter by AI model (gpt-4o, claude-opus, claude-sonnet, gemini, midjourney, etc.)").option("-s, --sort <sort>", "Sort order (trending, top_rated, most_sales, newest, price_low, price_high)", "trending").option("-l, --limit <limit>", "Number of results (max 100)", "12").action(searchCommand);
|
|
702
|
-
program.command("browse").description("Browse the PlexMint marketplace").option("-c, --category <category>", "Filter by category").option("-m, --model <model>", "Filter by AI model").option("-s, --sort <sort>", "Sort order", "trending").option("-l, --limit <limit>", "Number of results", "20").action(browseCommand);
|
|
721
|
+
program.command("search <query>").description("Search for prompts by keyword").option("-c, --category <category>", "Filter by category (business, writing, code, seo, design, education, data, social-media, personal)").option("-m, --model <model>", "Filter by AI model (gpt-4o, claude-opus, claude-sonnet, gemini, midjourney, etc.)").option("-s, --sort <sort>", "Sort order (trending, top_rated, most_sales, newest, price_low, price_high)", "trending").option("-l, --limit <limit>", "Number of results (max 100)", "12").option("-p, --page <page>", "Page number", "1").action(searchCommand);
|
|
722
|
+
program.command("browse").description("Browse the PlexMint marketplace").option("-c, --category <category>", "Filter by category").option("-m, --model <model>", "Filter by AI model").option("-s, --sort <sort>", "Sort order", "trending").option("-l, --limit <limit>", "Number of results", "20").option("-p, --page <page>", "Page number", "1").action(browseCommand);
|
|
703
723
|
program.command("info <ticker>").description("Get detailed info about a prompt by its ticker symbol").action(infoCommand);
|
|
704
724
|
program.command("install <ticker>").description("Install a prompt locally (downloads to .plexmint/ directory)").option("-d, --dir <directory>", "Install directory (default: .plexmint)").option("-f, --force", "Overwrite if already installed").action(installCommand);
|
|
705
725
|
program.command("login").description("Authenticate with your PlexMint account").option("--api-key <key>", "Set API key directly (skip interactive login)").action(loginCommand);
|