@aiready/cli 0.13.6 → 0.13.7

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/src/cli.ts CHANGED
@@ -19,12 +19,6 @@ import {
19
19
  testabilityAction,
20
20
  uploadAction,
21
21
  uploadHelpText,
22
- clawmartMeAction,
23
- clawmartListingsAction,
24
- clawmartCreateAction,
25
- clawmartUploadAction,
26
- clawmartDownloadAction,
27
- clawmartHelpText,
28
22
  bugAction,
29
23
  bugHelpText,
30
24
  } from './commands';
@@ -307,71 +301,6 @@ program
307
301
  await uploadAction(file, options);
308
302
  });
309
303
 
310
- // ClawMart commands
311
- const clawmart = program
312
- .command('clawmart')
313
- .description('Manage ClawMart personas and skills')
314
- .addHelpText('after', clawmartHelpText);
315
-
316
- clawmart
317
- .command('me')
318
- .description('Show my ClawMart creator profile')
319
- .option('--api-key <key>', 'ClawMart API key')
320
- .option('--server <url>', 'Custom ClawMart API server')
321
- .action(async (options) => {
322
- await clawmartMeAction(options);
323
- });
324
-
325
- clawmart
326
- .command('listings')
327
- .description('Show my ClawMart listings')
328
- .option('-q, --query <string>', 'Search query')
329
- .option('-t, --type <type>', 'Filter by type: skill, persona')
330
- .option('-l, --limit <number>', 'Limit results', '10')
331
- .option('--api-key <key>', 'ClawMart API key')
332
- .option('--server <url>', 'Custom ClawMart API server')
333
- .action(async (options) => {
334
- await clawmartListingsAction(options);
335
- });
336
-
337
- clawmart
338
- .command('create')
339
- .description('Create a new listing on ClawMart')
340
- .requiredOption('--name <string>', 'Listing name')
341
- .requiredOption('--tagline <string>', 'Short tagline')
342
- .option('--about <string>', 'Full description')
343
- .option('--category <string>', 'Category', 'Utility')
344
- .option('--capabilities <string>', 'Comma-separated list of capabilities')
345
- .option('--price <number>', 'Price in USD', '0')
346
- .option('--type <type>', 'Product type: skill, persona', 'skill')
347
- .option('--api-key <key>', 'ClawMart API key')
348
- .option('--server <url>', 'Custom ClawMart API server')
349
- .action(async (options) => {
350
- await clawmartCreateAction(options);
351
- });
352
-
353
- clawmart
354
- .command('upload')
355
- .description('Upload content to a listing')
356
- .argument('<id>', 'Listing ID')
357
- .argument('<files...>', 'Files or directories to upload')
358
- .option('--api-key <key>', 'ClawMart API key')
359
- .option('--server <url>', 'Custom ClawMart API server')
360
- .action(async (id, files, options) => {
361
- await clawmartUploadAction(id, files as string[], options);
362
- });
363
-
364
- clawmart
365
- .command('download')
366
- .description('Download a package from ClawMart')
367
- .argument('<idOrSlug>', 'Listing ID or Slug')
368
- .option('--outDir <path>', 'Output directory')
369
- .option('--api-key <key>', 'ClawMart API key')
370
- .option('--server <url>', 'Custom ClawMart API server')
371
- .action(async (idOrSlug, options) => {
372
- await clawmartDownloadAction(idOrSlug, options);
373
- });
374
-
375
304
  program
376
305
  .command('bug')
377
306
  .description('Report a bug or provide feedback (Agent-friendly)')
@@ -17,11 +17,3 @@ export { testabilityAction } from './testability';
17
17
  export { changeAmplificationAction } from './change-amplification';
18
18
  export { uploadAction, uploadHelpText } from './upload';
19
19
  export { bugAction, bugHelpText } from './bug';
20
- export {
21
- clawmartMeAction,
22
- clawmartListingsAction,
23
- clawmartCreateAction,
24
- clawmartUploadAction,
25
- clawmartDownloadAction,
26
- clawmartHelpText,
27
- } from './clawmart';
@@ -1,162 +0,0 @@
1
- import chalk from 'chalk';
2
- import fs from 'fs';
3
- import { resolve as resolvePath } from 'path';
4
- import {
5
- ClawMartClient,
6
- ClawMartListing,
7
- DownloadPackageResponse,
8
- } from '@aiready/clawmart';
9
-
10
- function getClient(options: any) {
11
- const apiKey = options.apiKey || process.env.CLAWMART_API_KEY;
12
- if (!apiKey) {
13
- console.error(chalk.red('āŒ ClawMart API Key is required.'));
14
- console.log(
15
- chalk.dim(
16
- ' Set CLAWMART_API_KEY environment variable or use --api-key flag.'
17
- )
18
- );
19
- process.exit(1);
20
- }
21
- return new ClawMartClient(apiKey, options.server);
22
- }
23
-
24
- export async function clawmartMeAction(options: any) {
25
- const client = getClient(options);
26
- try {
27
- const me = await client.getMe();
28
- console.log(chalk.blue('\nšŸ‘¤ ClawMart Profile:'));
29
- console.log(` Name: ${chalk.bold(me.name)}`);
30
- console.log(` Email: ${me.email}`);
31
- console.log(` Role: ${me.isCreator ? 'Creator' : 'User'}`);
32
- console.log(
33
- ` Sub: ${me.subscriptionActive ? chalk.green('Active') : chalk.red('Inactive')}`
34
- );
35
- } catch (error: any) {
36
- console.error(chalk.red(`āŒ Failed to fetch profile: ${error.message}`));
37
- }
38
- }
39
-
40
- export async function clawmartListingsAction(options: any) {
41
- const client = getClient(options);
42
- try {
43
- let listings;
44
- if (options.query) {
45
- listings = await client.searchListings(
46
- options.query,
47
- options.type,
48
- options.limit
49
- );
50
- } else {
51
- listings = await client.getListings();
52
- }
53
-
54
- if (listings.length === 0) {
55
- console.log(chalk.yellow('\nšŸ“­ No listings found.'));
56
- return;
57
- }
58
-
59
- console.log(chalk.blue(`\nšŸ  ClawMart Listings (${listings.length}):`));
60
- listings.forEach((l: ClawMartListing) => {
61
- const status = l.published
62
- ? chalk.green('Published')
63
- : chalk.yellow('Draft');
64
- console.log(` - ${chalk.bold(l.name)} (${chalk.dim(l.id)})`);
65
- console.log(` ${chalk.italic(l.tagline)}`);
66
- console.log(
67
- ` Price: $${l.price} | Type: ${l.productType} | Status: ${status}`
68
- );
69
- console.log('');
70
- });
71
- } catch (error: any) {
72
- console.error(chalk.red(`āŒ Failed to fetch listings: ${error.message}`));
73
- }
74
- }
75
-
76
- export async function clawmartCreateAction(options: any) {
77
- const client = getClient(options);
78
- try {
79
- const data = {
80
- name: options.name,
81
- tagline: options.tagline,
82
- about: options.about || '',
83
- category: options.category || 'Utility',
84
- capabilities: options.capabilities ? options.capabilities.split(',') : [],
85
- price: parseFloat(options.price) || 0,
86
- productType: options.type as 'skill' | 'persona',
87
- };
88
-
89
- const listing = await client.createListing(data);
90
- console.log(chalk.green(`\nāœ… Listing created successfully!`));
91
- console.log(` ID: ${listing.id}`);
92
- console.log(` Name: ${listing.name}`);
93
- } catch (error: any) {
94
- console.error(chalk.red(`āŒ Failed to create listing: ${error.message}`));
95
- }
96
- }
97
-
98
- export async function clawmartUploadAction(
99
- id: string,
100
- files: string[],
101
- options: any
102
- ) {
103
- const client = getClient(options);
104
- try {
105
- const fileData = files.map((f) => {
106
- const path = resolvePath(process.cwd(), f);
107
- if (!fs.existsSync(path)) {
108
- throw new Error(`File not found: ${f}`);
109
- }
110
- return {
111
- path: f,
112
- content: fs.readFileSync(path, 'utf-8'),
113
- };
114
- });
115
-
116
- await client.uploadVersion(id, fileData);
117
- console.log(
118
- chalk.green(`\nāœ… New version uploaded successfully to listing ${id}!`)
119
- );
120
- } catch (error: any) {
121
- console.error(chalk.red(`āŒ Failed to upload version: ${error.message}`));
122
- }
123
- }
124
-
125
- export async function clawmartDownloadAction(idOrSlug: string, options: any) {
126
- const client = getClient(options);
127
- try {
128
- const pkg = await client.downloadPackage(idOrSlug);
129
- const outDir = options.outDir || `./clawmart-${pkg.slug}`;
130
-
131
- if (!fs.existsSync(outDir)) {
132
- fs.mkdirSync(outDir, { recursive: true });
133
- }
134
-
135
- pkg.files.forEach((f: DownloadPackageResponse['files'][number]) => {
136
- const filePath = resolvePath(outDir, f.path);
137
- const dir = resolvePath(filePath, '..');
138
- if (!fs.existsSync(dir)) {
139
- fs.mkdirSync(dir, { recursive: true });
140
- }
141
- fs.writeFileSync(filePath, f.content);
142
- });
143
-
144
- console.log(
145
- chalk.green(`\nāœ… Package ${idOrSlug} downloaded to ${outDir}`)
146
- );
147
- } catch (error: any) {
148
- console.error(chalk.red(`āŒ Failed to download package: ${error.message}`));
149
- }
150
- }
151
-
152
- export const clawmartHelpText = `
153
- EXAMPLES:
154
- $ aiready clawmart me
155
- $ aiready clawmart listings --query "marketing"
156
- $ aiready clawmart create --name "SEO Booster" --tagline "Boost your SEO" --type skill --price 10
157
- $ aiready clawmart upload <listing-id> SKILL.md rules/
158
- $ aiready clawmart download <listing-id-or-slug> --outDir ./my-skill
159
-
160
- ENVIRONMENT VARIABLES:
161
- CLAWMART_API_KEY Your ClawMart creator API key
162
- `;