summd 0.1.3 → 0.1.4

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/api.js CHANGED
@@ -32,6 +32,12 @@ export async function add(content, tags, opts, note) {
32
32
  args.note = note;
33
33
  return text(await tool('add_entry', args, opts));
34
34
  }
35
+ export async function addUrl(url, tags, opts, note) {
36
+ const args = { url, tags, source_type: 'cli' };
37
+ if (note)
38
+ args.note = note;
39
+ return text(await tool('add_entry', args, opts));
40
+ }
35
41
  export async function search(query, limit, opts) {
36
42
  return text(await tool('search_context', { query, limit }, opts));
37
43
  }
package/dist/index.js CHANGED
@@ -63,9 +63,15 @@ program
63
63
  .description('Add an entry — reads stdin if no content given')
64
64
  .option('-t, --tag <tags>', 'Comma-separated tags')
65
65
  .option('-f, --file <path>', 'Read content from file')
66
+ .option('-u, --url <url>', 'Fetch URL and save as entry (articles, YouTube, etc.)')
66
67
  .option('-n, --note <text>', 'Personal annotation (not included in AI summarization)')
67
68
  .action(async (content, cmd) => {
68
69
  const tags = cmd.tag ? cmd.tag.split(',').map(t => t.trim()) : [];
70
+ // URL mode: delegate fetch + convert to server
71
+ if (cmd.url) {
72
+ console.log(await api.addUrl(cmd.url, tags, globalOpts(), cmd.note));
73
+ return;
74
+ }
69
75
  let body = content;
70
76
  if (!body && cmd.file) {
71
77
  const raw = readFileSync(cmd.file, 'utf8');
@@ -74,7 +80,7 @@ program
74
80
  if (!body && !process.stdin.isTTY)
75
81
  body = await readStdin();
76
82
  if (!body) {
77
- console.error('Provide content, --file, or pipe from stdin.');
83
+ console.error('Provide content, --file, --url, or pipe from stdin.');
78
84
  process.exit(1);
79
85
  }
80
86
  console.log(await api.add(body, tags, globalOpts(), cmd.note));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "summd",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "CLI for sum.md — Sum to anything.",
5
5
  "license": "MIT",
6
6
  "bin": {