Skip to content

Commit 07fe322

Browse files
committed
docs: add host app development guide and update CLI help
1 parent 3cfc34d commit 07fe322

File tree

10 files changed

+411
-41
lines changed

10 files changed

+411
-41
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,19 @@ Modulus provides a comprehensive command-line tool for module development and ma
115115
| `modulus uninstall <name>` | Uninstall a module |
116116
| `modulus list` | List installed modules |
117117

118+
### Create Host App (plugin-based application)
119+
120+
```bash
121+
# Avalonia desktop host app
122+
modulus new avaloniaapp -n MyApp
123+
124+
# Blazor Hybrid (MAUI) host app
125+
modulus new blazorapp -n MyApp
126+
```
127+
128+
**Notes:**
129+
- `blazorapp` is a **MAUI** host template and typically requires **Windows** to build.
130+
118131
### Create Module
119132

120133
```bash
@@ -236,6 +249,7 @@ modulus install ./output/MyExtension-1.0.0.modpkg
236249
- [Getting Started Guide](./docs/getting-started.md)
237250
- [CLI Reference](./docs/cli-reference.md)
238251
- [Module Development Guide](./docs/module-development.md)
252+
- [Host App Development Guide](./docs/host-app-development.md)
239253
- [OpenSpec Specifications](./openspec/specs/)
240254
- [Contributing Guide](./CONTRIBUTING.md)
241255

README.zh-CN.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,19 @@ Modulus 提供全面的命令行工具用于模块开发和管理。
115115
| `modulus uninstall <name>` | 卸载模块 |
116116
| `modulus list` | 列出已安装模块 |
117117

118+
### 创建 Host App(插件式应用)
119+
120+
```bash
121+
# Avalonia 桌面 Host App
122+
modulus new avaloniaapp -n MyApp
123+
124+
# Blazor Hybrid(MAUI)Host App
125+
modulus new blazorapp -n MyApp
126+
```
127+
128+
**注意:**
129+
- `blazorapp`**MAUI** Host 模板,通常需要 **Windows** 才能稳定构建。
130+
118131
### 创建模块
119132

120133
```bash
@@ -236,6 +249,7 @@ modulus install ./output/MyExtension-1.0.0.modpkg
236249
- [快速入门指南](./docs/getting-started.zh-CN.md)
237250
- [CLI 参考](./docs/cli-reference.md)
238251
- [模块开发指南](./docs/module-development.md)
252+
- [Host App 开发指南](./docs/host-app-development.zh-CN.md)
239253
- [OpenSpec 规格说明](./openspec/specs/)
240254
- [贡献指南](./CONTRIBUTING.zh-CN.md)
241255

docs/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ Welcome to the Modulus project documentation.
1010

1111
### Module Development
1212
- [Module Development Guide](./module-development.md) - In-depth module development guide
13+
- [Host App Development Guide](./host-app-development.md) - Create and customize plugin-based host apps
1314
- [CLI Reference](./cli-reference.md) - Complete CLI command reference
1415

1516
## 🔧 Reference
1617

1718
### OpenSpec Specifications
1819
- [Module Packaging](../openspec/specs/module-packaging/spec.md) - Module packaging format
19-
- [Manifest Format](../openspec/specs/vsixmanifest-format/spec.md) - extension.vsixmanifest format
20+
- [Module Template](../openspec/specs/module-template/spec.md) - includes extension.vsixmanifest conventions
2021

2122
### Architecture
2223
- [Project Context](../openspec/project.md) - Project overview and architecture
@@ -33,6 +34,7 @@ Common images and resources used across documentation are stored in the [Images]
3334
| Getting Started | [getting-started.md](./getting-started.md) | [getting-started.zh-CN.md](./getting-started.zh-CN.md) |
3435
| CLI Reference | [cli-reference.md](./cli-reference.md) | - |
3536
| Module Development | [module-development.md](./module-development.md) | - |
37+
| Host App Development | [host-app-development.md](./host-app-development.md) | [host-app-development.zh-CN.md](./host-app-development.zh-CN.md) |
3638

3739
## Contributing to Documentation
3840

docs/cli-reference.md

Lines changed: 67 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Modulus CLI Reference
22

3-
The Modulus CLI (`modulus`) is a command-line tool for creating, building, packaging, and managing Modulus modules.
3+
The Modulus CLI (`modulus`) is a command-line tool for creating, building, packaging, and managing Modulus projects (modules and host apps).
44

55
## Installation
66

@@ -19,7 +19,7 @@ dotnet tool uninstall -g Agibuild.Modulus.Cli
1919

2020
| Command | Description |
2121
|---------|-------------|
22-
| `modulus new` | Create a new module project |
22+
| `modulus new` | Create a new project (module or host app) |
2323
| `modulus build` | Build the module project |
2424
| `modulus pack` | Package the module for distribution |
2525
| `modulus install` | Install a module |
@@ -30,7 +30,7 @@ dotnet tool uninstall -g Agibuild.Modulus.Cli
3030

3131
## modulus new
3232

33-
Create a new Modulus module project with all necessary files and structure.
33+
Create a new Modulus project with all necessary files and structure.
3434

3535
### Syntax
3636

@@ -42,7 +42,7 @@ modulus new [<template>] -n <name> [options]
4242

4343
| Argument | Required | Description |
4444
|----------|----------|-------------|
45-
| `<template>` | No | Template name: `module-avalonia` or `module-blazor` (default: `module-avalonia`) |
45+
| `<template>` | No | Template name: `avaloniaapp`, `blazorapp`, `module-avalonia`, `module-blazor` (default: `module-avalonia`) |
4646

4747
### Options
4848

@@ -55,6 +55,8 @@ modulus new [<template>] -n <name> [options]
5555

5656
### Templates
5757

58+
- `avaloniaapp`: Modulus host app (Avalonia)
59+
- `blazorapp`: Modulus host app (Blazor Hybrid / MAUI)
5860
- `module-avalonia`: Modulus module (Avalonia)
5961
- `module-blazor`: Modulus module (Blazor)
6062

@@ -64,6 +66,12 @@ modulus new [<template>] -n <name> [options]
6466
# List templates
6567
modulus new --list
6668

69+
# Create an Avalonia host app
70+
modulus new avaloniaapp -n MyApp
71+
72+
# Create a Blazor Hybrid (MAUI) host app
73+
modulus new blazorapp -n MyApp
74+
6775
# Create an Avalonia module (default template)
6876
modulus new -n MyModule
6977

@@ -76,10 +84,13 @@ modulus new -n MyModule --force
7684

7785
### Generated Structure
7886

87+
#### Module project (module-avalonia / module-blazor)
88+
7989
```
8090
MyModule/
8191
├── MyModule.sln
8292
├── .gitignore
93+
├── Directory.Build.props
8394
├── extension.vsixmanifest
8495
├── MyModule.Core/
8596
│ ├── MyModule.Core.csproj
@@ -93,6 +104,54 @@ MyModule/
93104
└── MainView.axaml.cs
94105
```
95106

107+
#### Host app project (avaloniaapp / blazorapp)
108+
109+
```
110+
MyApp/
111+
├── MyApp.sln
112+
├── .gitignore
113+
├── Directory.Build.props
114+
└── MyApp.Host.Avalonia/ (or MyApp.Host.Blazor)
115+
├── appsettings.json
116+
└── ... host entrypoint + UI files ...
117+
```
118+
119+
**Notes:**
120+
- `blazorapp` is a **MAUI** host template and typically requires **Windows** to build.
121+
122+
#### Host app details
123+
124+
**Avalonia host app (`avaloniaapp`)**
125+
126+
- **Project**: `MyApp.Host.Avalonia/`
127+
- **Typical entrypoint**: `Program.cs`
128+
- **Typical UI**: `App.axaml`, `MainWindow.axaml`
129+
- **Build & run**:
130+
131+
```bash
132+
cd MyApp
133+
dotnet build -c Release
134+
dotnet run --project MyApp.Host.Avalonia -c Release
135+
```
136+
137+
**Blazor Hybrid (MAUI) host app (`blazorapp`)**
138+
139+
- **Project**: `MyApp.Host.Blazor/`
140+
- **Typical entrypoint**: `MauiProgram.cs` + platform entry under `Platforms/`
141+
- **Build prerequisites**:
142+
- Windows machine
143+
- .NET MAUI workload installed (for example: `dotnet workload install maui`)
144+
- **Build & run**:
145+
146+
```bash
147+
cd MyApp
148+
dotnet build -c Release
149+
dotnet run --project MyApp.Host.Blazor -c Release
150+
```
151+
152+
See also:
153+
- [`docs/host-app-development.md`](./host-app-development.md)
154+
96155
---
97156

98157
## modulus build
@@ -217,8 +276,7 @@ modulus install <source> [options]
217276

218277
Modules are installed to:
219278
- **Windows**: `%APPDATA%\Modulus\Modules\{ModuleId}\`
220-
- **macOS**: `~/Library/Application Support/Modulus/Modules/{ModuleId}/`
221-
- **Linux**: `~/.local/share/Modulus/Modules/{ModuleId}/`
279+
- **macOS/Linux**: `~/.modulus/Modules/{ModuleId}/`
222280

223281
### Examples
224282

@@ -306,7 +364,7 @@ modulus list --verbose
306364
# Installed Modules:
307365
# MyModule v1.0.0
308366
# ID: a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d
309-
# Path: /Users/you/.local/share/Modulus/Modules/MyModule
367+
# Path: ~/.modulus/Modules/MyModule
310368
# Installed: 2025-12-14 10:30:00
311369
```
312370

@@ -324,11 +382,11 @@ modulus list --verbose
324382

325383
| Variable | Description |
326384
|----------|-------------|
327-
| `MODULUS_HOME` | Override default Modulus data directory |
385+
| `MODULUS_CLI_DATABASE_PATH` | Override CLI database path (primarily for tests/automation) |
386+
| `MODULUS_CLI_MODULES_DIR` | Override CLI modules directory (primarily for tests/automation) |
328387

329388
## See Also
330389

331390
- [Getting Started](./getting-started.md)
332391
- [Module Development Guide](./module-development.md)
333-
- [Manifest Format](./manifest-format.md)
334392

docs/getting-started.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This guide will walk you through setting up your development environment, creati
44

55
## Prerequisites
66

7-
- **.NET 9 SDK** or later
7+
- **.NET 10 SDK** or later
88
- **IDE**: Visual Studio 2022, JetBrains Rider, or VS Code
99
- **Git** (optional, for cloning the repository)
1010

@@ -77,6 +77,8 @@ This creates a module with the following structure:
7777
MyFirstModule/
7878
├── MyFirstModule.sln # Solution file
7979
├── .gitignore
80+
├── Directory.Build.props # Generated to reference Modulus assemblies from the CLI installation
81+
├── extension.vsixmanifest # Module manifest
8082
├── MyFirstModule.Core/ # Core logic (host-agnostic)
8183
│ ├── MyFirstModule.Core.csproj
8284
│ ├── MyFirstModuleModule.cs # Module entry point
@@ -191,27 +193,26 @@ The manifest file is automatically generated by the template and contains:
191193

192194
| Command | Description |
193195
|---------|-------------|
194-
| `modulus new <name>` | Create a new module project |
196+
| `modulus new` | Create a new project (module or host app) |
195197
| `modulus build` | Build the module in current directory |
196198
| `modulus pack` | Build and package as .modpkg |
197199
| `modulus install <source>` | Install a module from .modpkg or directory |
198200
| `modulus uninstall <name>` | Uninstall a module |
199201
| `modulus list` | List installed modules |
200202

201-
### modulus new
203+
### Create a Host App (plugin-based application)
202204

203205
```bash
204-
modulus new MyModule [options]
206+
# Avalonia desktop host app
207+
modulus new avaloniaapp -n MyApp
205208

206-
Options:
207-
-t, --target <avalonia|blazor> Target host platform
208-
-d, --display-name <name> Display name in menus
209-
-p, --publisher <name> Publisher name
210-
-i, --icon <icon> Menu icon (e.g., Folder, Home, Settings)
211-
--output <path> Output directory
212-
--force Overwrite existing files
209+
# Blazor Hybrid (MAUI) host app
210+
modulus new blazorapp -n MyApp
213211
```
214212

213+
**Notes:**
214+
- `blazorapp` is a **MAUI** host template and typically requires **Windows** to build.
215+
215216
### modulus build
216217

217218
```bash
@@ -253,8 +254,7 @@ Options:
253254

254255
- [Module Development Guide](./module-development.md) - Deep dive into module development
255256
- [CLI Reference](./cli-reference.md) - Complete CLI command reference
256-
- [Manifest Format](./manifest-format.md) - Understanding extension.vsixmanifest
257-
- [UI Components](./ui-components.md) - Available UI components and styling
257+
- [Host App Development Guide](./host-app-development.md) - Create and customize plugin-based host apps
258258

259259
## Troubleshooting
260260

docs/getting-started.zh-CN.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## 环境要求
66

7-
- **.NET 9 SDK** 或更高版本
7+
- **.NET 10 SDK** 或更高版本
88
- **IDE**: Visual Studio 2022、JetBrains Rider 或 VS Code
99
- **Git**(可选,用于克隆仓库)
1010

@@ -77,6 +77,8 @@ cd MyFirstModule
7777
MyFirstModule/
7878
├── MyFirstModule.sln # 解决方案文件
7979
├── .gitignore
80+
├── Directory.Build.props # 由 CLI 生成,用于从 CLI 安装目录引用 Modulus 程序集
81+
├── extension.vsixmanifest # 模块清单
8082
├── MyFirstModule.Core/ # 核心逻辑(主机无关)
8183
│ ├── MyFirstModule.Core.csproj
8284
│ ├── MyFirstModuleModule.cs # 模块入口点
@@ -191,27 +193,26 @@ dotnet run --project path/to/Modulus/src/Hosts/Modulus.Host.Avalonia
191193

192194
| 命令 | 描述 |
193195
|------|------|
194-
| `modulus new <name>` | 创建新模块项目 |
196+
| `modulus new` | 创建新项目(模块或 Host App) |
195197
| `modulus build` | 在当前目录编译模块 |
196198
| `modulus pack` | 编译并打包为 .modpkg |
197199
| `modulus install <source>` | 从 .modpkg 或目录安装模块 |
198200
| `modulus uninstall <name>` | 卸载模块 |
199201
| `modulus list` | 列出已安装模块 |
200202

201-
### modulus new
203+
### 创建 Host App(插件式应用)
202204

203205
```bash
204-
modulus new MyModule [options]
206+
# Avalonia 桌面 Host App
207+
modulus new avaloniaapp -n MyApp
205208

206-
选项:
207-
-t, --target <avalonia|blazor> 目标主机平台
208-
-d, --display-name <name> 菜单中显示的名称
209-
-p, --publisher <name> 发布者名称
210-
-i, --icon <icon> 菜单图标(如 Folder, Home, Settings)
211-
--output <path> 输出目录
212-
--force 覆盖已有文件
209+
# Blazor Hybrid(MAUI)Host App
210+
modulus new blazorapp -n MyApp
213211
```
214212

213+
**注意:**
214+
- `blazorapp`**MAUI** Host 模板,通常需要 **Windows** 才能稳定构建。
215+
215216
### modulus build
216217

217218
```bash
@@ -251,10 +252,9 @@ modulus install <source> [options]
251252

252253
## 下一步
253254

254-
- [模块开发指南](./module-development.zh-CN.md) - 深入了解模块开发
255-
- [CLI 参考](./cli-reference.zh-CN.md) - 完整的 CLI 命令参考
256-
- [清单格式](./manifest-format.zh-CN.md) - 理解 extension.vsixmanifest
257-
- [UI 组件](./ui-components.zh-CN.md) - 可用的 UI 组件和样式
255+
- [模块开发指南](./module-development.md) - 深入了解模块开发(英文)
256+
- [CLI 参考](./cli-reference.md) - 完整的 CLI 命令参考(英文)
257+
- [Host App 开发指南](./host-app-development.zh-CN.md) - Host App 创建与定制(中文)
258258

259259
## 故障排除
260260

0 commit comments

Comments
 (0)