Skip to content

feat: add devtools extract and decompile CLI commands#5

Closed
Arthurvdv wants to merge 1 commit into
mainfrom
feat/devtools-cli
Closed

feat: add devtools extract and decompile CLI commands#5
Arthurvdv wants to merge 1 commit into
mainfrom
feat/devtools-cli

Conversation

@Arthurvdv

Copy link
Copy Markdown
Member

Summary

Adds two new CLI subcommands under alcops devtools:

alcops devtools extract

Download and extract BC DevTools from NuGet packages or VS Marketplace VSIX archives.

# NuGet DevTools (requires --tfm)
alcops devtools extract --source nuget --version latest --tfm net8.0 --output ./DevTools

# VS Marketplace VSIX (legacy/netstandard)
alcops devtools extract --source vsix --version prerelease --output ./DevTools

# With file filtering
alcops devtools extract --source nuget --tfm net8.0 --output ./DevTools --include '*.dll'

alcops devtools decompile

Decompile .NET assemblies using ILSpy CLI for source analysis.

alcops devtools decompile --input ./DevTools/net8.0 --output ./DevTools/decompiled

# Custom assembly list
alcops devtools decompile --input ./DevTools/net8.0 --output ./decompiled \
  --assemblies Microsoft.Dynamics.Nav.CodeAnalysis,Microsoft.Dynamics.Nav.CodeCop

Changes

  • src/devtools/package-extractor.ts - Shared ZIP extraction utility with path prefix filtering and optional glob include
  • src/devtools/extract-command.ts - NuGet + VSIX download and extraction orchestration
  • src/devtools/decompile-command.ts - ILSpy CLI orchestration (dotnet tool install + ilspycmd)
  • src/cli.ts - Wired devtools command group with extract/decompile subcommands
  • 20 new tests covering extraction, glob matching, command validation

Technical notes

  • Reuses existing primitives (fflate, httpsGetBuffer, version resolvers) - no new dependencies
  • In-memory ZIP extraction via fflate (v1; streaming optimization possible later)
  • JSON output to stdout, logs to stderr (matches existing CLI conventions)
  • Requires .NET SDK for decompile command only

Add 'alcops devtools extract' command to download and extract BC DevTools
from NuGet packages or VS Marketplace VSIX archives. Supports version
resolution (latest/prerelease/specific), TFM selection for NuGet, and
optional glob-based file filtering.

Add 'alcops devtools decompile' command to decompile .NET assemblies using
ILSpy CLI (ilspycmd via dotnet tool install). Configurable assembly list
with sensible defaults (8 BC DevTools assemblies).

Both commands output JSON to stdout with logs on stderr, matching existing
CLI conventions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Arthurvdv Arthurvdv closed this May 28, 2026
@Arthurvdv Arthurvdv deleted the feat/devtools-cli branch May 28, 2026 09:18
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