Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmd/internal/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func PersistentFlags(parentCmd *cobra.Command, opts *ToolboxOptions) {

// ConfigFileFlags defines flags related to the configuration file.
// It should be applied to any command that requires configuration loading.
func ConfigFileFlags(flags *pflag.FlagSet, opts *ToolboxOptions) {
func ConfigFileFlags(parentCmd *cobra.Command, flags *pflag.FlagSet, opts *ToolboxOptions) {
flags.StringVar(&opts.Config, "config", "", "File path specifying the tool configuration. Cannot be used with --configs, or --config-folder.")
flags.StringVar(&opts.Config, "tools-file", "", "File path specifying the tool configuration. Cannot be used with --tools-files, or --tools-folder.")
_ = flags.MarkDeprecated("tools-file", "please use --config instead") // DEPRECATED
Expand All @@ -52,6 +52,7 @@ func ConfigFileFlags(flags *pflag.FlagSet, opts *ToolboxOptions) {
flags.StringVar(&opts.ConfigFolder, "config-folder", "", "Directory path containing YAML tool configuration files. All .yaml and .yml files in the directory will be loaded and merged. Cannot be used with --config, or --configs.")
flags.StringVar(&opts.ConfigFolder, "tools-folder", "", "Directory path containing YAML tool configuration files. All .yaml and .yml files in the directory will be loaded and merged. Cannot be used with --tools-file, or --tools-files.")
_ = flags.MarkDeprecated("tools-folder", "please use --config-folder instead") // DEPRECATED
parentCmd.MarkFlagsMutuallyExclusive("config", "configs", "config-folder")
Comment thread
Yuan325 marked this conversation as resolved.
Outdated
// Fetch prebuilt tools sources to customize the help description
prebuiltHelp := fmt.Sprintf(
"Use a prebuilt tool configuration by source type. Allowed: '%s'. Can be specified multiple times.",
Expand Down
2 changes: 1 addition & 1 deletion cmd/internal/invoke/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Example:
},
}
flags := cmd.Flags()
internal.ConfigFileFlags(flags, opts)
internal.ConfigFileFlags(cmd, flags, opts)
return cmd
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/internal/migrate/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func NewCommand(opts *internal.ToolboxOptions) *cobra.Command {
Long: "Migrate all configuration files provided to the flat format, updating deprecated fields and ensuring compatibility.",
}
flags := cmd.Flags()
internal.ConfigFileFlags(flags, opts)
internal.ConfigFileFlags(cmd.Command, flags, opts)
flags.BoolVar(&cmd.dryRun, "dry-run", false, "Preview the converted format without applying actual changes.")
cmd.RunE = func(*cobra.Command, []string) error { return runMigrate(cmd, opts) }
return cmd.Command
Expand Down
2 changes: 1 addition & 1 deletion cmd/internal/skills/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func NewCommand(opts *internal.ToolboxOptions) *cobra.Command {
}

flags := cmd.Flags()
internal.ConfigFileFlags(flags, opts)
internal.ConfigFileFlags(cmd.Command, flags, opts)
flags.StringVar(&cmd.name, "name", "", "Name of the generated skill.")
flags.StringVar(&cmd.description, "description", "", "Description of the generated skill")
flags.StringVar(&cmd.toolset, "toolset", "", "Name of the toolset to convert into a skill. If not provided, all tools will be included.")
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func NewCommand(opts *internal.ToolboxOptions) *cobra.Command {
// setup flags that are common across all commands
internal.PersistentFlags(cmd, opts)
flags := cmd.Flags()
internal.ConfigFileFlags(flags, opts)
internal.ConfigFileFlags(cmd, flags, opts)
internal.ServeFlags(flags, opts)
flags.BoolVar(&opts.Cfg.DisableReload, "disable-reload", false, "Disables dynamic reloading of tools file.")
flags.BoolVar(&opts.Cfg.IgnoreUnknownTools, "ignore-unknown-tools", false, "Log warnings and skip unknown/unsupported tool types instead of failing to start.")
Expand Down
Loading