Skip to main content
Glama
system.ts1.04 kB
import si from "systeminformation"; import os from "os"; export async function getSystemInfo() { try { const osInfo = await si.osInfo(); const system = await si.system(); const uuid = await si.uuid(); return { platform: os.platform(), type: os.type(), release: os.release(), version: os.version(), arch: os.arch(), hostname: os.hostname(), uptime: os.uptime(), // 详细系统信息 distro: osInfo.distro, codename: osInfo.codename, kernel: osInfo.kernel, build: osInfo.build, // 系统制造商信息 manufacturer: system.manufacturer, model: system.model, serial: system.serial, // UUID uuid: uuid.os, // 用户信息 username: os.userInfo().username, homedir: os.homedir(), tmpdir: os.tmpdir(), }; } catch (error) { if (error instanceof Error) { throw new Error(`获取系统信息失败: ${error.message}`); } throw error; } }

Implementation Reference

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pepedd864/agent-sense'

If you have feedback or need assistance with the MCP directory API, please join our Discord server