@profullstack/nichedb 0.36.0 → 0.36.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +30 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@profullstack/nichedb",
3
- "version": "0.36.0",
3
+ "version": "0.36.1",
4
4
  "description": "CLI and MCP bridge for NicheDB: browse collections, manage sources and feeds, search items, from any deployment",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/index.js CHANGED
@@ -225,9 +225,22 @@ export const COMMANDS = [
225
225
  },
226
226
  {
227
227
  name: 'profiles',
228
- usage: 'profiles [<query>] [--since <iso>] [--mine]',
229
- summary: 'People with an OpenProfile.md: search them, or list the ones your key owns.',
230
- options: ['--since <iso>', '--mine', '--limit', '--json', '--urls'],
228
+ usage:
229
+ 'profiles [<query>] [--title …] [--company …] [--seniority …] [--tags …] [--linkedin <url>] [--since <iso>] [--mine]',
230
+ summary:
231
+ 'People with an OpenProfile.md: search them (by text, or the job title, company and seniority they publish), find the one a LinkedIn URL belongs to, or list the ones your key owns.',
232
+ options: [
233
+ '--title <job title>',
234
+ '--company <domain|url|name>',
235
+ '--seniority <c-suite|vp|director|manager|senior|entry>',
236
+ '--tags <title:…,company:…,seniority:…>',
237
+ '--linkedin <url>',
238
+ '--since <iso>',
239
+ '--mine',
240
+ '--limit',
241
+ '--json',
242
+ '--urls',
243
+ ],
231
244
  },
232
245
  {
233
246
  name: 'profile',
@@ -410,6 +423,16 @@ const pad = (s, n) =>
410
423
  .slice(0, n);
411
424
  const when = (d) => (d ? new Date(d).toISOString().slice(0, 16).replace('T', ' ') : '-');
412
425
 
426
+ /** `CTO, Example (example.com) [c-suite]` for a profile that publishes them; '' when it does not. */
427
+ export function professionalLine(p) {
428
+ const company = p?.company
429
+ ? [p.company.name, p.company.domain ? `(${p.company.domain})` : null].filter(Boolean).join(' ')
430
+ : '';
431
+ const head = [p?.title, company].filter(Boolean).join(', ');
432
+ if (!head && !p?.seniority) return '';
433
+ return [head, p?.seniority ? `[${p.seniority}]` : null].filter(Boolean).join(' ');
434
+ }
435
+
413
436
  function printItems(items, { json, urls }) {
414
437
  if (json) return out(JSON.stringify(items, null, 2));
415
438
  if (urls) {
@@ -968,6 +991,8 @@ export async function run(
968
991
  if (flags.since) qs.set('since', flags.since);
969
992
  if (flags.limit) qs.set('limit', flags.limit);
970
993
  if (flags.mine) qs.set('mine', '1');
994
+ for (const f of ['title', 'company', 'seniority', 'tags', 'linkedin'])
995
+ if (typeof flags[f] === 'string' && flags[f]) qs.set(f, flags[f]);
971
996
  const { profiles } = await client.get(`/api/v1/profiles?${qs}`);
972
997
  if (json) {
973
998
  out(JSON.stringify(profiles, null, 2));
@@ -980,6 +1005,8 @@ export async function run(
980
1005
  }
981
1006
  const name = `${p.emoji ? `${p.emoji} ` : ''}${p.name}${p.pronouns ? ` (${p.pronouns})` : ''}`;
982
1007
  out(`${pad(p.ref, 34)} ${pad(p.kind ?? '', 12)} ${name}${p.claimed ? ' (claimed)' : ''}`);
1008
+ const work = professionalLine(p);
1009
+ if (work) out(` ${work}`);
983
1010
  if (p.headline) out(` ${p.headline}`);
984
1011
  }
985
1012
  if (profiles.length === 0) out('(nobody yet)');