Skip to content

feat: improve first-run experience with schema migration, config docs, and Windows installer#1511

Open
yanyihan-xiaomi wants to merge 14 commits into
mainfrom
feat/schema-url-and-config-docs
Open

feat: improve first-run experience with schema migration, config docs, and Windows installer#1511
yanyihan-xiaomi wants to merge 14 commits into
mainfrom
feat/schema-url-and-config-docs

Conversation

@yanyihan-xiaomi

@yanyihan-xiaomi yanyihan-xiaomi commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Improve first-run experience: schema migration, config discoverability, install script UX, and Windows PowerShell installer.

新用户首次安装体验改进:schema 迁移、配置文件可发现性、安装脚本 UX、Windows PowerShell 安装器。

Changes

Schema URL migration (config.ts, tui-migrate.ts, .mimocode/)

All hardcoded $schema URLs updated from opencode.ai to mimo.xiaomi.com/mimocode/.

Schema URL 全部从 opencode.ai 迁移到 mimo.xiaomi.com/mimocode/。

Auto-inject $schema into tui.json (tui.ts)

loadFile() now checks for missing $schema and writes it back to disk on first load, matching the existing behavior in config.ts for mimocode.jsonc.

tui.json 加载时自动注入 $schema 字段并写回文件,与 mimocode.jsonc 行为一致。

Seed starter config on clean install (config.ts)

loadGlobal() creates ~/.config/mimocode/mimocode.jsonc with a $schema field if no global config file exists. New users immediately know where config lives.

干净安装时在全局配置目录生成带 $schema 的空配置文件,让用户知道配置写在哪。

README configuration section (README.md, README.zh.md)

Added file location table, schema URL table, VS Code/Cursor trusted domain setup, data directory overview, and Windows PowerShell install instructions.

README 新增配置章节和 Windows 安装说明。

Install script UX (install)

  • Responsive logo: classic 6-line bold when terminal >= 80 cols, thin 3-line fallback
  • PATH hint: detect when install dir is not in PATH and prompt source <shell config>
  • Logo spacing fixed (C/╚ indent alignment)
  • Windows (Git Bash): handle mimo.exe naming correctly

安装脚本改进:自适应 logo、PATH 提示、logo 间距修正、Windows exe 文件名处理。

Windows PowerShell installer (install.ps1)

New install.ps1 for Windows users:

  • Usage: Set-ExecutionPolicy RemoteSigned -Scope CurrentUser then irm https://mimo.xiaomi.com/install.ps1 | iex
  • x64 + ARM64 architecture detection
  • AVX2/baseline detection via kernel32 (x64 only)
  • Persistent User PATH update via [Environment]::SetEnvironmentVariable
  • Responsive logo with Write-Logo helper

Windows 专用 PowerShell 安装脚本,支持 x64/ARM64、AVX2 检测、持久化 PATH、自适应 logo。

Verification

  • bun typecheck passes
  • Windows PowerShell install verified

Follow-up

Theme schema (https://mimo.xiaomi.com/mimocode/theme.json) 待运维部署后,单独 PR 更新主题文件中的 URL 并补充 README 文档。

…verability

- Update all $schema URLs from opencode.ai to mimo.xiaomi.com/mimocode/
- Auto-inject $schema into tui.json on first load (matching mimocode.jsonc behavior)
- Seed a starter ~/.config/mimocode/mimocode.jsonc on clean install
- Add configuration section to README with file paths, schema URLs, and VS Code setup
@yanyihan-xiaomi yanyihan-xiaomi self-assigned this Jul 1, 2026
- Show classic 6-line logo when terminal >= 80 cols, thin 3-line fallback otherwise
- Detect when PATH doesn't include install dir and prompt user to source shell config
- Handle --no-modify-path case by showing the export command directly
- Show classic 6-line bold logo when terminal >= 80 cols, thin 3-line fallback
- Detect when PATH doesn't include install dir and prompt source shell config
- Fix logo spacing: 2 spaces after NC on first/last lines (C/╚ indent), 1 on middle
- New install.ps1 with AVX2 detection, persistent User PATH update, responsive logo
- Usage: irm https://mimo.xiaomi.com/install.ps1 | iex
- Update README Quick Start with Windows PowerShell install instructions
- Bash: use mimo.exe on Windows, skip chmod
- PS1: detect ARM64 via PROCESSOR_ARCHITECTURE env var
- PS1: only run AVX2 baseline check for x64 targets
@yanyihan-xiaomi yanyihan-xiaomi marked this pull request as ready for review July 1, 2026 14:06
iex doesn't accept -Args; use environment variable for version pinning via pipeline
- Add UTF-8 BOM for direct .ps1 execution on PS 5.1
- Set Console.OutputEncoding to UTF-8 before logo output
- PS 5.1 defaults to system code page (GBK/936 on Chinese systems) which garbles Unicode block chars
MSYS2/Git Bash transparently resolves .exe extension in file operations, so explicit handling adds no value. Keep original behavior for consistency.
Single command, no permanent execution policy change needed
Windows 10 1803+ ships curl.exe which is significantly faster than
Invoke-WebRequest for large file downloads. Falls back to IWR if unavailable.
Set $ProgressPreference = SilentlyContinue to hide the blue progress bar
from Expand-Archive and Invoke-WebRequest fallback
Expand-Archive ignores it on PS 5.1 anyway, and the IWR fallback progress bar is acceptable UX. The real perf fix is curl.exe for downloads.
VS Code/Cursor cache env at launch, new terminals won't see PATH changes
@yanyihan-xiaomi yanyihan-xiaomi changed the title feat: migrate schema URLs to mimo.xiaomi.com and improve config discoverability feat: improve first-run experience with schema migration, config docs, and Windows installer Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant