查询当前系统的硬件、网络、磁盘等运行信息
使用 Python 获取本机系统运行信息,无需外部 API。
生成一条 python -c '...' 命令,使用 Python 标准库获取系统信息。
python -c "
import platform,os,datetime
uname=platform.uname()
print(f'=== 系统信息 ===')
print(f'操作系统: {uname.system} {uname.release}')
print(f'系统版本: {uname.version}')
print(f'主机名: {uname.node}')
print(f'处理器: {uname.processor or uname.machine}')
print(f'架构: {uname.machine}')
print(f'Python 版本: {platform.python_version()}')
print(f'当前用户: {os.getlogin()}')
print(f'当前目录: {os.getcwd()}')
print(f'当前时间: {datetime.datetime.now().strftime(\"%Y-%m-%d %H:%M:%S\")}')
"
python -c "
import shutil,os
if os.name=='nt':
drives=['C:','D:','E:','F:']
for d in drives:
try:
t,u,f=shutil.disk_usage(d+'\\\\')
print(f'{d} 总计:{t//(1024**3)}GB 已用:{u//(1024**3)}GB 可用:{f//(1024**3)}GB 使用率:{u/t*100:.1f}%')
except:pass
else:
t,u,f=shutil.disk_usage('/')
print(f'/ 总计:{t//(1024**3)}GB 已用:{u//(1024**3)}GB 可用:{f//(1024**3)}GB 使用率:{u/t*100:.1f}%')
"
python -c "
import os,platform
print(f'CPU: {platform.processor() or platform.machine()}')
print(f'CPU 核心数: {os.cpu_count()}')
if os.name!='nt':
with open('/proc/meminfo') as f:
for line in f:
if line.startswith(('MemTotal','MemFree','MemAvailable')):
name,val=line.split(':')
print(f'{name.strip()}: {val.strip()}')
else:
import ctypes
class MEMORYSTATUSEX(ctypes.Structure):
_fields_=[('dwLength',ctypes.c_ulong),('dwMemoryLoad',ctypes.c_ulong),('ullTotalPhys',ctypes.c_ulonglong),('ullAvailPhys',ctypes.c_ulonglong),('ullTotalPageFile',ctypes.c_ulonglong),('ullAvailPageFile',ctypes.c_ulonglong),('ullTotalVirtual',ctypes.c_ulonglong),('ullAvailVirtual',ctypes.c_ulonglong),('ullAvailExtendedVirtual',ctypes.c_ulonglong)]
m=MEMORYSTATUSEX()
m.dwLength=ctypes.sizeof(MEMORYSTATUSEX)
ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(m))
print(f'内存使用率: {m.dwMemoryLoad}%')
print(f'总内存: {m.ullTotalPhys//(1024**3)}GB')
print(f'可用内存: {m.ullAvailPhys//(1024**3)}GB')
"
python -c "
import socket
hostname=socket.gethostname()
try:
local_ip=socket.gethostbyname(hostname)
except:
local_ip='无法获取'
print(f'主机名: {hostname}')
print(f'本机 IP: {local_ip}')
try:
s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
s.connect(('8.8.8.8',80))
print(f'出口 IP: {s.getsockname()[0]}')
s.close()
except:
print('出口 IP: 无法获取')
"
python -c "
import os
important=['PATH','HOME','USER','LANG','SHELL','TERM','PYTHON_PATH']
print('=== 主要环境变量 ===')
for k in important:
v=os.environ.get(k,'')
if v:
if k=='PATH':
v=v[:200]+'...' if len(v)>200 else v
print(f'{k}: {v}')
"
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer