@oneie/cli 0.2.0

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.
@@ -0,0 +1,113 @@
1
+ // Mirror of web/src/lib/skill/parser.ts — keep in sync.
2
+ // TODO: dedupe via @oneie/sdk export once SDK ships skill helpers.
3
+ function parseFrontmatter(yaml) {
4
+ const meta = {};
5
+ const lines = yaml.split('\n');
6
+ let i = 0;
7
+ while (i < lines.length) {
8
+ const line = lines[i];
9
+ if (!line.trim() || line.trim().startsWith('#')) {
10
+ i++;
11
+ continue;
12
+ }
13
+ let col = line.indexOf(': ');
14
+ let inlineStart = col === -1 ? -1 : col + 2;
15
+ if (col === -1 && /^[A-Za-z0-9_-]+:\s*$/.test(line)) {
16
+ col = line.indexOf(':');
17
+ inlineStart = line.length;
18
+ }
19
+ if (col === -1) {
20
+ i++;
21
+ continue;
22
+ }
23
+ const key = line.slice(0, col).trim();
24
+ if (!key) {
25
+ i++;
26
+ continue;
27
+ }
28
+ const inline = line.slice(inlineStart).trim();
29
+ const arr = [];
30
+ let j = i + 1;
31
+ while (j < lines.length && lines[j].trim().startsWith('- ')) {
32
+ arr.push(lines[j].trim().slice(2));
33
+ j++;
34
+ }
35
+ if (arr.length > 0) {
36
+ meta[key] = arr;
37
+ i = j;
38
+ }
39
+ else {
40
+ meta[key] = inline === '' ? true : inline;
41
+ i++;
42
+ }
43
+ }
44
+ return meta;
45
+ }
46
+ const FENCE = /^---\s*$/m;
47
+ function firstParagraph(body) {
48
+ const trimmed = body.trim();
49
+ if (!trimmed)
50
+ return undefined;
51
+ for (const chunk of trimmed.split(/\n\s*\n/)) {
52
+ const para = chunk.split('\n').filter(l => !l.startsWith('#')).join(' ').trim();
53
+ if (para)
54
+ return para;
55
+ }
56
+ return undefined;
57
+ }
58
+ export function parse(md, opts = {}) {
59
+ const diagnostics = [];
60
+ const parts = md.split(FENCE);
61
+ let meta = {};
62
+ let body;
63
+ if (parts.length < 3) {
64
+ body = md.trim();
65
+ if (opts.pathStem) {
66
+ meta.name = opts.pathStem;
67
+ diagnostics.push({ level: 'warn', code: 'no-frontmatter', message: `No frontmatter; deriving name='${opts.pathStem}' from path` });
68
+ }
69
+ else {
70
+ diagnostics.push({ level: 'warn', code: 'no-frontmatter', message: 'No frontmatter and no pathStem provided' });
71
+ }
72
+ }
73
+ else {
74
+ const yaml = parts[1];
75
+ body = parts.slice(2).join('---').trim();
76
+ try {
77
+ meta = parseFrontmatter(yaml);
78
+ }
79
+ catch {
80
+ const cleaned = yaml.split('\n').filter(l => !l.match(/^[^:#][^:]*:[^:]*:[^:]*/)).join('\n');
81
+ meta = parseFrontmatter(cleaned);
82
+ diagnostics.push({ level: 'warn', code: 'lenient-yaml', message: 'Frontmatter required lenient retry (unquoted colons)' });
83
+ }
84
+ }
85
+ if (!meta.name && opts.pathStem) {
86
+ meta.name = opts.pathStem;
87
+ diagnostics.push({ level: 'warn', code: 'missing-name', message: `Missing name; using path stem '${opts.pathStem}'` });
88
+ }
89
+ if (opts.pathStem && meta.name && meta.name !== opts.pathStem) {
90
+ diagnostics.push({ level: 'warn', code: 'name-mismatch', message: `name='${String(meta.name)}' does not match path stem '${opts.pathStem}'` });
91
+ }
92
+ if (typeof meta.name === 'string' && meta.name.length > 64) {
93
+ diagnostics.push({ level: 'warn', code: 'name-too-long', message: `name length ${meta.name.length} exceeds 64 chars` });
94
+ }
95
+ if (!meta.description) {
96
+ const para = firstParagraph(body);
97
+ if (para) {
98
+ meta.description = para;
99
+ diagnostics.push({ level: 'info', code: 'description-from-body', message: 'Derived description from first body paragraph' });
100
+ }
101
+ }
102
+ const triggersStr = typeof meta.triggers === 'string'
103
+ ? meta.triggers
104
+ : Array.isArray(meta.triggers)
105
+ ? meta.triggers.map(String).join(', ')
106
+ : '';
107
+ if (triggersStr) {
108
+ const base = typeof meta.description === 'string' ? meta.description : '';
109
+ meta.description = base ? `${base} Triggers: ${triggersStr}` : `Triggers: ${triggersStr}`;
110
+ diagnostics.push({ level: 'info', code: 'triggers-merged', message: "'triggers' field merged into description" });
111
+ }
112
+ return { meta, body, diagnostics };
113
+ }
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function skillCmd(): Command;
@@ -0,0 +1,326 @@
1
+ import { Command } from 'commander';
2
+ import { readFileSync, writeFileSync, existsSync, mkdirSync, statSync, readdirSync } from 'node:fs';
3
+ import { resolve, basename, join } from 'node:path';
4
+ import { homedir } from 'node:os';
5
+ import { parse as parseSkill } from './skill-parser.js';
6
+ export function skillCmd() {
7
+ const cmd = new Command('skill').description('Skill management');
8
+ cmd.command('new <name>')
9
+ .description('Scaffold a new skill from template (includes 3 example evals)')
10
+ .action((name) => {
11
+ const body = [
12
+ '---',
13
+ `name: ${name}`,
14
+ `title: ${name}`,
15
+ 'summary: ',
16
+ 'description: Use when ',
17
+ 'tags: []',
18
+ 'price: 0.02',
19
+ 'evals:',
20
+ ' - prompt: Replace with a representative request your skill should handle.',
21
+ ' assertions:',
22
+ ' - Produces the expected outcome',
23
+ ' - Tone matches the skill description',
24
+ ' - prompt: Edge case — replace with a tricky input.',
25
+ ' assertions:',
26
+ ' - Handles the edge case correctly',
27
+ ' - Does not invent facts',
28
+ ' - prompt: Negative case — input the skill should refuse or redirect.',
29
+ ' assertions:',
30
+ ' - Declines or redirects politely',
31
+ ' - Suggests the right next step',
32
+ '---',
33
+ '',
34
+ `# ${name}`,
35
+ '',
36
+ 'Skill behavior here.',
37
+ '',
38
+ ].join('\n');
39
+ mkdirSync('skills', { recursive: true });
40
+ const path = `skills/${name}.md`;
41
+ writeFileSync(path, body);
42
+ out(cmd, { ok: true, path, lines: body.split('\n').length });
43
+ });
44
+ cmd.command('emit <path>')
45
+ .description('Emit agentskills.io directory format from flat skill.md')
46
+ .option('--out <dir>', 'Output directory', './')
47
+ .action((path, opts) => {
48
+ if (!existsSync(path)) {
49
+ out(cmd, { ok: false, error: `not found: ${path}` });
50
+ return;
51
+ }
52
+ const name = basename(path, '.md');
53
+ const outDir = resolve(opts.out, name);
54
+ mkdirSync(outDir, { recursive: true });
55
+ const content = readFileSync(path, 'utf8');
56
+ writeFileSync(resolve(outDir, 'SKILL.md'), content);
57
+ out(cmd, { ok: true, source: path, emitted: outDir, files: ['SKILL.md'] });
58
+ });
59
+ cmd.command('publish <path>')
60
+ .description('Publish skill to agentskills.io directory')
61
+ .action((path) => {
62
+ if (!existsSync(path)) {
63
+ out(cmd, { ok: false, error: `not found: ${path}` });
64
+ return;
65
+ }
66
+ out(cmd, { ok: false, reason: 'agentskills.io API key required — set AGENTSKILLS_API_KEY' });
67
+ });
68
+ cmd.command('refresh <slug> [refs...]')
69
+ .description('Re-fetch remote imported skills for a slug')
70
+ .action((slug, refs) => {
71
+ out(cmd, { ok: true, slug, refreshed: 0, failed: 0, total: refs.length });
72
+ });
73
+ cmd.command('import <ref>')
74
+ .description('Import a skill from URL, npm, or github shorthand')
75
+ .option('--slug <slug>', 'Owner slug', process.env.ONEIE_SLUG ?? 'local')
76
+ .option('--price <usd>', 'Price USD', '0.02')
77
+ .option('--name <name>', 'Override skill name')
78
+ .option('--yes', 'Skip approval prompt (CI-friendly)')
79
+ .action(async (ref, opts) => {
80
+ const keyFile = resolve(homedir(), '.config', 'oneie', 'key');
81
+ const token = process.env.ONEIE_API_KEY ?? (existsSync(keyFile) ? readFileSync(keyFile, 'utf8').trim() : '');
82
+ if (!token) {
83
+ out(cmd, { ok: false, error: 'not authenticated — run `oneie auth login`' });
84
+ return;
85
+ }
86
+ const baseUrl = process.env.ONEIE_BASE_URL ?? 'https://one.ie';
87
+ try {
88
+ const res = await fetch(`${baseUrl}/api/skill/import`, {
89
+ method: 'POST',
90
+ headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` },
91
+ body: JSON.stringify({ ref, slug: opts.slug, price: Number(opts.price), name: opts.name }),
92
+ });
93
+ const data = await res.json().catch(() => ({}));
94
+ if (!res.ok) {
95
+ out(cmd, { ok: false, status: res.status, ...data });
96
+ return;
97
+ }
98
+ out(cmd, {
99
+ ok: true,
100
+ ref,
101
+ slug: opts.slug,
102
+ name: data?.skill?.name,
103
+ price: data?.skill?.price,
104
+ key: data?.key,
105
+ diagnostics: data?.diagnostics ?? [],
106
+ });
107
+ }
108
+ catch (err) {
109
+ out(cmd, { ok: false, error: err.message, hint: 'try `oneie skill validate <path>` for offline validation' });
110
+ }
111
+ });
112
+ cmd.command('list')
113
+ .description('List skills imported into a workspace')
114
+ .requiredOption('--slug <slug>', 'Workspace slug')
115
+ .option('--api <url>', 'API base URL', 'https://one.ie')
116
+ .action(async (opts) => {
117
+ const keyFile = resolve(homedir(), '.config', 'oneie', 'key');
118
+ const key = process.env.ONEIE_API_KEY ?? (existsSync(keyFile) ? readFileSync(keyFile, 'utf8').trim() : '');
119
+ if (!key) {
120
+ out(cmd, { ok: false, error: 'no API key — run `oneie auth login`' });
121
+ return;
122
+ }
123
+ const token = `${opts.slug}:${key}`;
124
+ try {
125
+ const res = await fetch(`${opts.api.replace(/\/$/, '')}/api/skills/workspace?slug=${encodeURIComponent(opts.slug)}`, {
126
+ headers: { Authorization: `Bearer ${token}` },
127
+ });
128
+ const data = await res.json();
129
+ if (!res.ok) {
130
+ out(cmd, { ok: false, status: res.status, error: data.error ?? 'list failed' });
131
+ return;
132
+ }
133
+ out(cmd, { ok: true, ...data });
134
+ }
135
+ catch (err) {
136
+ out(cmd, { ok: false, error: err.message });
137
+ }
138
+ });
139
+ cmd.command('unimport <name>')
140
+ .description('Remove an imported skill from a workspace')
141
+ .requiredOption('--slug <slug>', 'Workspace slug')
142
+ .option('--api <url>', 'API base URL', 'https://one.ie')
143
+ .action(async (name, opts) => {
144
+ const keyFile = resolve(homedir(), '.config', 'oneie', 'key');
145
+ const key = process.env.ONEIE_API_KEY ?? (existsSync(keyFile) ? readFileSync(keyFile, 'utf8').trim() : '');
146
+ if (!key) {
147
+ out(cmd, { ok: false, error: 'no API key — run `oneie auth login`' });
148
+ return;
149
+ }
150
+ const token = `${opts.slug}:${key}`;
151
+ try {
152
+ const res = await fetch(`${opts.api.replace(/\/$/, '')}/api/skill/${encodeURIComponent(name)}?slug=${encodeURIComponent(opts.slug)}`, {
153
+ method: 'DELETE',
154
+ headers: { Authorization: `Bearer ${token}` },
155
+ });
156
+ const data = await res.json();
157
+ if (!res.ok) {
158
+ out(cmd, { ok: false, status: res.status, error: data.error ?? 'unimport failed' });
159
+ return;
160
+ }
161
+ out(cmd, { ok: true, ...data });
162
+ }
163
+ catch (err) {
164
+ out(cmd, { ok: false, error: err.message });
165
+ }
166
+ });
167
+ cmd.command('validate <path>')
168
+ .description('Validate a skill file or directory; reports diagnostics')
169
+ .action((path) => {
170
+ if (!existsSync(path)) {
171
+ out(cmd, { ok: false, error: `not found: ${path}` });
172
+ return;
173
+ }
174
+ const targets = [];
175
+ const walk = (dir, depth) => {
176
+ if (depth > 4)
177
+ return;
178
+ const skillMd = join(dir, 'SKILL.md');
179
+ if (existsSync(skillMd) && statSync(skillMd).isFile()) {
180
+ targets.push({ file: skillMd, stem: basename(dir) });
181
+ return;
182
+ }
183
+ for (const entry of readdirSync(dir)) {
184
+ if (entry.startsWith('.') || entry === 'node_modules')
185
+ continue;
186
+ const full = join(dir, entry);
187
+ const sub = statSync(full);
188
+ if (sub.isFile() && entry.endsWith('.md') && entry !== 'SKILL.md') {
189
+ targets.push({ file: full, stem: basename(entry, '.md') });
190
+ }
191
+ else if (sub.isDirectory()) {
192
+ walk(full, depth + 1);
193
+ }
194
+ }
195
+ };
196
+ const st = statSync(path);
197
+ if (st.isDirectory()) {
198
+ walk(path, 0);
199
+ }
200
+ else {
201
+ const stem = path.endsWith('/SKILL.md')
202
+ ? basename(resolve(path, '..'))
203
+ : basename(path, '.md');
204
+ targets.push({ file: path, stem });
205
+ }
206
+ const results = targets.map(t => {
207
+ const text = readFileSync(t.file, 'utf8');
208
+ const parsed = parseSkill(text, { pathStem: t.stem });
209
+ const warns = parsed.diagnostics.filter((d) => d.level === 'warn');
210
+ return {
211
+ file: t.file,
212
+ name: parsed.meta.name ?? null,
213
+ ok: typeof parsed.meta.name === 'string' && !!parsed.meta.description,
214
+ diagnostics: parsed.diagnostics,
215
+ warnCount: warns.length,
216
+ };
217
+ });
218
+ const okCount = results.filter(r => r.ok).length;
219
+ out(cmd, { ok: okCount === results.length, total: results.length, passed: okCount, results });
220
+ });
221
+ cmd.command('eval <path>')
222
+ .description('Run skill evals from frontmatter evals[] via POST /api/eval')
223
+ .option('--slug <slug>', 'Workspace slug', process.env.ONEIE_SLUG ?? 'local')
224
+ .option('--api <url>', 'API base URL', process.env.ONEIE_BASE_URL ?? 'https://one.ie')
225
+ .option('--iteration <n>', 'Iteration number', '1')
226
+ .action(async (path, opts) => {
227
+ if (!existsSync(path)) {
228
+ out(cmd, { ok: false, error: `not found: ${path}` });
229
+ return;
230
+ }
231
+ const keyFile = resolve(homedir(), '.config', 'oneie', 'key');
232
+ const token = process.env.ONEIE_API_KEY ?? (existsSync(keyFile) ? readFileSync(keyFile, 'utf8').trim() : '');
233
+ if (!token) {
234
+ out(cmd, { ok: false, error: 'not authenticated — run `oneie auth login`' });
235
+ return;
236
+ }
237
+ const content = readFileSync(path, 'utf8');
238
+ const parsed = parseSkill(content, { pathStem: basename(path, '.md') });
239
+ const skillName = typeof parsed.meta.name === 'string' ? parsed.meta.name : basename(path, '.md');
240
+ const evals = extractEvals(content);
241
+ if (!evals.length) {
242
+ out(cmd, { ok: false, error: 'no evals found in frontmatter — add an evals: block (see `oneie skill new`)' });
243
+ return;
244
+ }
245
+ try {
246
+ const res = await fetch(`${opts.api.replace(/\/$/, '')}/api/eval`, {
247
+ method: 'POST',
248
+ headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${opts.slug}:${token}` },
249
+ body: JSON.stringify({ slug: opts.slug, skillPath: skillName, iteration: Number(opts.iteration), draftContent: content, draftEvals: evals }),
250
+ });
251
+ const data = await res.json().catch(() => ({}));
252
+ if (!res.ok) {
253
+ out(cmd, { ok: false, status: res.status, error: data?.error ?? 'eval failed' });
254
+ return;
255
+ }
256
+ const b = data?.benchmark;
257
+ const m = data?.mastery;
258
+ out(cmd, {
259
+ ok: true,
260
+ skill: skillName,
261
+ cases: evals.length,
262
+ pass_rate: b?.with_skill?.pass_rate,
263
+ delta_pass: b?.delta?.pass_rate,
264
+ mastery_level: m?.level,
265
+ mastery_prob: m?.prob,
266
+ });
267
+ }
268
+ catch (err) {
269
+ out(cmd, { ok: false, error: err.message });
270
+ }
271
+ });
272
+ return cmd;
273
+ }
274
+ function extractEvals(content) {
275
+ const fm = content.match(/^---\n([\s\S]*?)\n---/)?.[1];
276
+ if (!fm)
277
+ return [];
278
+ const lines = fm.split('\n');
279
+ const startIdx = lines.findIndex(l => /^evals:\s*$/.test(l));
280
+ if (startIdx < 0)
281
+ return [];
282
+ const cases = [];
283
+ let cur = null;
284
+ let inAssertions = false;
285
+ for (let i = startIdx + 1; i < lines.length; i++) {
286
+ const line = lines[i];
287
+ if (/^[A-Za-z_][\w-]*:/.test(line))
288
+ break;
289
+ const promptMatch = line.match(/^\s+-\s+prompt:\s*(.+?)\s*$/);
290
+ if (promptMatch) {
291
+ if (cur)
292
+ cases.push(cur);
293
+ cur = { prompt: promptMatch[1].replace(/^["']|["']$/g, ''), assertions: [] };
294
+ inAssertions = false;
295
+ continue;
296
+ }
297
+ if (!cur)
298
+ continue;
299
+ if (/^\s+assertions:\s*$/.test(line)) {
300
+ inAssertions = true;
301
+ continue;
302
+ }
303
+ const itemMatch = line.match(/^\s+-\s+(.+?)\s*$/);
304
+ if (itemMatch && inAssertions)
305
+ cur.assertions.push(itemMatch[1].replace(/^["']|["']$/g, ''));
306
+ }
307
+ if (cur)
308
+ cases.push(cur);
309
+ return cases;
310
+ }
311
+ function out(cmd, data) {
312
+ const isJson = cmd.parent?.opts().json;
313
+ if (isJson) {
314
+ process.stdout.write(JSON.stringify(data) + '\n');
315
+ }
316
+ else if (data.ok) {
317
+ const pairs = Object.entries(data)
318
+ .filter(([k]) => k !== 'ok')
319
+ .map(([k, v]) => `${k}=${JSON.stringify(v)}`)
320
+ .join(' ');
321
+ console.log('✓', pairs);
322
+ }
323
+ else {
324
+ console.error('✗', String(data.error ?? data.reason ?? JSON.stringify(data)));
325
+ }
326
+ }
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function socialCmd(): Command;
@@ -0,0 +1,109 @@
1
+ import { Command } from 'commander';
2
+ import { existsSync, readFileSync } from 'node:fs';
3
+ import { homedir } from 'node:os';
4
+ import { resolve } from 'node:path';
5
+ const DEFAULT_API = 'https://one.ie';
6
+ const KEY_FILE = resolve(homedir(), '.config', 'oneie', 'key');
7
+ function readApiKey() {
8
+ if (process.env.ONEIE_API_KEY)
9
+ return process.env.ONEIE_API_KEY;
10
+ if (existsSync(KEY_FILE))
11
+ return readFileSync(KEY_FILE, 'utf8').trim() || null;
12
+ return null;
13
+ }
14
+ function out(cmd, data) {
15
+ const isJson = cmd.parent?.parent?.opts().json;
16
+ if (isJson) {
17
+ process.stdout.write(JSON.stringify(data) + '\n');
18
+ }
19
+ else if (data.ok) {
20
+ const pairs = Object.entries(data)
21
+ .filter(([k]) => k !== 'ok')
22
+ .map(([k, v]) => `${k}=${JSON.stringify(v)}`);
23
+ process.stdout.write(`ok ${pairs.join(' ')}\n`);
24
+ }
25
+ else {
26
+ process.stderr.write(`error ${data.error ?? 'unknown'}\n`);
27
+ process.exit(1);
28
+ }
29
+ }
30
+ export function socialCmd() {
31
+ const cmd = new Command('social').description('Social post management');
32
+ cmd
33
+ .command('list')
34
+ .description('List social posts for a group')
35
+ .requiredOption('--group <groupId>', 'Group ID')
36
+ .option('--status <status>', 'Filter: draft|scheduled|publishing|published|failed')
37
+ .option('--limit <n>', 'Max results', '50')
38
+ .option('--api <url>', 'API base URL', DEFAULT_API)
39
+ .action(async (opts) => {
40
+ const key = readApiKey();
41
+ const base = opts.api.replace(/\/$/, '');
42
+ const params = new URLSearchParams({ groupId: opts.group, limit: opts.limit });
43
+ if (opts.status)
44
+ params.set('status', opts.status);
45
+ const res = await fetch(`${base}/api/social/posts?${params}`, {
46
+ headers: key ? { Authorization: `Bearer ${key}` } : {},
47
+ });
48
+ if (!res.ok) {
49
+ out(cmd, { ok: false, error: `${res.status}` });
50
+ return;
51
+ }
52
+ const data = await res.json();
53
+ out(cmd, { ok: true, posts: data.posts, count: data.posts.length });
54
+ });
55
+ cmd
56
+ .command('create')
57
+ .description('Create a draft social post')
58
+ .requiredOption('--group <groupId>', 'Group ID')
59
+ .requiredOption('--content <text>', 'Post content')
60
+ .requiredOption('--platforms <list>', 'Comma-separated platforms (twitter,linkedin,...)')
61
+ .option('--schedule <epoch>', 'Scheduled publish time (Unix epoch seconds)')
62
+ .option('--api <url>', 'API base URL', DEFAULT_API)
63
+ .action(async (opts) => {
64
+ const key = readApiKey();
65
+ if (!key) {
66
+ out(cmd, { ok: false, error: 'no API key — run: oneie auth login' });
67
+ return;
68
+ }
69
+ const base = opts.api.replace(/\/$/, '');
70
+ const platforms = opts.platforms.split(',').map((p) => p.trim());
71
+ const body = { groupId: opts.group, content: opts.content, platforms };
72
+ if (opts.schedule)
73
+ body.scheduledAt = parseInt(opts.schedule, 10);
74
+ const res = await fetch(`${base}/api/social/posts`, {
75
+ method: 'POST',
76
+ headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${key}` },
77
+ body: JSON.stringify(body),
78
+ });
79
+ if (!res.ok) {
80
+ const text = await res.text();
81
+ out(cmd, { ok: false, error: `${res.status}: ${text}` });
82
+ return;
83
+ }
84
+ const data = await res.json();
85
+ out(cmd, { ok: true, id: data.post.id, status: data.post.status });
86
+ });
87
+ cmd
88
+ .command('accounts')
89
+ .description('List connected social accounts for the authenticated user')
90
+ .option('--api <url>', 'API base URL', DEFAULT_API)
91
+ .action(async (opts) => {
92
+ const key = readApiKey();
93
+ if (!key) {
94
+ out(cmd, { ok: false, error: 'no API key — run: oneie auth login' });
95
+ return;
96
+ }
97
+ const base = opts.api.replace(/\/$/, '');
98
+ const res = await fetch(`${base}/api/social/accounts`, {
99
+ headers: { Authorization: `Bearer ${key}` },
100
+ });
101
+ if (!res.ok) {
102
+ out(cmd, { ok: false, error: `${res.status}` });
103
+ return;
104
+ }
105
+ const data = await res.json();
106
+ out(cmd, { ok: true, accounts: data.accounts, count: data.accounts.length });
107
+ });
108
+ return cmd;
109
+ }
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function substrateCommands(program: Command): void;