Class: Ace::Support::Models::CLI::Commands::Providers::Sync
- Inherits:
-
Cli::Command
- Object
- Cli::Command
- Ace::Support::Models::CLI::Commands::Providers::Sync
- Includes:
- Cli::Base
- Defined in:
- lib/ace/support/models/cli/commands/providers/sync.rb
Overview
Sync provider YAML configs with models.dev
Instance Method Summary collapse
Instance Method Details
#call(**options) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/ace/support/models/cli/commands/providers/sync.rb', line 34 def call(**) orchestrator = Organisms::ProviderSyncOrchestrator.new result = orchestrator.sync( config_dir: [:config_dir], provider: [:provider], apply: [:apply], commit: [:commit], show_all: [:all], since: [:since] ) if result[:status] == :error raise Ace::Support::Cli::Error.new(result[:message]) end if [:json] puts JSON.pretty_generate(result) else puts orchestrator.format_result(result) end rescue CacheError => e raise Ace::Support::Cli::Error.new("#{e.}. Run 'ace-models sync' first to download model data.") rescue ConfigError => e raise Ace::Support::Cli::Error.new("Config error: #{e.}") end |