Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

本文档格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),项目遵循 [Semantic Versioning](https://semver.org/lang/zh-CN/)。

## [Unreleased]

### Added

- 增加 Linux 平台 Provider,支持系统与权限、物理网卡与驱动、Wi-Fi、DHCP、路由、metric、默认路由和邻居表信息收集。

## [0.1.0] - 2026-05-22

### Added
Expand All @@ -16,3 +22,4 @@
- 增加 CI、标签发布工作流与 Nerdbank.GitVersioning 版本管理。

[0.1.0]: https://github.com/LyCecilion/xidio/releases/tag/v0.1.0
[Unreleased]: https://github.com/LyCecilion/xidio/compare/v0.1.0...HEAD
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ xidio 的灵感来自 [NanCunChild](https://github.com/NanCunChild) 的 [Marduk]
- **交互式场景问询**:通过 CLI 收集位置、连接方式、问题现象与影响范围,为后续判断补充用户上下文。
- **分层网络信息收集**:收集操作系统、时间、网络接口、IP、DHCP、DNS、默认路由、邻居表和主动探测结果。
- **Windows 深度适配**:利用 Windows 系统能力获取网卡、Wi-Fi、路由、代理与 PPPoE 等诊断信息。
- **跨平台架构**:通用诊断逻辑位于 `xidio.Core`,平台差异由独立 Provider 隔离;当前已有 Windows 和 macOS Provider,Linux Provider 正在路线图中
- **跨平台架构**:通用诊断逻辑位于 `xidio.Core`,平台差异由独立 Provider 隔离;当前已有 Windows、Linux 和 macOS Provider。
- **结构化与可取消**:核心诊断输出结构化数据,长时间任务支持进度报告和 `CancellationToken`。

## 🚀 Quick Start
Expand All @@ -53,6 +53,7 @@ xidio/
├── xidio/
│ ├── xidio.CLI/ # 命令行入口与交互式报告
│ ├── xidio.Core/ # 诊断模型、收集、分析与抽象
│ ├── xidio.Platform.Linux/ # Linux 平台 Provider
│ ├── xidio.Platform.Windows/ # Windows 平台 Provider
│ ├── xidio.Platform.macOS/ # macOS 平台 Provider
│ └── xidio.slnx # .NET 解决方案
Expand Down Expand Up @@ -84,6 +85,8 @@ dotnet run --project xidio/xidio.CLI/xidio.CLI.csproj -f net10.0-windows

可以从发行版安装 .NET 10 SDK,也可使用 Nix。原生 SDK 环境下:

Linux Provider 会按需调用 `ip`、`nmcli` 和 `iw`;建议安装 `iproute2`、NetworkManager 与 `iw`。命令不存在时,xidio 仍会返回 .NET 与 `/sys` 可获取的其他诊断信息。

```bash
dotnet restore xidio/xidio.CLI/xidio.CLI.csproj
dotnet build xidio/xidio.CLI/xidio.CLI.csproj -c Debug -f net10.0
Expand All @@ -106,7 +109,7 @@ dotnet build xidio/xidio.CLI/xidio.CLI.csproj -c Debug -f net10.0
dotnet run --project xidio/xidio.CLI/xidio.CLI.csproj -f net10.0
```

Apple Silicon 与 Intel Mac 也可使用已启用 `aarch64-darwin` 和 `x86_64-darwin` 的 `nix develop`
Apple Silicon Mac 也可使用已启用 `aarch64-darwin` 的 `nix develop`。当前 nixpkgs 已不再支持 `x86_64-darwin`,Intel Mac 请使用原生 .NET 10 SDK

## 🗺️ Roadmap

Expand Down
2 changes: 1 addition & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ xidio 需要在 Windows、Linux 和 macOS 上完成“信息收集 → 分层分

### 0.2 跨平台收集补全

- [ ] 建立并接入 `xidio.Platform.Linux`。
- [x] 建立并接入 `xidio.Platform.Linux`,收集系统、物理网卡、Wi-Fi、DHCP、路由、metric 与邻居表信息
- [ ] 对齐 Windows、Linux 和 macOS 的基础系统、网卡、路由、DNS、邻居表、代理与 Wi-Fi 收集能力。
- [ ] 补全 PPPoE 链路、会话、错误码与路由检查。
- [ ] 为外部命令解析与平台特性增加测试。
Expand Down
1 change: 1 addition & 0 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

- `xidio.Core`:xidio 的核心模块,封装了所有诊断、修复和上报逻辑,供 CLI 与 GUI 调用。
- `xidio.CLI`:xidio 的命令行版本,同时也可作为终端内的交互式工具使用。我们将使用 `System.CommandLine` 和 `Spectre.Console`。
- `xidio.Platform.*`:Windows、Linux 与 macOS 的平台专用信息收集 Provider。
- `xidio.GUI`:xidio 的图形界面版本,基于 Avalonia 框架实现跨平台功能。

### xidio 的调用能力和平台特性
Expand Down
4 changes: 3 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];

Expand All @@ -32,7 +31,10 @@
]
++ lib.optionals stdenv.isLinux [
clang
iproute2
iw
lld
networkmanager
];

buildInputs = with pkgs; [
Expand Down
11 changes: 7 additions & 4 deletions xidio/xidio.CLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
using xidio.Core.Models;
#if WINDOWS
using xidio.Platform.Windows;
#else
#elif LINUX
using xidio.Platform.Linux;
#elif MACOS
using xidio.Platform.macOS;
#endif

Expand Down Expand Up @@ -74,10 +76,11 @@ private static IPlatformNetworkDiagnosticsProvider CreatePlatformProvider()
{
#if WINDOWS
return new WindowsPlatformNetworkDiagnosticsProvider();
#elif LINUX
return new LinuxPlatformNetworkDiagnosticsProvider();
#elif MACOS
return new MacPlatformNetworkDiagnosticsProvider();
#else
if (OperatingSystem.IsMacOS())
return new MacPlatformNetworkDiagnosticsProvider();

return NoopPlatformNetworkDiagnosticsProvider.Instance;
#endif
}
Expand Down
14 changes: 13 additions & 1 deletion xidio/xidio.CLI/xidio.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,19 @@
<ProjectReference Include="..\xidio.Platform.Windows\xidio.Platform.Windows.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net10.0-windows'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net10.0' and $([MSBuild]::IsOSPlatform('Linux'))">
<DefineConstants>$(DefineConstants);LINUX</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net10.0' and $([MSBuild]::IsOSPlatform('OSX'))">
<DefineConstants>$(DefineConstants);MACOS</DefineConstants>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net10.0' and $([MSBuild]::IsOSPlatform('Linux'))">
<ProjectReference Include="..\xidio.Platform.Linux\xidio.Platform.Linux.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net10.0' and $([MSBuild]::IsOSPlatform('OSX'))">
<ProjectReference Include="..\xidio.Platform.macOS\xidio.Platform.macOS.csproj" />
</ItemGroup>

Expand Down
Loading
Loading