Lines 5-45javascript
6// wevion <command> [--param value ...]
7// wevion list # list all commands
8// wevion help <command> # show a command's params
10// Auth: WEVION_API_KEY (x-api-key). Base URL: WEVION_BASE_URL or --base-url.
12import { parseArgs } from 'node:util'
22import { homedir } from 'node:os'
23import { createInterface } from 'node:readline/promises'
24import { fileURLToPath } from 'node:url'
25import { dirname, join } from 'node:path'
26import { spawn } from 'node:child_process'
28const HTTP_METHODS = ['get', 'post', 'put', 'patch', 'delete']
29const JSON_CONTENT_TYPE = 'application/json'
30const SUPPORTED_AUTH_SCHEMES = new Set(['apiKeyAuth'])
31// ponytail: hardcoded prod default; stage via --base-url / WEVION_BASE_URL / config.
32const DEFAULT_BASE_URL = 'https://api.wevion.ai'
33const DEFAULT_TIMEOUT_MS = 30_000
34const DEFAULT_SPEC_TIMEOUT_MS = 3000
36// ~/.config/wevion/config.json (honours XDG_CONFIG_HOME). Stores { apiKey, baseUrl }.
37export function configPath(env = process.env, platform = process.platform) {
38 if (platform === 'win32') {
HighSame File Env Network Execution
A single source file combines environment access, network access, and code or shell execution; review context before blocking.
src/index.mjsView on unpkg · L25 39 const base = env.APPDATA || join(env.USERPROFILE || env.HOME || homedir(), 'AppData', 'Roaming')
40 return join(base, 'Wevion', 'config.json')
HighSandbox Evasion Gated Capability
Source gates dangerous network, credential, or execution behavior behind CI, host, platform, time, or geo fingerprint checks.
src/index.mjsView on unpkg · L25 42 const base = env.XDG_CONFIG_HOME || join(env.HOME || homedir(), '.config')
43 return join(base, 'wevion', 'config.json')