@trawlme/cli 1.8.0 → 1.9.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.
@@ -98,14 +98,14 @@ scraps
98
98
  .requiredOption('-t, --title <title>', 'Scrap title')
99
99
  .option('-u, --url <url>', 'Target URL')
100
100
  .option('-r, --request <request>', 'Request/query')
101
- .option('-s, --scrapper <scrapper>', 'Scrapper type', 'puppeteer')
101
+ .option('-d, --description <text>', 'Scrap description')
102
102
  .action(async (opts) => {
103
103
  const spinner = ora('Creating scrap…').start();
104
104
  const data = await api.post('/api/scraps', {
105
105
  title: opts.title,
106
106
  ...(opts.url && { url: opts.url }),
107
107
  request: opts.request || '',
108
- scrapper: opts.scrapper,
108
+ ...(opts.description !== undefined && { description: opts.description }),
109
109
  });
110
110
  spinner.succeed(`Scrap created: ${chalk.bold(data._id)}`);
111
111
  console.log(chalk.dim(` Title: ${data.title}`));
@@ -117,7 +117,7 @@ scraps
117
117
  .option('-t, --title <title>', 'New title')
118
118
  .option('-u, --url <url>', 'New target URL')
119
119
  .option('-r, --request <request>', 'New request')
120
- .option('-s, --scrapper <scrapper>', 'New scrapper type')
120
+ .option('-d, --description <text>', 'New description')
121
121
  .option('--cron <expression>', 'Cron expression (empty string to disable)')
122
122
  .option('--no-cron', 'Disable cron (set to null)')
123
123
  .option('--alert <email>', 'Failure alert email (empty string to clear)')
@@ -133,8 +133,8 @@ scraps
133
133
  body.url = opts.url;
134
134
  if (opts.request !== undefined)
135
135
  body.request = opts.request;
136
- if (opts.scrapper !== undefined)
137
- body.scrapper = opts.scrapper;
136
+ if (opts.description !== undefined)
137
+ body.description = opts.description;
138
138
  if (opts.cron === false)
139
139
  body.cron = null;
140
140
  else if (typeof opts.cron === 'string')
package/dist/index.js CHANGED
@@ -1,15 +1,20 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command } from 'commander';
3
3
  import chalk from 'chalk';
4
+ import { readFileSync } from 'node:fs';
5
+ import { fileURLToPath } from 'node:url';
6
+ import { dirname, join } from 'node:path';
4
7
  import { login, logout } from './commands/login.js';
5
8
  import { scraps } from './commands/scraps.js';
6
9
  import { skills } from './commands/skills.js';
7
10
  import { autoUpdateInstalledSkills } from './lib/skills.js';
8
11
  autoUpdateInstalledSkills();
12
+ const __dirname = dirname(fileURLToPath(import.meta.url));
13
+ const pkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf8'));
9
14
  const program = new Command()
10
15
  .name('trawl')
11
16
  .description('Trawl CLI — manage scraps from the terminal')
12
- .version('0.1.0')
17
+ .version(pkg.version)
13
18
  .option('--debug', 'Show full error stack traces');
14
19
  program.addCommand(login);
15
20
  program.addCommand(logout);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trawlme/cli",
3
- "version": "1.8.0",
3
+ "version": "1.9.1",
4
4
  "description": "Trawl CLI — manage scraps from the terminal",
5
5
  "type": "module",
6
6
  "bin": {