@@ -37,7 +37,8 @@ import (
3737var Version = "dev"
3838
3939type globalFlags struct {
40- color string
40+ color string
41+ verbose bool
4142}
4243
4344func main () {
@@ -54,6 +55,7 @@ func run(args []string) error {
5455 return err
5556 }
5657 renderer := ui .New (ui .ColorMode (global .color ), os .Stdout , os .Stderr )
58+ renderer .SetVerbose (global .verbose )
5759 if len (args ) == 0 {
5860 return commandInstall (renderer , nil )
5961 }
@@ -89,6 +91,11 @@ func run(args []string) error {
8991func parseGlobal (args []string , flags * globalFlags ) ([]string , error ) {
9092 remaining := make ([]string , 0 , len (args ))
9193 for len (args ) > 0 {
94+ if args [0 ] == "--verbose" {
95+ flags .verbose = true
96+ args = args [1 :]
97+ continue
98+ }
9299 if ! strings .HasPrefix (args [0 ], "--color" ) {
93100 remaining , args = append (remaining , args [0 ]), args [1 :]
94101 continue
@@ -153,6 +160,9 @@ func commandInstall(r *ui.Renderer, args []string) error {
153160 if err := state .SavePreferences (state.Preferences {Hosts : hosts .Strings (ids ), Internal : * internal }); err != nil {
154161 return err
155162 }
163+ if path , err := paths .PreferencesPath (); err == nil {
164+ r .Verbose ("Updated preferences: %s" , path )
165+ }
156166 if err := refreshUpdates (r ); err != nil {
157167 return err
158168 }
@@ -183,12 +193,14 @@ func installOptionalTools(r *ui.Renderer, vale, docsBuilder, dryRun bool) error
183193 }
184194 if vale {
185195 r .Info ("Installing Vale and Elastic Vale rules." )
196+ r .Verbose ("Runs the upstream Elastic Vale Rules installer; it reports the Vale binary, configuration, and rule paths it edits." )
186197 if err := bootstrap .InstallVale (); err != nil {
187198 return fmt .Errorf ("install Vale and Elastic Vale rules: %w" , err )
188199 }
189200 }
190201 if docsBuilder {
191202 r .Info ("Installing docs-builder." )
203+ r .Verbose ("Runs the upstream docs-builder installer; it reports the binary path it edits." )
192204 if err := bootstrap .InstallDocsBuilder (); err != nil {
193205 return fmt .Errorf ("install docs-builder: %w" , err )
194206 }
@@ -469,27 +481,44 @@ func synchronize(ids []hosts.ID, internal, dryRun, force bool, r *ui.Renderer) e
469481 }
470482 if dryRun {
471483 r .Info ("Would refresh public%s skills in ~/.agents/skills." , map [bool ]string {true : " and internal" , false : "" }[internal ])
484+ if root , err := paths .CanonicalSkillsDir (); err == nil {
485+ r .Verbose ("Would refresh managed skills beneath: %s" , root )
486+ }
472487 } else {
473488 r .Success ("Installed %d managed skills." , len (skillResult .Installed ))
489+ for _ , path := range skillResult .Files {
490+ r .Verbose ("Updated managed skill or discovery link: %s" , path )
491+ }
474492 }
475493 r .Section ("Synchronizing host adapters" )
476494 adapterResult , err := adapters .Sync (ids , internal , dryRun , force )
477495 if err != nil {
478496 return err
479497 }
480498 if dryRun {
499+ for name , host := range adapterResult .Hosts {
500+ for _ , path := range host .Files {
501+ r .Verbose ("Would update %s configuration: %s" , name , path )
502+ }
503+ }
481504 r .Info ("Would configure %d selected host adapters." , len (ids ))
482505 return nil
483506 }
484507 for name , host := range adapterResult .Hosts {
485508 s .Hosts [name ] = host
509+ for _ , path := range host .Files {
510+ r .Verbose ("Updated %s configuration: %s" , name , path )
511+ }
486512 }
487513 for name , record := range skillResult .Records {
488514 s .Skills [name ] = record
489515 }
490516 if err := state .Save (s ); err != nil {
491517 return err
492518 }
519+ if path , err := paths .StatePath (); err == nil {
520+ r .Verbose ("Updated managed state: %s" , path )
521+ }
493522 for _ , warning := range adapterResult .Warnings {
494523 r .Warn ("%s" , warning )
495524 }
@@ -529,5 +558,6 @@ Commands:
529558
530559Global options:
531560 --color auto|always|never
561+ --verbose Show managed file locations that are changed
532562` )
533563}
0 commit comments