@chainvue/cli 0.1.0 → 0.1.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.
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command as Command8 } from "commander";
6
6
  // src/commands/login.ts
7
7
  import { Command } from "commander";
8
8
  import ora from "ora";
9
- import chalk2 from "chalk";
9
+ import chalk3 from "chalk";
10
10
 
11
11
  // src/lib/api.ts
12
12
  import { request } from "undici";
@@ -84,12 +84,26 @@ async function getAuthHeader(profile) {
84
84
  }
85
85
 
86
86
  // src/lib/api.ts
87
+ import chalk from "chalk";
88
+ var CLI_VERSION = true ? "0.1.1" : "0.0.0-dev";
89
+ var USER_AGENT = `ChainVue-CLI/${CLI_VERSION} (${process.platform}; node/${process.version.slice(1)})`;
90
+ var updateNoticeShown = false;
91
+ function checkForUpdate(headers) {
92
+ if (updateNoticeShown) return;
93
+ const latestVersion = headers["x-chainvue-latest-cli"];
94
+ if (!latestVersion || latestVersion === CLI_VERSION) return;
95
+ updateNoticeShown = true;
96
+ console.error();
97
+ console.error(chalk.yellow(` Update available: ${CLI_VERSION} \u2192 ${latestVersion}`));
98
+ console.error(chalk.dim(` Run: npm install -g @chainvue/cli`));
99
+ console.error();
100
+ }
87
101
  async function apiRequest(method, path2, body, authRequired = true) {
88
102
  const endpoint = getApiEndpoint();
89
103
  const url = `${endpoint}${path2}`;
90
104
  const headers = {
91
105
  "Content-Type": "application/json",
92
- "User-Agent": "ChainVue-CLI/0.1.0"
106
+ "User-Agent": USER_AGENT
93
107
  };
94
108
  if (authRequired) {
95
109
  const profile = getCurrentProfile();
@@ -116,6 +130,7 @@ async function apiRequest(method, path2, body, authRequired = true) {
116
130
  headers,
117
131
  body: body ? JSON.stringify(body) : void 0
118
132
  });
133
+ checkForUpdate(response.headers);
119
134
  const text = await response.body.text();
120
135
  let data;
121
136
  try {
@@ -167,7 +182,7 @@ async function graphqlQuery(query, variables) {
167
182
  headers: {
168
183
  "Content-Type": "application/json",
169
184
  "Authorization": auth,
170
- "User-Agent": "ChainVue-CLI/0.1.0"
185
+ "User-Agent": USER_AGENT
171
186
  },
172
187
  body: JSON.stringify({ query, variables })
173
188
  });
@@ -201,29 +216,29 @@ async function pollDeviceToken(deviceCode) {
201
216
  }
202
217
 
203
218
  // src/lib/output.ts
204
- import chalk from "chalk";
219
+ import chalk2 from "chalk";
205
220
  import Table from "cli-table3";
206
221
  function success(message) {
207
- console.log(chalk.green("\u2713") + " " + message);
222
+ console.log(chalk2.green("\u2713") + " " + message);
208
223
  }
209
224
  function error(message) {
210
- console.log(chalk.red("\u2717") + " " + message);
225
+ console.log(chalk2.red("\u2717") + " " + message);
211
226
  }
212
227
  function warn(message) {
213
- console.log(chalk.yellow("!") + " " + message);
228
+ console.log(chalk2.yellow("!") + " " + message);
214
229
  }
215
230
  function info(message) {
216
- console.log(chalk.blue("\u2192") + " " + message);
231
+ console.log(chalk2.blue("\u2192") + " " + message);
217
232
  }
218
233
  function dim(message) {
219
- console.log(chalk.dim(message));
234
+ console.log(chalk2.dim(message));
220
235
  }
221
236
  function json(data) {
222
237
  console.log(JSON.stringify(data, null, 2));
223
238
  }
224
239
  function table(headers, rows, options = {}) {
225
240
  const t = new Table({
226
- head: headers.map((h) => chalk.bold(h)),
241
+ head: headers.map((h) => chalk2.bold(h)),
227
242
  style: {
228
243
  head: [],
229
244
  border: ["dim"]
@@ -238,8 +253,8 @@ function keyValue(data) {
238
253
  const maxKeyLength = Math.max(...Object.keys(data).map((k) => k.length));
239
254
  for (const [key, value] of Object.entries(data)) {
240
255
  const paddedKey = key.padEnd(maxKeyLength);
241
- const displayValue = value === null || value === void 0 ? chalk.dim("\u2014") : String(value);
242
- console.log(`${chalk.bold(paddedKey)} ${displayValue}`);
256
+ const displayValue = value === null || value === void 0 ? chalk2.dim("\u2014") : String(value);
257
+ console.log(`${chalk2.bold(paddedKey)} ${displayValue}`);
243
258
  }
244
259
  }
245
260
  function formatTimeAgo(date) {
@@ -297,13 +312,13 @@ async function loginWithDeviceFlow() {
297
312
  const { deviceCode, userCode, verificationUri, expiresIn, interval } = deviceResponse.data;
298
313
  spinner.stop();
299
314
  console.log();
300
- console.log(chalk2.bold(" To complete login, visit:"));
315
+ console.log(chalk3.bold(" To complete login, visit:"));
301
316
  console.log();
302
- console.log(chalk2.cyan(` ${verificationUri}`));
317
+ console.log(chalk3.cyan(` ${verificationUri}`));
303
318
  console.log();
304
- console.log(chalk2.bold(" And enter this code:"));
319
+ console.log(chalk3.bold(" And enter this code:"));
305
320
  console.log();
306
- console.log(chalk2.yellow.bold(` ${userCode}`));
321
+ console.log(chalk3.yellow.bold(` ${userCode}`));
307
322
  console.log();
308
323
  const pollSpinner = ora("Waiting for authorization...").start();
309
324
  const expiresAt = Date.now() + expiresIn * 1e3;
@@ -612,7 +627,7 @@ var queryCommand = new Command6("query").description("Execute a GraphQL query").
612
627
  // src/commands/org.ts
613
628
  import { Command as Command7 } from "commander";
614
629
  import ora5 from "ora";
615
- import chalk3 from "chalk";
630
+ import chalk4 from "chalk";
616
631
  var orgCommand = new Command7("org").description("Manage organizations");
617
632
  orgCommand.command("list").description("List your organizations").option("--json", "Output as JSON").action(async (options) => {
618
633
  const spinner = ora5("Fetching organizations...").start();
@@ -636,8 +651,8 @@ orgCommand.command("list").description("List your organizations").option("--json
636
651
  console.log();
637
652
  for (const org of orgs) {
638
653
  const isCurrent = org.id === currentProfile?.orgId;
639
- const marker = isCurrent ? chalk3.green("\u25B6 ") : " ";
640
- const name = isCurrent ? chalk3.bold(org.name) : org.name;
654
+ const marker = isCurrent ? chalk4.green("\u25B6 ") : " ";
655
+ const name = isCurrent ? chalk4.bold(org.name) : org.name;
641
656
  console.log(`${marker}${name}`);
642
657
  console.log(` ID: ${org.id}`);
643
658
  console.log(` Role: ${org.role} Plan: ${org.plan}`);
@@ -681,7 +696,7 @@ orgCommand.command("current").description("Show current organization").action(as
681
696
 
682
697
  // src/index.ts
683
698
  var program = new Command8();
684
- program.name("chainvue").description("ChainVue CLI - Manage your blockchain infrastructure").version("0.1.0");
699
+ program.name("chainvue").description("ChainVue CLI - Manage your blockchain infrastructure").version(CLI_VERSION);
685
700
  program.addCommand(loginCommand);
686
701
  program.addCommand(logoutCommand);
687
702
  program.addCommand(whoamiCommand);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/commands/login.ts","../src/lib/api.ts","../src/lib/config.ts","../src/lib/keychain.ts","../src/lib/output.ts","../src/commands/logout.ts","../src/commands/whoami.ts","../src/commands/keys.ts","../src/commands/webhooks.ts","../src/commands/query.ts","../src/commands/org.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from 'commander'\nimport { loginCommand } from './commands/login.js'\nimport { logoutCommand } from './commands/logout.js'\nimport { whoamiCommand } from './commands/whoami.js'\nimport { keysCommand } from './commands/keys.js'\nimport { webhooksCommand } from './commands/webhooks.js'\nimport { queryCommand } from './commands/query.js'\nimport { orgCommand } from './commands/org.js'\n\nconst program = new Command()\n\nprogram\n .name('chainvue')\n .description('ChainVue CLI - Manage your blockchain infrastructure')\n .version('0.1.0')\n\n// Auth commands\nprogram.addCommand(loginCommand)\nprogram.addCommand(logoutCommand)\nprogram.addCommand(whoamiCommand)\n\n// Management commands\nprogram.addCommand(keysCommand)\nprogram.addCommand(webhooksCommand)\nprogram.addCommand(orgCommand)\n\n// Query command\nprogram.addCommand(queryCommand)\n\n// Parse arguments\nprogram.parse()\n","import { Command } from 'commander'\nimport ora from 'ora'\nimport chalk from 'chalk'\nimport { requestDeviceCode, pollDeviceToken } from '../lib/api.js'\nimport { saveCredentials, getCredentials } from '../lib/keychain.js'\nimport { setCurrentProfile, getCurrentProfile } from '../lib/config.js'\nimport * as output from '../lib/output.js'\n\nexport const loginCommand = new Command('login')\n .description('Log in to ChainVue')\n .option('--api-key <key>', 'Login with an API key (for CI/CD)')\n .action(async (options) => {\n // Check if already logged in\n const existing = getCurrentProfile()\n if (existing) {\n output.warn(`Already logged in as ${existing.email}`)\n output.dim('Run \"chainvue logout\" first to switch accounts')\n return\n }\n\n // API key login (for CI/CD)\n if (options.apiKey) {\n await loginWithApiKey(options.apiKey)\n return\n }\n\n // OAuth Device Flow\n await loginWithDeviceFlow()\n })\n\nasync function loginWithApiKey(apiKey: string): Promise<void> {\n const spinner = ora('Validating API key...').start()\n\n // Validate key format\n if (!apiKey.startsWith('cv_api_') && !apiKey.startsWith('cv_agent_')) {\n spinner.fail('Invalid API key format')\n output.dim('API keys should start with cv_api_ or cv_agent_')\n return\n }\n\n // TODO: Validate key by calling /api/v1/auth/me\n // For now, just store it\n\n await saveCredentials('default', { apiKey, accessToken: '' })\n\n // We don't have user info with just API key, so create minimal profile\n setCurrentProfile('default', {\n orgId: 'unknown',\n orgName: 'API Key Auth',\n email: 'api-key',\n clerkUserId: '',\n environment: apiKey.includes('_live_') ? 'live' : 'test',\n })\n\n spinner.succeed('Logged in with API key')\n output.dim('Note: Some commands may have limited functionality with API key auth')\n}\n\nasync function loginWithDeviceFlow(): Promise<void> {\n const spinner = ora('Requesting device code...').start()\n\n // Step 1: Request device code\n const deviceResponse = await requestDeviceCode()\n\n if (!deviceResponse.ok || !deviceResponse.data) {\n spinner.fail('Failed to start login')\n output.error(deviceResponse.error || 'Unknown error')\n return\n }\n\n const { deviceCode, userCode, verificationUri, expiresIn, interval } = deviceResponse.data\n\n spinner.stop()\n\n // Step 2: Display code to user\n console.log()\n console.log(chalk.bold(' To complete login, visit:'))\n console.log()\n console.log(chalk.cyan(` ${verificationUri}`))\n console.log()\n console.log(chalk.bold(' And enter this code:'))\n console.log()\n console.log(chalk.yellow.bold(` ${userCode}`))\n console.log()\n\n // Step 3: Poll for token\n const pollSpinner = ora('Waiting for authorization...').start()\n\n const expiresAt = Date.now() + expiresIn * 1000\n const pollInterval = Math.max(interval, 5) * 1000\n\n while (Date.now() < expiresAt) {\n await sleep(pollInterval)\n\n const tokenResponse = await pollDeviceToken(deviceCode)\n\n if (tokenResponse.ok && tokenResponse.data) {\n const data = tokenResponse.data as any\n\n if (data.error === 'authorization_pending') {\n // Still waiting\n continue\n }\n\n if (data.accessToken) {\n // Success!\n pollSpinner.succeed('Authorized')\n\n // Save credentials\n await saveCredentials('default', {\n accessToken: data.accessToken,\n refreshToken: data.refreshToken,\n })\n\n // Save profile\n const org = data.organizations[0]\n setCurrentProfile('default', {\n orgId: org.id,\n orgName: org.name,\n email: data.user.email,\n clerkUserId: data.user.id,\n environment: 'live',\n })\n\n console.log()\n output.success(`Logged in as ${data.user.email}`)\n output.success(`Organization: ${org.name}`)\n\n if (data.organizations.length > 1) {\n output.dim(`You have access to ${data.organizations.length} organizations`)\n output.dim('Use \"chainvue org switch\" to change')\n }\n\n return\n }\n }\n\n if (!tokenResponse.ok && tokenResponse.error !== 'authorization_pending') {\n pollSpinner.fail('Authorization failed')\n output.error(tokenResponse.error || 'Unknown error')\n return\n }\n }\n\n pollSpinner.fail('Authorization timed out')\n output.error('Please try again')\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise(resolve => setTimeout(resolve, ms))\n}\n","import { request } from 'undici'\nimport { getApiEndpoint, getCurrentProfile } from './config.js'\nimport { getAuthHeader } from './keychain.js'\n\nexport interface ApiResponse<T = unknown> {\n ok: boolean\n status: number\n data?: T\n error?: string\n}\n\nexport async function apiRequest<T = unknown>(\n method: 'GET' | 'POST' | 'PATCH' | 'DELETE',\n path: string,\n body?: unknown,\n authRequired = true\n): Promise<ApiResponse<T>> {\n const endpoint = getApiEndpoint()\n const url = `${endpoint}${path}`\n\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n 'User-Agent': 'ChainVue-CLI/0.1.0',\n }\n\n if (authRequired) {\n const profile = getCurrentProfile()\n if (!profile) {\n return {\n ok: false,\n status: 401,\n error: 'Not logged in. Run: chainvue login',\n }\n }\n\n const auth = await getAuthHeader('default')\n if (!auth) {\n return {\n ok: false,\n status: 401,\n error: 'No credentials found. Run: chainvue login',\n }\n }\n\n headers['Authorization'] = auth\n }\n\n try {\n const response = await request(url, {\n method,\n headers,\n body: body ? JSON.stringify(body) : undefined,\n })\n\n const text = await response.body.text()\n let data: T | undefined\n\n try {\n data = JSON.parse(text) as T\n } catch {\n // Not JSON response\n }\n\n if (response.statusCode >= 400) {\n return {\n ok: false,\n status: response.statusCode,\n error: (data as any)?.error || `HTTP ${response.statusCode}`,\n data,\n }\n }\n\n return {\n ok: true,\n status: response.statusCode,\n data,\n }\n } catch (err: any) {\n return {\n ok: false,\n status: 0,\n error: err.message || 'Network error',\n }\n }\n}\n\n// GraphQL query\nexport async function graphqlQuery<T = unknown>(\n query: string,\n variables?: Record<string, unknown>\n): Promise<ApiResponse<T>> {\n // GraphQL goes to the NestJS API, not the Next.js app\n const endpoint = 'https://api.chainvue.io/graphql'\n\n const profile = getCurrentProfile()\n if (!profile) {\n return {\n ok: false,\n status: 401,\n error: 'Not logged in. Run: chainvue login',\n }\n }\n\n const auth = await getAuthHeader('default')\n if (!auth) {\n return {\n ok: false,\n status: 401,\n error: 'No credentials found. Run: chainvue login',\n }\n }\n\n try {\n const response = await request(endpoint, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': auth,\n 'User-Agent': 'ChainVue-CLI/0.1.0',\n },\n body: JSON.stringify({ query, variables }),\n })\n\n const data = await response.body.json() as any\n\n if (data.errors) {\n return {\n ok: false,\n status: response.statusCode,\n error: data.errors[0]?.message || 'GraphQL error',\n data,\n }\n }\n\n return {\n ok: true,\n status: response.statusCode,\n data: data.data as T,\n }\n } catch (err: any) {\n return {\n ok: false,\n status: 0,\n error: err.message || 'Network error',\n }\n }\n}\n\n// Device auth flow\nexport async function requestDeviceCode(): Promise<ApiResponse<{\n deviceCode: string\n userCode: string\n verificationUri: string\n expiresIn: number\n interval: number\n}>> {\n return apiRequest('POST', '/api/v1/auth/device', undefined, false)\n}\n\nexport async function pollDeviceToken(deviceCode: string): Promise<ApiResponse<{\n accessToken: string\n refreshToken: string\n user: { id: string; email: string }\n organizations: Array<{ id: string; name: string; role: string }>\n} | { error: string }>> {\n return apiRequest('POST', '/api/v1/auth/device/token', { deviceCode }, false)\n}\n","import Conf from 'conf'\nimport os from 'os'\nimport path from 'path'\n\nexport interface Profile {\n orgId: string\n orgName: string\n email: string\n clerkUserId: string\n environment: 'live' | 'test'\n}\n\nexport interface Config {\n currentProfile: string\n profiles: Record<string, Profile>\n apiEndpoint: string\n}\n\nconst defaults: Config = {\n currentProfile: 'default',\n profiles: {},\n apiEndpoint: 'https://chainvue.io',\n}\n\nexport const config = new Conf<Config>({\n projectName: 'chainvue',\n defaults,\n cwd: path.join(os.homedir(), '.config', 'chainvue'),\n})\n\nexport function getCurrentProfile(): Profile | null {\n const profileName = config.get('currentProfile')\n const profiles = config.get('profiles')\n return profiles[profileName] || null\n}\n\nexport function setCurrentProfile(name: string, profile: Profile): void {\n const profiles = config.get('profiles')\n profiles[name] = profile\n config.set('profiles', profiles)\n config.set('currentProfile', name)\n}\n\nexport function deleteProfile(name: string): void {\n const profiles = config.get('profiles')\n delete profiles[name]\n config.set('profiles', profiles)\n\n if (config.get('currentProfile') === name) {\n const remaining = Object.keys(profiles)\n config.set('currentProfile', remaining[0] || 'default')\n }\n}\n\nexport function listProfiles(): Record<string, Profile> {\n return config.get('profiles')\n}\n\nexport function getApiEndpoint(): string {\n return config.get('apiEndpoint')\n}\n","import keytar from 'keytar'\n\nconst SERVICE_NAME = 'chainvue-cli'\n\nexport interface StoredCredentials {\n accessToken: string\n refreshToken?: string\n apiKey?: string\n}\n\nexport async function saveCredentials(\n profile: string,\n credentials: StoredCredentials\n): Promise<void> {\n await keytar.setPassword(\n SERVICE_NAME,\n profile,\n JSON.stringify(credentials)\n )\n}\n\nexport async function getCredentials(\n profile: string\n): Promise<StoredCredentials | null> {\n const data = await keytar.getPassword(SERVICE_NAME, profile)\n if (!data) return null\n\n try {\n return JSON.parse(data) as StoredCredentials\n } catch {\n return null\n }\n}\n\nexport async function deleteCredentials(profile: string): Promise<boolean> {\n return keytar.deletePassword(SERVICE_NAME, profile)\n}\n\nexport async function hasCredentials(profile: string): Promise<boolean> {\n const creds = await getCredentials(profile)\n return creds !== null\n}\n\n// Get the authorization header value\nexport async function getAuthHeader(profile: string): Promise<string | null> {\n const creds = await getCredentials(profile)\n if (!creds) return null\n\n // Prefer API key if set (for CI/CD use)\n if (creds.apiKey) {\n return `Bearer ${creds.apiKey}`\n }\n\n // Otherwise use session token\n if (creds.accessToken) {\n return `Bearer ${creds.accessToken}`\n }\n\n return null\n}\n","import chalk from 'chalk'\nimport Table from 'cli-table3'\n\nexport function success(message: string): void {\n console.log(chalk.green('✓') + ' ' + message)\n}\n\nexport function error(message: string): void {\n console.log(chalk.red('✗') + ' ' + message)\n}\n\nexport function warn(message: string): void {\n console.log(chalk.yellow('!') + ' ' + message)\n}\n\nexport function info(message: string): void {\n console.log(chalk.blue('→') + ' ' + message)\n}\n\nexport function dim(message: string): void {\n console.log(chalk.dim(message))\n}\n\nexport function json(data: unknown): void {\n console.log(JSON.stringify(data, null, 2))\n}\n\nexport function table(\n headers: string[],\n rows: string[][],\n options: { head?: boolean } = {}\n): void {\n const t = new Table({\n head: headers.map(h => chalk.bold(h)),\n style: {\n head: [],\n border: ['dim'],\n },\n })\n\n for (const row of rows) {\n t.push(row)\n }\n\n console.log(t.toString())\n}\n\nexport function keyValue(data: Record<string, string | number | null | undefined>): void {\n const maxKeyLength = Math.max(...Object.keys(data).map(k => k.length))\n\n for (const [key, value] of Object.entries(data)) {\n const paddedKey = key.padEnd(maxKeyLength)\n const displayValue = value === null || value === undefined\n ? chalk.dim('—')\n : String(value)\n console.log(`${chalk.bold(paddedKey)} ${displayValue}`)\n }\n}\n\nexport function formatTimeAgo(date: Date | string | null): string {\n if (!date) return 'Never'\n\n const d = typeof date === 'string' ? new Date(date) : date\n const now = new Date()\n const seconds = Math.floor((now.getTime() - d.getTime()) / 1000)\n\n if (seconds < 60) return 'Just now'\n if (seconds < 3600) return `${Math.floor(seconds / 60)} min ago`\n if (seconds < 86400) return `${Math.floor(seconds / 3600)} hours ago`\n if (seconds < 604800) return `${Math.floor(seconds / 86400)} days ago`\n\n return d.toLocaleDateString()\n}\n","import { Command } from 'commander'\nimport { deleteCredentials } from '../lib/keychain.js'\nimport { deleteProfile, getCurrentProfile } from '../lib/config.js'\nimport * as output from '../lib/output.js'\n\nexport const logoutCommand = new Command('logout')\n .description('Log out of ChainVue')\n .action(async () => {\n const profile = getCurrentProfile()\n\n if (!profile) {\n output.warn('Not currently logged in')\n return\n }\n\n // Delete credentials from keychain\n await deleteCredentials('default')\n\n // Delete profile from config\n deleteProfile('default')\n\n output.success(`Logged out from ${profile.email}`)\n })\n","import { Command } from 'commander'\nimport { getCurrentProfile, getApiEndpoint } from '../lib/config.js'\nimport { getCredentials } from '../lib/keychain.js'\nimport * as output from '../lib/output.js'\n\nexport const whoamiCommand = new Command('whoami')\n .description('Show current user and organization')\n .option('--json', 'Output as JSON')\n .action(async (options) => {\n const profile = getCurrentProfile()\n\n if (!profile) {\n output.error('Not logged in')\n output.dim('Run: chainvue login')\n process.exit(1)\n }\n\n const creds = await getCredentials('default')\n const authMethod = creds?.apiKey ? 'API Key' : 'Session'\n\n if (options.json) {\n output.json({\n email: profile.email,\n organization: {\n id: profile.orgId,\n name: profile.orgName,\n },\n environment: profile.environment,\n authMethod,\n apiEndpoint: getApiEndpoint(),\n })\n return\n }\n\n console.log()\n output.keyValue({\n 'Email': profile.email,\n 'Organization': profile.orgName,\n 'Org ID': profile.orgId,\n 'Environment': profile.environment,\n 'Auth Method': authMethod,\n 'API Endpoint': getApiEndpoint(),\n })\n console.log()\n })\n","import { Command } from 'commander'\nimport ora from 'ora'\nimport { apiRequest } from '../lib/api.js'\nimport * as output from '../lib/output.js'\n\ninterface ApiKey {\n id: string\n name: string\n keyPrefix: string\n environment: 'TEST' | 'LIVE'\n type: 'api' | 'agent'\n lastUsedAt: string | null\n createdAt: string\n}\n\nexport const keysCommand = new Command('keys')\n .description('Manage API keys')\n\nkeysCommand\n .command('list')\n .description('List all API keys')\n .option('--json', 'Output as JSON')\n .action(async (options) => {\n const spinner = ora('Fetching API keys...').start()\n\n const response = await apiRequest<{ keys: ApiKey[] }>('GET', '/api/v1/keys')\n\n if (!response.ok) {\n spinner.fail('Failed to fetch keys')\n output.error(response.error || 'Unknown error')\n return\n }\n\n spinner.stop()\n\n const keys = response.data?.keys || []\n\n if (options.json) {\n output.json(keys)\n return\n }\n\n if (keys.length === 0) {\n output.info('No API keys found')\n output.dim('Create one with: chainvue keys create --name \"My Key\"')\n return\n }\n\n output.table(\n ['NAME', 'TYPE', 'ENV', 'PREFIX', 'LAST USED', 'CREATED'],\n keys.map(k => [\n k.name,\n k.type,\n k.environment.toLowerCase(),\n k.keyPrefix,\n output.formatTimeAgo(k.lastUsedAt),\n output.formatTimeAgo(k.createdAt),\n ])\n )\n })\n\nkeysCommand\n .command('create')\n .description('Create a new API key')\n .requiredOption('--name <name>', 'Name for the key')\n .option('--type <type>', 'Key type: api or agent', 'api')\n .option('--env <env>', 'Environment: test or live', 'test')\n .action(async (options) => {\n const spinner = ora('Creating API key...').start()\n\n const response = await apiRequest<{\n id: string\n key: string\n keyPrefix: string\n name: string\n environment: string\n }>('POST', '/api/v1/keys', {\n name: options.name,\n type: options.type,\n environment: options.env.toUpperCase(),\n })\n\n if (!response.ok) {\n spinner.fail('Failed to create key')\n output.error(response.error || 'Unknown error')\n return\n }\n\n spinner.succeed('API key created')\n console.log()\n\n const { key, keyPrefix, name, environment } = response.data!\n\n output.keyValue({\n 'Name': name,\n 'Environment': environment.toLowerCase(),\n 'Key': key,\n })\n\n console.log()\n output.warn('Save this key now! You won\\'t be able to see it again.')\n })\n\nkeysCommand\n .command('revoke <id>')\n .description('Revoke an API key')\n .action(async (id) => {\n const spinner = ora('Revoking API key...').start()\n\n const response = await apiRequest('DELETE', `/api/v1/keys/${id}`)\n\n if (!response.ok) {\n spinner.fail('Failed to revoke key')\n output.error(response.error || 'Unknown error')\n return\n }\n\n spinner.succeed('API key revoked')\n })\n","import { Command } from 'commander'\nimport ora from 'ora'\nimport { apiRequest } from '../lib/api.js'\nimport * as output from '../lib/output.js'\n\ninterface Webhook {\n id: string\n url: string\n description?: string\n events: string[]\n chainId: string\n isActive: boolean\n deliveryCount: number\n failureCount: number\n lastTriggeredAt: string | null\n createdAt: string\n}\n\nconst CHAIN_NAMES: Record<string, string> = {\n 'iJhCezBExJHvtyH3fGhNnt2NhU4Ztkf2yq': 'VRSCTEST',\n 'i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV': 'Verus',\n}\n\nexport const webhooksCommand = new Command('webhooks')\n .description('Manage webhooks')\n\nwebhooksCommand\n .command('list')\n .description('List all webhooks')\n .option('--json', 'Output as JSON')\n .action(async (options) => {\n const spinner = ora('Fetching webhooks...').start()\n\n const response = await apiRequest<{ webhooks: Webhook[] }>('GET', '/api/v1/webhooks')\n\n if (!response.ok) {\n spinner.fail('Failed to fetch webhooks')\n output.error(response.error || 'Unknown error')\n return\n }\n\n spinner.stop()\n\n const webhooks = response.data?.webhooks || []\n\n if (options.json) {\n output.json(webhooks)\n return\n }\n\n if (webhooks.length === 0) {\n output.info('No webhooks found')\n output.dim('Create one with: chainvue webhooks create --url https://...')\n return\n }\n\n output.table(\n ['URL', 'CHAIN', 'EVENTS', 'STATUS', 'SUCCESS', 'LAST'],\n webhooks.map(w => {\n const successRate = w.deliveryCount > 0\n ? `${(((w.deliveryCount - w.failureCount) / w.deliveryCount) * 100).toFixed(1)}%`\n : '—'\n\n return [\n w.url.length > 40 ? w.url.slice(0, 37) + '...' : w.url,\n CHAIN_NAMES[w.chainId] || w.chainId.slice(0, 8),\n w.events.length.toString(),\n w.isActive ? 'active' : 'disabled',\n successRate,\n output.formatTimeAgo(w.lastTriggeredAt),\n ]\n })\n )\n })\n\nwebhooksCommand\n .command('create')\n .description('Create a new webhook')\n .requiredOption('--url <url>', 'Webhook endpoint URL (HTTPS)')\n .option('--description <desc>', 'Description')\n .option('--events <events>', 'Comma-separated events', 'address.received')\n .option('--chain <chain>', 'Chain ID or name', 'VRSCTEST')\n .action(async (options) => {\n const spinner = ora('Creating webhook...').start()\n\n // Resolve chain name to ID\n let chainId = options.chain\n if (options.chain === 'VRSCTEST') {\n chainId = 'iJhCezBExJHvtyH3fGhNnt2NhU4Ztkf2yq'\n } else if (options.chain === 'Verus') {\n chainId = 'i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV'\n }\n\n const events = options.events.split(',').map((e: string) => e.trim())\n\n const response = await apiRequest<{\n id: string\n url: string\n secret: string\n events: string[]\n }>('POST', '/api/v1/webhooks', {\n url: options.url,\n description: options.description,\n chainId,\n events,\n })\n\n if (!response.ok) {\n spinner.fail('Failed to create webhook')\n output.error(response.error || 'Unknown error')\n return\n }\n\n spinner.succeed('Webhook created')\n console.log()\n\n const { url, secret, events: createdEvents } = response.data!\n\n output.keyValue({\n 'URL': url,\n 'Events': createdEvents.join(', '),\n 'Secret': secret,\n })\n\n console.log()\n output.warn('Save this secret now! You won\\'t be able to see it again.')\n })\n\nwebhooksCommand\n .command('delete <id>')\n .description('Delete a webhook')\n .action(async (id) => {\n const spinner = ora('Deleting webhook...').start()\n\n const response = await apiRequest('DELETE', `/api/v1/webhooks/${id}`)\n\n if (!response.ok) {\n spinner.fail('Failed to delete webhook')\n output.error(response.error || 'Unknown error')\n return\n }\n\n spinner.succeed('Webhook deleted')\n })\n\nwebhooksCommand\n .command('test <id>')\n .description('Send a test event to a webhook')\n .action(async (id) => {\n const spinner = ora('Sending test event...').start()\n\n const response = await apiRequest<{\n success: boolean\n responseCode: number | null\n responseTime: number | null\n errorMessage: string | null\n }>('POST', `/api/v1/webhooks/${id}/test`)\n\n if (!response.ok) {\n spinner.fail('Failed to send test')\n output.error(response.error || 'Unknown error')\n return\n }\n\n const result = response.data!\n\n if (result.success) {\n spinner.succeed(`Test delivered (${result.responseCode}, ${result.responseTime}ms)`)\n } else {\n spinner.fail(`Test failed: ${result.errorMessage}`)\n }\n })\n","import { Command } from 'commander'\nimport { readFileSync } from 'fs'\nimport ora from 'ora'\nimport { graphqlQuery } from '../lib/api.js'\nimport * as output from '../lib/output.js'\n\nexport const queryCommand = new Command('query')\n .description('Execute a GraphQL query')\n .argument('[query]', 'GraphQL query string')\n .option('-f, --file <file>', 'Read query from file')\n .option('--json', 'Output as JSON (default)')\n .option('--pretty', 'Pretty print JSON output')\n .action(async (queryArg, options) => {\n let query: string\n\n if (options.file) {\n try {\n query = readFileSync(options.file, 'utf-8')\n } catch (err: any) {\n output.error(`Failed to read file: ${err.message}`)\n process.exit(1)\n }\n } else if (queryArg) {\n query = queryArg\n } else {\n output.error('Provide a query string or use --file')\n output.dim('Example: chainvue query \"{ blocks(limit: 5) { height hash } }\"')\n process.exit(1)\n }\n\n const spinner = ora('Executing query...').start()\n\n const response = await graphqlQuery(query)\n\n if (!response.ok) {\n spinner.fail('Query failed')\n output.error(response.error || 'Unknown error')\n\n if (response.data) {\n console.log()\n output.json(response.data)\n }\n\n process.exit(1)\n }\n\n spinner.stop()\n\n if (options.pretty) {\n console.log(JSON.stringify(response.data, null, 2))\n } else {\n console.log(JSON.stringify(response.data))\n }\n })\n","import { Command } from 'commander'\nimport ora from 'ora'\nimport chalk from 'chalk'\nimport { apiRequest } from '../lib/api.js'\nimport { getCurrentProfile, setCurrentProfile } from '../lib/config.js'\nimport * as output from '../lib/output.js'\n\ninterface Organization {\n id: string\n name: string\n slug: string\n role: string\n plan: string\n}\n\nexport const orgCommand = new Command('org')\n .description('Manage organizations')\n\norgCommand\n .command('list')\n .description('List your organizations')\n .option('--json', 'Output as JSON')\n .action(async (options) => {\n const spinner = ora('Fetching organizations...').start()\n\n const response = await apiRequest<{ organizations: Organization[] }>('GET', '/api/v1/orgs')\n\n if (!response.ok) {\n spinner.fail('Failed to fetch organizations')\n output.error(response.error || 'Unknown error')\n return\n }\n\n spinner.stop()\n\n const orgs = response.data?.organizations || []\n const currentProfile = getCurrentProfile()\n\n if (options.json) {\n output.json(orgs)\n return\n }\n\n if (orgs.length === 0) {\n output.info('No organizations found')\n return\n }\n\n console.log()\n for (const org of orgs) {\n const isCurrent = org.id === currentProfile?.orgId\n const marker = isCurrent ? chalk.green('▶ ') : ' '\n const name = isCurrent ? chalk.bold(org.name) : org.name\n\n console.log(`${marker}${name}`)\n console.log(` ID: ${org.id}`)\n console.log(` Role: ${org.role} Plan: ${org.plan}`)\n console.log()\n }\n })\n\norgCommand\n .command('switch <orgId>')\n .description('Switch to a different organization')\n .action(async (orgId) => {\n const spinner = ora('Switching organization...').start()\n\n // Fetch org details to verify access\n const response = await apiRequest<{\n id: string\n name: string\n slug: string\n }>('GET', `/api/v1/orgs/${orgId}`)\n\n if (!response.ok) {\n spinner.fail('Failed to switch organization')\n output.error(response.error || 'Organization not found or no access')\n return\n }\n\n const org = response.data!\n const currentProfile = getCurrentProfile()\n\n if (!currentProfile) {\n spinner.fail('Not logged in')\n return\n }\n\n // Update profile with new org\n setCurrentProfile('default', {\n ...currentProfile,\n orgId: org.id,\n orgName: org.name,\n })\n\n spinner.succeed(`Switched to ${org.name}`)\n })\n\norgCommand\n .command('current')\n .description('Show current organization')\n .action(async () => {\n const profile = getCurrentProfile()\n\n if (!profile) {\n output.error('Not logged in')\n process.exit(1)\n }\n\n console.log()\n output.keyValue({\n 'Organization': profile.orgName,\n 'ID': profile.orgId,\n })\n console.log()\n })\n"],"mappings":";;;AACA,SAAS,WAAAA,gBAAe;;;ACDxB,SAAS,eAAe;AACxB,OAAO,SAAS;AAChB,OAAOC,YAAW;;;ACFlB,SAAS,eAAe;;;ACAxB,OAAO,UAAU;AACjB,OAAO,QAAQ;AACf,OAAO,UAAU;AAgBjB,IAAM,WAAmB;AAAA,EACvB,gBAAgB;AAAA,EAChB,UAAU,CAAC;AAAA,EACX,aAAa;AACf;AAEO,IAAM,SAAS,IAAI,KAAa;AAAA,EACrC,aAAa;AAAA,EACb;AAAA,EACA,KAAK,KAAK,KAAK,GAAG,QAAQ,GAAG,WAAW,UAAU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AAA,IACd,gBAAgB,QAAQ;AAAA,IACxB,MAAM,QAAQ;AAAA,EAChB,CAAC;AACD,UAAQ,IAAI;AACd,CAAC;;;AXzGH,IAAM,UAAU,IAAIE,SAAQ;AAE5B,QACG,KAAK,UAAU,EACf,YAAY,sDAAsD,EAClE,QAAQ,OAAO;AAGlB,QAAQ,WAAW,YAAY;AAC/B,QAAQ,WAAW,aAAa;AAChC,QAAQ,WAAW,aAAa;AAGhC,QAAQ,WAAW,WAAW;AAC9B,QAAQ,WAAW,eAAe;AAClC,QAAQ,WAAW,UAAU;AAG7B,QAAQ,WAAW,YAAY;AAG/B,QAAQ,MAAM;","names":["Command","chalk","path","chalk","Command","Command","Command","Command","Command","ora","Command","ora","Command","ora","Command","ora","Command","ora","Command","ora","Command","ora","chalk","Command","ora","chalk","Command"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/commands/login.ts","../src/lib/api.ts","../src/lib/config.ts","../src/lib/keychain.ts","../src/lib/output.ts","../src/commands/logout.ts","../src/commands/whoami.ts","../src/commands/keys.ts","../src/commands/webhooks.ts","../src/commands/query.ts","../src/commands/org.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from 'commander'\nimport { loginCommand } from './commands/login.js'\nimport { logoutCommand } from './commands/logout.js'\nimport { whoamiCommand } from './commands/whoami.js'\nimport { keysCommand } from './commands/keys.js'\nimport { webhooksCommand } from './commands/webhooks.js'\nimport { queryCommand } from './commands/query.js'\nimport { orgCommand } from './commands/org.js'\nimport { CLI_VERSION } from './lib/api.js'\n\nconst program = new Command()\n\nprogram\n .name('chainvue')\n .description('ChainVue CLI - Manage your blockchain infrastructure')\n .version(CLI_VERSION)\n\n// Auth commands\nprogram.addCommand(loginCommand)\nprogram.addCommand(logoutCommand)\nprogram.addCommand(whoamiCommand)\n\n// Management commands\nprogram.addCommand(keysCommand)\nprogram.addCommand(webhooksCommand)\nprogram.addCommand(orgCommand)\n\n// Query command\nprogram.addCommand(queryCommand)\n\n// Parse arguments\nprogram.parse()\n","import { Command } from 'commander'\nimport ora from 'ora'\nimport chalk from 'chalk'\nimport { requestDeviceCode, pollDeviceToken } from '../lib/api.js'\nimport { saveCredentials, getCredentials } from '../lib/keychain.js'\nimport { setCurrentProfile, getCurrentProfile } from '../lib/config.js'\nimport * as output from '../lib/output.js'\n\nexport const loginCommand = new Command('login')\n .description('Log in to ChainVue')\n .option('--api-key <key>', 'Login with an API key (for CI/CD)')\n .action(async (options) => {\n // Check if already logged in\n const existing = getCurrentProfile()\n if (existing) {\n output.warn(`Already logged in as ${existing.email}`)\n output.dim('Run \"chainvue logout\" first to switch accounts')\n return\n }\n\n // API key login (for CI/CD)\n if (options.apiKey) {\n await loginWithApiKey(options.apiKey)\n return\n }\n\n // OAuth Device Flow\n await loginWithDeviceFlow()\n })\n\nasync function loginWithApiKey(apiKey: string): Promise<void> {\n const spinner = ora('Validating API key...').start()\n\n // Validate key format\n if (!apiKey.startsWith('cv_api_') && !apiKey.startsWith('cv_agent_')) {\n spinner.fail('Invalid API key format')\n output.dim('API keys should start with cv_api_ or cv_agent_')\n return\n }\n\n // TODO: Validate key by calling /api/v1/auth/me\n // For now, just store it\n\n await saveCredentials('default', { apiKey, accessToken: '' })\n\n // We don't have user info with just API key, so create minimal profile\n setCurrentProfile('default', {\n orgId: 'unknown',\n orgName: 'API Key Auth',\n email: 'api-key',\n clerkUserId: '',\n environment: apiKey.includes('_live_') ? 'live' : 'test',\n })\n\n spinner.succeed('Logged in with API key')\n output.dim('Note: Some commands may have limited functionality with API key auth')\n}\n\nasync function loginWithDeviceFlow(): Promise<void> {\n const spinner = ora('Requesting device code...').start()\n\n // Step 1: Request device code\n const deviceResponse = await requestDeviceCode()\n\n if (!deviceResponse.ok || !deviceResponse.data) {\n spinner.fail('Failed to start login')\n output.error(deviceResponse.error || 'Unknown error')\n return\n }\n\n const { deviceCode, userCode, verificationUri, expiresIn, interval } = deviceResponse.data\n\n spinner.stop()\n\n // Step 2: Display code to user\n console.log()\n console.log(chalk.bold(' To complete login, visit:'))\n console.log()\n console.log(chalk.cyan(` ${verificationUri}`))\n console.log()\n console.log(chalk.bold(' And enter this code:'))\n console.log()\n console.log(chalk.yellow.bold(` ${userCode}`))\n console.log()\n\n // Step 3: Poll for token\n const pollSpinner = ora('Waiting for authorization...').start()\n\n const expiresAt = Date.now() + expiresIn * 1000\n const pollInterval = Math.max(interval, 5) * 1000\n\n while (Date.now() < expiresAt) {\n await sleep(pollInterval)\n\n const tokenResponse = await pollDeviceToken(deviceCode)\n\n if (tokenResponse.ok && tokenResponse.data) {\n const data = tokenResponse.data as any\n\n if (data.error === 'authorization_pending') {\n // Still waiting\n continue\n }\n\n if (data.accessToken) {\n // Success!\n pollSpinner.succeed('Authorized')\n\n // Save credentials\n await saveCredentials('default', {\n accessToken: data.accessToken,\n refreshToken: data.refreshToken,\n })\n\n // Save profile\n const org = data.organizations[0]\n setCurrentProfile('default', {\n orgId: org.id,\n orgName: org.name,\n email: data.user.email,\n clerkUserId: data.user.id,\n environment: 'live',\n })\n\n console.log()\n output.success(`Logged in as ${data.user.email}`)\n output.success(`Organization: ${org.name}`)\n\n if (data.organizations.length > 1) {\n output.dim(`You have access to ${data.organizations.length} organizations`)\n output.dim('Use \"chainvue org switch\" to change')\n }\n\n return\n }\n }\n\n if (!tokenResponse.ok && tokenResponse.error !== 'authorization_pending') {\n pollSpinner.fail('Authorization failed')\n output.error(tokenResponse.error || 'Unknown error')\n return\n }\n }\n\n pollSpinner.fail('Authorization timed out')\n output.error('Please try again')\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise(resolve => setTimeout(resolve, ms))\n}\n","import { request } from 'undici'\nimport { getApiEndpoint, getCurrentProfile } from './config.js'\nimport { getAuthHeader } from './keychain.js'\nimport chalk from 'chalk'\n\ndeclare const __CLI_VERSION__: string\n\nconst CLI_VERSION = typeof __CLI_VERSION__ !== 'undefined' ? __CLI_VERSION__ : '0.0.0-dev'\nconst USER_AGENT = `ChainVue-CLI/${CLI_VERSION} (${process.platform}; node/${process.version.slice(1)})`\n\nexport { CLI_VERSION }\n\nexport interface ApiResponse<T = unknown> {\n ok: boolean\n status: number\n data?: T\n error?: string\n}\n\nlet updateNoticeShown = false\n\n/**\n * Check response headers for update notices from the server.\n */\nfunction checkForUpdate(headers: Record<string, string | string[] | undefined>): void {\n if (updateNoticeShown) return\n\n const latestVersion = headers['x-chainvue-latest-cli'] as string | undefined\n if (!latestVersion || latestVersion === CLI_VERSION) return\n\n updateNoticeShown = true\n console.error()\n console.error(chalk.yellow(` Update available: ${CLI_VERSION} → ${latestVersion}`))\n console.error(chalk.dim(` Run: npm install -g @chainvue/cli`))\n console.error()\n}\n\nexport async function apiRequest<T = unknown>(\n method: 'GET' | 'POST' | 'PATCH' | 'DELETE',\n path: string,\n body?: unknown,\n authRequired = true\n): Promise<ApiResponse<T>> {\n const endpoint = getApiEndpoint()\n const url = `${endpoint}${path}`\n\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n 'User-Agent': USER_AGENT,\n }\n\n if (authRequired) {\n const profile = getCurrentProfile()\n if (!profile) {\n return {\n ok: false,\n status: 401,\n error: 'Not logged in. Run: chainvue login',\n }\n }\n\n const auth = await getAuthHeader('default')\n if (!auth) {\n return {\n ok: false,\n status: 401,\n error: 'No credentials found. Run: chainvue login',\n }\n }\n\n headers['Authorization'] = auth\n }\n\n try {\n const response = await request(url, {\n method,\n headers,\n body: body ? JSON.stringify(body) : undefined,\n })\n\n checkForUpdate(response.headers as any)\n\n const text = await response.body.text()\n let data: T | undefined\n\n try {\n data = JSON.parse(text) as T\n } catch {\n // Not JSON response\n }\n\n if (response.statusCode >= 400) {\n return {\n ok: false,\n status: response.statusCode,\n error: (data as any)?.error || `HTTP ${response.statusCode}`,\n data,\n }\n }\n\n return {\n ok: true,\n status: response.statusCode,\n data,\n }\n } catch (err: any) {\n return {\n ok: false,\n status: 0,\n error: err.message || 'Network error',\n }\n }\n}\n\n// GraphQL query\nexport async function graphqlQuery<T = unknown>(\n query: string,\n variables?: Record<string, unknown>\n): Promise<ApiResponse<T>> {\n // GraphQL goes to the NestJS API, not the Next.js app\n const endpoint = 'https://api.chainvue.io/graphql'\n\n const profile = getCurrentProfile()\n if (!profile) {\n return {\n ok: false,\n status: 401,\n error: 'Not logged in. Run: chainvue login',\n }\n }\n\n const auth = await getAuthHeader('default')\n if (!auth) {\n return {\n ok: false,\n status: 401,\n error: 'No credentials found. Run: chainvue login',\n }\n }\n\n try {\n const response = await request(endpoint, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': auth,\n 'User-Agent': USER_AGENT,\n },\n body: JSON.stringify({ query, variables }),\n })\n\n const data = await response.body.json() as any\n\n if (data.errors) {\n return {\n ok: false,\n status: response.statusCode,\n error: data.errors[0]?.message || 'GraphQL error',\n data,\n }\n }\n\n return {\n ok: true,\n status: response.statusCode,\n data: data.data as T,\n }\n } catch (err: any) {\n return {\n ok: false,\n status: 0,\n error: err.message || 'Network error',\n }\n }\n}\n\n// Device auth flow\nexport async function requestDeviceCode(): Promise<ApiResponse<{\n deviceCode: string\n userCode: string\n verificationUri: string\n expiresIn: number\n interval: number\n}>> {\n return apiRequest('POST', '/api/v1/auth/device', undefined, false)\n}\n\nexport async function pollDeviceToken(deviceCode: string): Promise<ApiResponse<{\n accessToken: string\n refreshToken: string\n user: { id: string; email: string }\n organizations: Array<{ id: string; name: string; role: string }>\n} | { error: string }>> {\n return apiRequest('POST', '/api/v1/auth/device/token', { deviceCode }, false)\n}\n","import Conf from 'conf'\nimport os from 'os'\nimport path from 'path'\n\nexport interface Profile {\n orgId: string\n orgName: string\n email: string\n clerkUserId: string\n environment: 'live' | 'test'\n}\n\nexport interface Config {\n currentProfile: string\n profiles: Record<string, Profile>\n apiEndpoint: string\n}\n\nconst defaults: Config = {\n currentProfile: 'default',\n profiles: {},\n apiEndpoint: 'https://chainvue.io',\n}\n\nexport const config = new Conf<Config>({\n projectName: 'chainvue',\n defaults,\n cwd: path.join(os.homedir(), '.config', 'chainvue'),\n})\n\nexport function getCurrentProfile(): Profile | null {\n const profileName = config.get('currentProfile')\n const profiles = config.get('profiles')\n return profiles[profileName] || null\n}\n\nexport function setCurrentProfile(name: string, profile: Profile): void {\n const profiles = config.get('profiles')\n profiles[name] = profile\n config.set('profiles', profiles)\n config.set('currentProfile', name)\n}\n\nexport function deleteProfile(name: string): void {\n const profiles = config.get('profiles')\n delete profiles[name]\n config.set('profiles', profiles)\n\n if (config.get('currentProfile') === name) {\n const remaining = Object.keys(profiles)\n config.set('currentProfile', remaining[0] || 'default')\n }\n}\n\nexport function listProfiles(): Record<string, Profile> {\n return config.get('profiles')\n}\n\nexport function getApiEndpoint(): string {\n return config.get('apiEndpoint')\n}\n","import keytar from 'keytar'\n\nconst SERVICE_NAME = 'chainvue-cli'\n\nexport interface StoredCredentials {\n accessToken: string\n refreshToken?: string\n apiKey?: string\n}\n\nexport async function saveCredentials(\n profile: string,\n credentials: StoredCredentials\n): Promise<void> {\n await keytar.setPassword(\n SERVICE_NAME,\n profile,\n JSON.stringify(credentials)\n )\n}\n\nexport async function getCredentials(\n profile: string\n): Promise<StoredCredentials | null> {\n const data = await keytar.getPassword(SERVICE_NAME, profile)\n if (!data) return null\n\n try {\n return JSON.parse(data) as StoredCredentials\n } catch {\n return null\n }\n}\n\nexport async function deleteCredentials(profile: string): Promise<boolean> {\n return keytar.deletePassword(SERVICE_NAME, profile)\n}\n\nexport async function hasCredentials(profile: string): Promise<boolean> {\n const creds = await getCredentials(profile)\n return creds !== null\n}\n\n// Get the authorization header value\nexport async function getAuthHeader(profile: string): Promise<string | null> {\n const creds = await getCredentials(profile)\n if (!creds) return null\n\n // Prefer API key if set (for CI/CD use)\n if (creds.apiKey) {\n return `Bearer ${creds.apiKey}`\n }\n\n // Otherwise use session token\n if (creds.accessToken) {\n return `Bearer ${creds.accessToken}`\n }\n\n return null\n}\n","import chalk from 'chalk'\nimport Table from 'cli-table3'\n\nexport function success(message: string): void {\n console.log(chalk.green('✓') + ' ' + message)\n}\n\nexport function error(message: string): void {\n console.log(chalk.red('✗') + ' ' + message)\n}\n\nexport function warn(message: string): void {\n console.log(chalk.yellow('!') + ' ' + message)\n}\n\nexport function info(message: string): void {\n console.log(chalk.blue('→') + ' ' + message)\n}\n\nexport function dim(message: string): void {\n console.log(chalk.dim(message))\n}\n\nexport function json(data: unknown): void {\n console.log(JSON.stringify(data, null, 2))\n}\n\nexport function table(\n headers: string[],\n rows: string[][],\n options: { head?: boolean } = {}\n): void {\n const t = new Table({\n head: headers.map(h => chalk.bold(h)),\n style: {\n head: [],\n border: ['dim'],\n },\n })\n\n for (const row of rows) {\n t.push(row)\n }\n\n console.log(t.toString())\n}\n\nexport function keyValue(data: Record<string, string | number | null | undefined>): void {\n const maxKeyLength = Math.max(...Object.keys(data).map(k => k.length))\n\n for (const [key, value] of Object.entries(data)) {\n const paddedKey = key.padEnd(maxKeyLength)\n const displayValue = value === null || value === undefined\n ? chalk.dim('—')\n : String(value)\n console.log(`${chalk.bold(paddedKey)} ${displayValue}`)\n }\n}\n\nexport function formatTimeAgo(date: Date | string | null): string {\n if (!date) return 'Never'\n\n const d = typeof date === 'string' ? new Date(date) : date\n const now = new Date()\n const seconds = Math.floor((now.getTime() - d.getTime()) / 1000)\n\n if (seconds < 60) return 'Just now'\n if (seconds < 3600) return `${Math.floor(seconds / 60)} min ago`\n if (seconds < 86400) return `${Math.floor(seconds / 3600)} hours ago`\n if (seconds < 604800) return `${Math.floor(seconds / 86400)} days ago`\n\n return d.toLocaleDateString()\n}\n","import { Command } from 'commander'\nimport { deleteCredentials } from '../lib/keychain.js'\nimport { deleteProfile, getCurrentProfile } from '../lib/config.js'\nimport * as output from '../lib/output.js'\n\nexport const logoutCommand = new Command('logout')\n .description('Log out of ChainVue')\n .action(async () => {\n const profile = getCurrentProfile()\n\n if (!profile) {\n output.warn('Not currently logged in')\n return\n }\n\n // Delete credentials from keychain\n await deleteCredentials('default')\n\n // Delete profile from config\n deleteProfile('default')\n\n output.success(`Logged out from ${profile.email}`)\n })\n","import { Command } from 'commander'\nimport { getCurrentProfile, getApiEndpoint } from '../lib/config.js'\nimport { getCredentials } from '../lib/keychain.js'\nimport * as output from '../lib/output.js'\n\nexport const whoamiCommand = new Command('whoami')\n .description('Show current user and organization')\n .option('--json', 'Output as JSON')\n .action(async (options) => {\n const profile = getCurrentProfile()\n\n if (!profile) {\n output.error('Not logged in')\n output.dim('Run: chainvue login')\n process.exit(1)\n }\n\n const creds = await getCredentials('default')\n const authMethod = creds?.apiKey ? 'API Key' : 'Session'\n\n if (options.json) {\n output.json({\n email: profile.email,\n organization: {\n id: profile.orgId,\n name: profile.orgName,\n },\n environment: profile.environment,\n authMethod,\n apiEndpoint: getApiEndpoint(),\n })\n return\n }\n\n console.log()\n output.keyValue({\n 'Email': profile.email,\n 'Organization': profile.orgName,\n 'Org ID': profile.orgId,\n 'Environment': profile.environment,\n 'Auth Method': authMethod,\n 'API Endpoint': getApiEndpoint(),\n })\n console.log()\n })\n","import { Command } from 'commander'\nimport ora from 'ora'\nimport { apiRequest } from '../lib/api.js'\nimport * as output from '../lib/output.js'\n\ninterface ApiKey {\n id: string\n name: string\n keyPrefix: string\n environment: 'TEST' | 'LIVE'\n type: 'api' | 'agent'\n lastUsedAt: string | null\n createdAt: string\n}\n\nexport const keysCommand = new Command('keys')\n .description('Manage API keys')\n\nkeysCommand\n .command('list')\n .description('List all API keys')\n .option('--json', 'Output as JSON')\n .action(async (options) => {\n const spinner = ora('Fetching API keys...').start()\n\n const response = await apiRequest<{ keys: ApiKey[] }>('GET', '/api/v1/keys')\n\n if (!response.ok) {\n spinner.fail('Failed to fetch keys')\n output.error(response.error || 'Unknown error')\n return\n }\n\n spinner.stop()\n\n const keys = response.data?.keys || []\n\n if (options.json) {\n output.json(keys)\n return\n }\n\n if (keys.length === 0) {\n output.info('No API keys found')\n output.dim('Create one with: chainvue keys create --name \"My Key\"')\n return\n }\n\n output.table(\n ['NAME', 'TYPE', 'ENV', 'PREFIX', 'LAST USED', 'CREATED'],\n keys.map(k => [\n k.name,\n k.type,\n k.environment.toLowerCase(),\n k.keyPrefix,\n output.formatTimeAgo(k.lastUsedAt),\n output.formatTimeAgo(k.createdAt),\n ])\n )\n })\n\nkeysCommand\n .command('create')\n .description('Create a new API key')\n .requiredOption('--name <name>', 'Name for the key')\n .option('--type <type>', 'Key type: api or agent', 'api')\n .option('--env <env>', 'Environment: test or live', 'test')\n .action(async (options) => {\n const spinner = ora('Creating API key...').start()\n\n const response = await apiRequest<{\n id: string\n key: string\n keyPrefix: string\n name: string\n environment: string\n }>('POST', '/api/v1/keys', {\n name: options.name,\n type: options.type,\n environment: options.env.toUpperCase(),\n })\n\n if (!response.ok) {\n spinner.fail('Failed to create key')\n output.error(response.error || 'Unknown error')\n return\n }\n\n spinner.succeed('API key created')\n console.log()\n\n const { key, keyPrefix, name, environment } = response.data!\n\n output.keyValue({\n 'Name': name,\n 'Environment': environment.toLowerCase(),\n 'Key': key,\n })\n\n console.log()\n output.warn('Save this key now! You won\\'t be able to see it again.')\n })\n\nkeysCommand\n .command('revoke <id>')\n .description('Revoke an API key')\n .action(async (id) => {\n const spinner = ora('Revoking API key...').start()\n\n const response = await apiRequest('DELETE', `/api/v1/keys/${id}`)\n\n if (!response.ok) {\n spinner.fail('Failed to revoke key')\n output.error(response.error || 'Unknown error')\n return\n }\n\n spinner.succeed('API key revoked')\n })\n","import { Command } from 'commander'\nimport ora from 'ora'\nimport { apiRequest } from '../lib/api.js'\nimport * as output from '../lib/output.js'\n\ninterface Webhook {\n id: string\n url: string\n description?: string\n events: string[]\n chainId: string\n isActive: boolean\n deliveryCount: number\n failureCount: number\n lastTriggeredAt: string | null\n createdAt: string\n}\n\nconst CHAIN_NAMES: Record<string, string> = {\n 'iJhCezBExJHvtyH3fGhNnt2NhU4Ztkf2yq': 'VRSCTEST',\n 'i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV': 'Verus',\n}\n\nexport const webhooksCommand = new Command('webhooks')\n .description('Manage webhooks')\n\nwebhooksCommand\n .command('list')\n .description('List all webhooks')\n .option('--json', 'Output as JSON')\n .action(async (options) => {\n const spinner = ora('Fetching webhooks...').start()\n\n const response = await apiRequest<{ webhooks: Webhook[] }>('GET', '/api/v1/webhooks')\n\n if (!response.ok) {\n spinner.fail('Failed to fetch webhooks')\n output.error(response.error || 'Unknown error')\n return\n }\n\n spinner.stop()\n\n const webhooks = response.data?.webhooks || []\n\n if (options.json) {\n output.json(webhooks)\n return\n }\n\n if (webhooks.length === 0) {\n output.info('No webhooks found')\n output.dim('Create one with: chainvue webhooks create --url https://...')\n return\n }\n\n output.table(\n ['URL', 'CHAIN', 'EVENTS', 'STATUS', 'SUCCESS', 'LAST'],\n webhooks.map(w => {\n const successRate = w.deliveryCount > 0\n ? `${(((w.deliveryCount - w.failureCount) / w.deliveryCount) * 100).toFixed(1)}%`\n : '—'\n\n return [\n w.url.length > 40 ? w.url.slice(0, 37) + '...' : w.url,\n CHAIN_NAMES[w.chainId] || w.chainId.slice(0, 8),\n w.events.length.toString(),\n w.isActive ? 'active' : 'disabled',\n successRate,\n output.formatTimeAgo(w.lastTriggeredAt),\n ]\n })\n )\n })\n\nwebhooksCommand\n .command('create')\n .description('Create a new webhook')\n .requiredOption('--url <url>', 'Webhook endpoint URL (HTTPS)')\n .option('--description <desc>', 'Description')\n .option('--events <events>', 'Comma-separated events', 'address.received')\n .option('--chain <chain>', 'Chain ID or name', 'VRSCTEST')\n .action(async (options) => {\n const spinner = ora('Creating webhook...').start()\n\n // Resolve chain name to ID\n let chainId = options.chain\n if (options.chain === 'VRSCTEST') {\n chainId = 'iJhCezBExJHvtyH3fGhNnt2NhU4Ztkf2yq'\n } else if (options.chain === 'Verus') {\n chainId = 'i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV'\n }\n\n const events = options.events.split(',').map((e: string) => e.trim())\n\n const response = await apiRequest<{\n id: string\n url: string\n secret: string\n events: string[]\n }>('POST', '/api/v1/webhooks', {\n url: options.url,\n description: options.description,\n chainId,\n events,\n })\n\n if (!response.ok) {\n spinner.fail('Failed to create webhook')\n output.error(response.error || 'Unknown error')\n return\n }\n\n spinner.succeed('Webhook created')\n console.log()\n\n const { url, secret, events: createdEvents } = response.data!\n\n output.keyValue({\n 'URL': url,\n 'Events': createdEvents.join(', '),\n 'Secret': secret,\n })\n\n console.log()\n output.warn('Save this secret now! You won\\'t be able to see it again.')\n })\n\nwebhooksCommand\n .command('delete <id>')\n .description('Delete a webhook')\n .action(async (id) => {\n const spinner = ora('Deleting webhook...').start()\n\n const response = await apiRequest('DELETE', `/api/v1/webhooks/${id}`)\n\n if (!response.ok) {\n spinner.fail('Failed to delete webhook')\n output.error(response.error || 'Unknown error')\n return\n }\n\n spinner.succeed('Webhook deleted')\n })\n\nwebhooksCommand\n .command('test <id>')\n .description('Send a test event to a webhook')\n .action(async (id) => {\n const spinner = ora('Sending test event...').start()\n\n const response = await apiRequest<{\n success: boolean\n responseCode: number | null\n responseTime: number | null\n errorMessage: string | null\n }>('POST', `/api/v1/webhooks/${id}/test`)\n\n if (!response.ok) {\n spinner.fail('Failed to send test')\n output.error(response.error || 'Unknown error')\n return\n }\n\n const result = response.data!\n\n if (result.success) {\n spinner.succeed(`Test delivered (${result.responseCode}, ${result.responseTime}ms)`)\n } else {\n spinner.fail(`Test failed: ${result.errorMessage}`)\n }\n })\n","import { Command } from 'commander'\nimport { readFileSync } from 'fs'\nimport ora from 'ora'\nimport { graphqlQuery } from '../lib/api.js'\nimport * as output from '../lib/output.js'\n\nexport const queryCommand = new Command('query')\n .description('Execute a GraphQL query')\n .argument('[query]', 'GraphQL query string')\n .option('-f, --file <file>', 'Read query from file')\n .option('--json', 'Output as JSON (default)')\n .option('--pretty', 'Pretty print JSON output')\n .action(async (queryArg, options) => {\n let query: string\n\n if (options.file) {\n try {\n query = readFileSync(options.file, 'utf-8')\n } catch (err: any) {\n output.error(`Failed to read file: ${err.message}`)\n process.exit(1)\n }\n } else if (queryArg) {\n query = queryArg\n } else {\n output.error('Provide a query string or use --file')\n output.dim('Example: chainvue query \"{ blocks(limit: 5) { height hash } }\"')\n process.exit(1)\n }\n\n const spinner = ora('Executing query...').start()\n\n const response = await graphqlQuery(query)\n\n if (!response.ok) {\n spinner.fail('Query failed')\n output.error(response.error || 'Unknown error')\n\n if (response.data) {\n console.log()\n output.json(response.data)\n }\n\n process.exit(1)\n }\n\n spinner.stop()\n\n if (options.pretty) {\n console.log(JSON.stringify(response.data, null, 2))\n } else {\n console.log(JSON.stringify(response.data))\n }\n })\n","import { Command } from 'commander'\nimport ora from 'ora'\nimport chalk from 'chalk'\nimport { apiRequest } from '../lib/api.js'\nimport { getCurrentProfile, setCurrentProfile } from '../lib/config.js'\nimport * as output from '../lib/output.js'\n\ninterface Organization {\n id: string\n name: string\n slug: string\n role: string\n plan: string\n}\n\nexport const orgCommand = new Command('org')\n .description('Manage organizations')\n\norgCommand\n .command('list')\n .description('List your organizations')\n .option('--json', 'Output as JSON')\n .action(async (options) => {\n const spinner = ora('Fetching organizations...').start()\n\n const response = await apiRequest<{ organizations: Organization[] }>('GET', '/api/v1/orgs')\n\n if (!response.ok) {\n spinner.fail('Failed to fetch organizations')\n output.error(response.error || 'Unknown error')\n return\n }\n\n spinner.stop()\n\n const orgs = response.data?.organizations || []\n const currentProfile = getCurrentProfile()\n\n if (options.json) {\n output.json(orgs)\n return\n }\n\n if (orgs.length === 0) {\n output.info('No organizations found')\n return\n }\n\n console.log()\n for (const org of orgs) {\n const isCurrent = org.id === currentProfile?.orgId\n const marker = isCurrent ? chalk.green('▶ ') : ' '\n const name = isCurrent ? chalk.bold(org.name) : org.name\n\n console.log(`${marker}${name}`)\n console.log(` ID: ${org.id}`)\n console.log(` Role: ${org.role} Plan: ${org.plan}`)\n console.log()\n }\n })\n\norgCommand\n .command('switch <orgId>')\n .description('Switch to a different organization')\n .action(async (orgId) => {\n const spinner = ora('Switching organization...').start()\n\n // Fetch org details to verify access\n const response = await apiRequest<{\n id: string\n name: string\n slug: string\n }>('GET', `/api/v1/orgs/${orgId}`)\n\n if (!response.ok) {\n spinner.fail('Failed to switch organization')\n output.error(response.error || 'Organization not found or no access')\n return\n }\n\n const org = response.data!\n const currentProfile = getCurrentProfile()\n\n if (!currentProfile) {\n spinner.fail('Not logged in')\n return\n }\n\n // Update profile with new org\n setCurrentProfile('default', {\n ...currentProfile,\n orgId: org.id,\n orgName: org.name,\n })\n\n spinner.succeed(`Switched to ${org.name}`)\n })\n\norgCommand\n .command('current')\n .description('Show current organization')\n .action(async () => {\n const profile = getCurrentProfile()\n\n if (!profile) {\n output.error('Not logged in')\n process.exit(1)\n }\n\n console.log()\n output.keyValue({\n 'Organization': profile.orgName,\n 'ID': profile.orgId,\n })\n console.log()\n })\n"],"mappings":";;;AACA,SAAS,WAAAA,gBAAe;;;ACDxB,SAAS,eAAe;AACxB,OAAO,SAAS;AAChB,OAAOC,YAAW;;;ACFlB,SAAS,eAAe;;;ACAxB,OAAO,UAAU;AACjB,OAAO,QAAQ;AACf,OAAO,UAAU;AAgBjB,IAAM,WAAmB;AAAA,EACvB,gBAAgB;AAAA,EAChB,UAAU,CAAC;AAAA,EACX,aAAa;AACf;AAEO,IAAM,SAAS,IAAI,KAAa;AAAA,EACrC,aAAa;AAAA,EACb;AAAA,EACA,KAAK,KAAK,KAAK,GAAG,QAAQ,GAAG,WAAW,UAAU;AACpD,CAAC;AAEM,SAAS,oBAAoC;AAClD,QAAM,cAAc,OAAO,IAAI,gBAAgB;AAC/C,QAAM,WAAW,OAAO,IAAI,UAAU;AACtC,SAAO,SAAS,WAAW,KAAK;AAClC;AAEO,SAAS,kBAAkB,MAAc,SAAwB;AACtE,QAAM,WAAW,OAAO,IAAI,UAAU;AACtC,WAAS,IAAI,IAAI;AACjB,SAAO,IAAI,YAAY,QAAQ;AAC/B,SAAO,IAAI,kBAAkB,IAAI;AACnC;AAEO,SAAS,cAAc,MAAoB;AAChD,QAAM,WAAW,OAAO,IAAI,UAAU;AACtC,SAAO,SAAS,IAAI;AACpB,SAAO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,IAAO,MAAM,eAAe;AAC5B,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,UAAQ,IAAI;AACZ,EAAO,SAAS;AAAA,IACd,gBAAgB,QAAQ;AAAA,IACxB,MAAM,QAAQ;AAAA,EAChB,CAAC;AACD,UAAQ,IAAI;AACd,CAAC;;;AXxGH,IAAM,UAAU,IAAIE,SAAQ;AAE5B,QACG,KAAK,UAAU,EACf,YAAY,sDAAsD,EAClE,QAAQ,WAAW;AAGtB,QAAQ,WAAW,YAAY;AAC/B,QAAQ,WAAW,aAAa;AAChC,QAAQ,WAAW,aAAa;AAGhC,QAAQ,WAAW,WAAW;AAC9B,QAAQ,WAAW,eAAe;AAClC,QAAQ,WAAW,UAAU;AAG7B,QAAQ,WAAW,YAAY;AAG/B,QAAQ,MAAM;","names":["Command","chalk","path","chalk","chalk","Command","Command","Command","Command","Command","ora","Command","ora","Command","ora","Command","ora","Command","ora","Command","ora","Command","ora","chalk","Command","ora","chalk","Command"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainvue/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "ChainVue CLI - Manage your blockchain infrastructure from the command line",
5
5
  "type": "module",
6
6
  "bin": {