Skip to content

Restructure preview command: flags to subcommands#22

Merged
k-kohey merged 2 commits intomainfrom
preview-subcommands
Feb 27, 2026
Merged

Restructure preview command: flags to subcommands#22
k-kohey merged 2 commits intomainfrom
preview-subcommands

Conversation

@k-kohey
Copy link
Copy Markdown
Owner

@k-kohey k-kohey commented Feb 27, 2026

Summary

  • Restructure axe preview from flag-based modes (--watch/--serve) to proper subcommands (watch/serve)
  • Extract preview_watch.go and preview_serve.go as dedicated subcommand files
  • Update VS Code extension to use ["preview", "serve"] instead of ["preview", "--watch", "--serve"]
  • Update README, install.sh, and internal comments to reflect the new subcommand structure

Changes

File Change
cmd/axe/preview.go Oneshot-only parent command + shared helpers (resolveSourceFile, previewPreamble, runWatchLogic, runServeLogic)
cmd/axe/preview_watch.go New watch subcommand with --preview, --reuse-build, --strict flags
cmd/axe/preview_serve.go New serve subcommand with --strict flag
vscode-extension/src/config.ts buildArgs() emits ["preview", "serve", ...]; removed unused filePath parameter
vscode-extension/src/test/config.test.ts Tests updated for new format
vscode-extension/src/test/previewManager.test.ts Spawn args test updated
README.md Per-subcommand documentation with flag tables
install.sh Updated user-facing messages
.mise.toml, service.go, types.go Comment updates

Test plan

  • go build ./cmd/axe passes
  • go test ./cmd/... passes
  • VS Code extension: npm test — 118/118 passing
  • axe preview --help shows subcommands (watch, serve, report, simulator)
  • axe preview watch --help / axe preview serve --help show correct flags
  • axe preview (no args) → exit 1
  • axe preview --watchunknown flag: --watch (no backward compat — beta)
  • E2E: e2e/preview_all_test.sh

🤖 Generated with Claude Code

k-kohey and others added 2 commits February 28, 2026 05:49
- Introduced `watch` and `serve` subcommands to the `axe preview` command for enhanced functionality.
- Updated README to reflect changes in usage, including detailed descriptions of the new subcommands and their flags.
- Modified installation instructions for `idb_companion` to clarify its requirement for the new preview modes.
- Adjusted configuration files and scripts to support the new command structure and improve user experience.
- Enhanced error handling and validation for project configuration detection.

This update aims to streamline the preview process and provide users with more flexible options for real-time development.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@k-kohey k-kohey merged commit c5d05d3 into main Feb 27, 2026
3 checks passed
@k-kohey k-kohey deleted the preview-subcommands branch March 24, 2026 05:47
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