MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / getSystemInfo

Function getSystemInfo

cli/src/utils/fingerprint.ts:36–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34}
35
36async function getSystemInfo(): Promise<{
37 system: { manufacturer: string; model: string; serial: string; uuid: string }
38 cpu: { manufacturer: string; brand: string; cores: number; physicalCores: number }
39 os: { platform: string; distro: string; arch: string; hostname: string }
40}> {
41 try {
42 if (!systeminformationModule) {
43 systeminformationModule = await import('systeminformation')
44 }
45 const [systemInfo, cpuInfo, osInfo] = await Promise.all([
46 systeminformationModule.system(),
47 systeminformationModule.cpu(),
48 systeminformationModule.osInfo(),
49 ])
50 return {
51 system: {
52 manufacturer: systemInfo.manufacturer,
53 model: systemInfo.model,
54 serial: systemInfo.serial,
55 uuid: systemInfo.uuid,
56 },
57 cpu: {
58 manufacturer: cpuInfo.manufacturer,
59 brand: cpuInfo.brand,
60 cores: cpuInfo.cores,
61 physicalCores: cpuInfo.physicalCores,
62 },
63 os: {
64 platform: osInfo.platform,
65 distro: osInfo.distro,
66 arch: osInfo.arch,
67 hostname: osInfo.hostname,
68 },
69 }
70 } catch {
71 return {
72 system: { manufacturer: '', model: '', serial: '', uuid: '' },
73 cpu: { manufacturer: '', brand: '', cores: 0, physicalCores: 0 },
74 os: { platform: process.platform, distro: '', arch: process.arch, hostname: '' },
75 }
76 }
77}
78
79/**
80 * Generates an enhanced CLI fingerprint using hardware identifiers.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected