Skip to content

Add completion spec for wsl (Windows Subsystem for Linux)#191

Open
acarl005 wants to merge 1 commit into
mainfrom
add-wsl-completion-spec
Open

Add completion spec for wsl (Windows Subsystem for Linux)#191
acarl005 wants to merge 1 commit into
mainfrom
add-wsl-completion-spec

Conversation

@acarl005
Copy link
Copy Markdown
Contributor

@acarl005 acarl005 commented Mar 3, 2026

My Remarks

This is one of the most difficult cases as there is no reference implementation in fish-shell or Fig. It's a good data point for how hard the commands can be to implement.

Oz Run

https://oz.staging.warp.dev/runs/6de6a2e8-3d07-4e9b-b747-03748c4e86ca

Summary

Add completion spec and dynamic generators for wsl (Windows Subsystem for Linux).

The spec was built by inspecting the WSL source code, specifically:

  • src/windows/inc/wsl.h — all command-line argument definitions
  • src/windows/common/WslClient.cpp — argument parsing and subcommand routing
  • localization/strings/en-US/Resources.resw — official help text and descriptions

What's included

JSON spec (command-signatures/json/wsl.json)

Covers the full wsl.exe CLI:

  • Running Linux binaries: -d/--distribution, -u/--user, -e/--exec, --cd, --shell-type, --system
  • Distribution management: --install, --list, --set-default, --terminate, --unregister
  • Import/export: --export (with --format/--vhd), --import (with --version/--vhd), --import-in-place
  • Disk operations: --mount (with --vhd, --bare, --type, --options, --partition, --name), --unmount
  • System management: --manage (with --move, --set-sparse, --set-default-user, --resize), --shutdown, --update, --status
  • Version management: --set-version, --set-default-version
  • Info: --help, --version, --debug-shell, --uninstall

Rust generator (command-signatures/src/generators/wsl.rs)

Two generators for dynamic completions:

  • distros — lists installed distributions via wsl.exe --list --quiet
  • online_distros — lists available distributions via wsl.exe --list --online

Testing

  • All existing tests pass (cargo test)
  • JSON formatted with npm run format

This PR was generated with Oz.

Add JSON completion spec and Rust generators for the wsl command.

The spec covers:
- Running Linux binaries with options (-d, -u, -e, --cd, --shell-type, --system)
- Distribution management (--install, --list, --set-default, --terminate, --unregister)
- Import/export (--export, --import, --import-in-place)
- Disk operations (--mount, --unmount)
- System management (--manage, --shutdown, --update, --status)
- Version management (--set-version, --set-default-version)

Generators provide dynamic completions for:
- Installed distributions (via wsl.exe --list --quiet)
- Online available distributions (via wsl.exe --list --online)

Co-Authored-By: Oz <oz-agent@warp.dev>
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