Lines 10-53javascript
10 * - NEVER touches your Anthropic auth: your Claude Pro/Max OAuth login (or your own API
11 * key) keeps working and is forwarded to Anthropic by the gateway as-is.
12 * - CLI-only: installs a `vachi ✓/✗` statusline (~/.vachi/statusline.sh) unless you already
13 * have one. Optional, off by default: a UserPromptSubmit hook that nudges the model on
14 * usage-threshold crossings (`vachi-claude hooks enable`).
17 * npx vachi-claude enable (login if needed + configure Claude Code)
18 * npx vachi-claude login re-run the browser login only
19 * npx vachi-claude status show current configuration
20 * npx vachi-claude doctor read-only health checks
21 * npx vachi-claude disable restore settings (keeps credentials)
22 * npx vachi-claude disable --purge ...and delete stored credentials/state
23 * npx vachi-claude hooks enable turn on the optional model-facing usage hook
24 * npx vachi-claude hooks disable turn it back off
28const fs = require('fs');
29const os = require('os');
30const path = require('path');
31const http = require('http');
32const crypto = require('crypto');
33const readline = require('readline');
34const { spawn } = require('child_process');
35
HighChild Process
Package source references child process execution.
bin/vachi-claude.jsView on unpkg · L33 36const GATEWAY_URL = process.env.VACHI_GATEWAY_URL || 'https://gateway.vachiai.com';
37const SIGNIN_URL = process.env.VACHI_SIGNIN_URL || 'https://vachiai.com/cli-signin';
HighSame File Env Network Execution
A single source file combines environment access, network access, and code or shell execution; review context before blocking.
bin/vachi-claude.jsView on unpkg · L30 38const HEADER_NAME = 'x-vachi-id';
39const LOGIN_TIMEOUT_MS = 5 * 60 * 1000;
40const BACKUP_KEEP = 20;
42const HOME = os.homedir();
43const VACHI_DIR = path.join(HOME, '.vachi');
44const CRED_FILE = path.join(VACHI_DIR, 'credentials.json');
45const STATE_FILE = path.join(VACHI_DIR, 'state', 'claude-code.json');
46const BACKUP_DIR = path.join(VACHI_DIR, 'backups');
47const CLAUDE_DIR = path.join(HOME, '.claude');
49// Statusline + optional usage hook (§10.2-10.3 of the spec; G5). Both are CLI-only — the
50// Claude desktop app supports neither statusLine nor hooks as of 2026-07.
51const STATUSLINE_COMMAND = '~/.vachi/statusline.sh'; // literal value written into settings.json
52const HOOK_COMMAND = '~/.vachi/usage-hook.sh';
53const STATUSLINE_FILE = path.join(VACHI_DIR, 'statusline.sh');