Skip to content

feat(cli): add --fix flag to weave diagnose for auto-repair #220

@breferrari

Description

@breferrari

Summary

Add a --fix flag to weave diagnose that automatically repairs detected config drift issues instead of just reporting them.

Motivation

Currently weave diagnose reports issues (missing servers, stale entries, orphaned commands) but requires the user to manually fix them. Many issues have obvious, safe resolutions:

  • Missing server in CLI config → re-apply the pack
  • Orphaned command file → delete the file
  • Stale manifest entry → remove from manifest
  • Missing prompt block → re-inject from pack

A --fix flag would resolve these automatically, with clear reporting of what was changed.

Suggested behavior

  • weave diagnose — report only (current behavior, unchanged)
  • weave diagnose --fix — attempt to repair all fixable issues
  • Each repair action should be logged with what was changed
  • Unfixable issues (e.g., pack no longer in registry) should still be reported as errors
  • The --json output should include a fixed boolean per issue

Safety

  • Only fix issues where the correct action is unambiguous
  • Never delete user-created content (only Weave-managed entries identified by sidecar manifests)
  • Print a summary of all changes made

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions