commitgpt 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 39ba14207dd3a3821b77597f628a3a5eb5c4d350bac6f5aac1828feda130f7df
4
- data.tar.gz: d03c824c7e5f6b31a3e16dc1175def59b85980da67e9767a643242ea5d65b1df
3
+ metadata.gz: cc31b958101709cf5acae4d52106fd56ede0dea448fbc8332d60f4865315adeb
4
+ data.tar.gz: d60c821b82edd35a28caa2254a72722208af8019af86bb5e6f30d326f6a77845
5
5
  SHA512:
6
- metadata.gz: 84fed7c25c40981c4ac1c6d29e26c5260b3b79a59e7e7921aec5d0f176d826f07c06d21d354fd7168d3b0a0f17a9bcd834271d17cd5a2db0cf63964de02a4dd0
7
- data.tar.gz: e443c012f0ddb35f03551a4d7b943dd207c5500f647e6cacf429f20e3ce1e6863eced86f9292232c7ce49a6aa6fb2d088e180d3c59b8bc268e24fd07d980b097
6
+ metadata.gz: ee1adb84767305fb84d0b2371685498ebcb28efaaf50920425483c3db563a7e1917fa69735f08203f6d990d071d3b5c0536c28992cf655f3a75db5b49bb8fb99
7
+ data.tar.gz: 77e6f1cb82eecfe6e30f947fe3dd2fc1a0c4a456f104bee0119f459ae56296297183e16dcb4858bcef2a2857207cc4ecd2d7865df7a57760820e23df6ea21706
data/bin/aicm CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require "commitgpt/cli"
4
+ require 'commitgpt/cli'
5
5
  CommitGpt::CLI.start
data/commitgpt.gemspec CHANGED
@@ -1,34 +1,35 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "lib/commitgpt/version"
3
+ require_relative 'lib/commitgpt/version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
- spec.name = "commitgpt"
6
+ spec.name = 'commitgpt'
7
7
  spec.version = CommitGpt::VERSION
8
- spec.authors = ["Peng Zhang"]
9
- spec.email = ["zpregister@gmail.com"]
8
+ spec.authors = ['Peng Zhang']
9
+ spec.email = ['zpregister@gmail.com']
10
10
 
11
- spec.summary = "A CLI AI that writes git commit messages for you."
12
- spec.description = "A CLI that writes your git commit messages for you with AI. Never write a commit message again."
13
- spec.homepage = "https://github.com/ZPVIP/commitgpt"
14
- spec.license = "MIT"
15
- spec.required_ruby_version = ">= 2.6.0"
16
- spec.metadata["homepage_uri"] = spec.homepage
17
- spec.metadata["source_code_uri"] = spec.homepage
18
- spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md"
11
+ spec.summary = 'A CLI AI that writes git commit messages for you.'
12
+ spec.description = 'A CLI that writes your git commit messages for you with AI. Never write a commit message again.'
13
+ spec.homepage = 'https://github.com/ZPVIP/commitgpt'
14
+ spec.license = 'MIT'
15
+ spec.required_ruby_version = '>= 2.6.0'
16
+ spec.metadata['homepage_uri'] = spec.homepage
17
+ spec.metadata['source_code_uri'] = spec.homepage
18
+ spec.metadata['changelog_uri'] = "#{spec.homepage}/blob/master/CHANGELOG.md"
19
+ spec.metadata['rubygems_mfa_required'] = 'true'
19
20
 
20
21
  # Specify which files should be added to the gem when it is released.
21
22
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
- spec.files = Dir.glob("lib/**/*") + Dir.glob("bin/*") + %w[README.md LICENSE commitgpt.gemspec]
23
+ spec.files = Dir.glob('lib/**/*') + Dir.glob('bin/*') + %w[README.md LICENSE commitgpt.gemspec]
23
24
  .reject { |f| File.directory?(f) }
24
- spec.bindir = "bin"
25
+ spec.bindir = 'bin'
25
26
  spec.executables = spec.files.grep(%r{\Abin/}) { |f| File.basename(f) }
26
- spec.require_paths = ["lib"]
27
+ spec.require_paths = ['lib']
27
28
 
28
29
  # Uncomment to register a new dependency of your gem
29
- spec.add_dependency "httparty", "~> 0.18"
30
- spec.add_dependency "thor", "~> 1.2"
31
- spec.add_dependency "tty-prompt", "~> 0.23"
30
+ spec.add_dependency "httparty", "~> 0.24"
31
+ spec.add_dependency "thor", "~> 1.4"
32
+ spec.add_dependency 'tty-prompt', '~> 0.23'
32
33
 
33
34
  # For more information and examples about making a new gem, checkout our
34
35
  # guide at: https://bundler.io/guides/creating_gem.html
data/lib/commitgpt/cli.rb CHANGED
@@ -1,18 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "thor"
4
- require "commitgpt/commit_ai"
5
- require "commitgpt/setup_wizard"
3
+ require 'thor'
4
+ require 'commitgpt/commit_ai'
5
+ require 'commitgpt/setup_wizard'
6
6
 
7
7
  module CommitGpt
8
8
  # CommitGpt CLI
9
9
  class CLI < Thor
10
10
  default_task :generate
11
11
 
12
- desc "generate", "AI commits for you!"
13
- method_option :models, aliases: "-m", type: :boolean, desc: "List/Select available models"
14
- method_option :verbose, aliases: "-v", type: :boolean, desc: "Show git diff being sent to AI"
15
- method_option :provider, aliases: "-p", type: :boolean, desc: "Switch active provider"
12
+ desc 'generate', 'AI commits for you!'
13
+ method_option :models, aliases: '-m', type: :boolean, desc: 'List/Select available models'
14
+ method_option :verbose, aliases: '-v', type: :boolean, desc: 'Show git diff being sent to AI'
15
+ method_option :provider, aliases: '-p', type: :boolean, desc: 'Switch active provider'
16
16
  def generate
17
17
  if options[:provider]
18
18
  CommitGpt::SetupWizard.new.switch_provider
@@ -23,36 +23,41 @@ module CommitGpt
23
23
  end
24
24
  end
25
25
 
26
- desc "setup", "Configure AI provider and settings"
26
+ desc 'setup', 'Configure AI provider and settings'
27
27
  def setup
28
28
  CommitGpt::SetupWizard.new.run
29
29
  end
30
30
 
31
31
  # Custom help message
32
- def self.help(shell, subcommand = false)
33
- shell.say "Usage:"
34
- shell.say " aicm # Generate AI commit message (Default)"
35
- shell.say " aicm setup # Configure AI provider and settings"
36
- shell.say " aicm help [COMMAND] # Describe available commands"
37
- shell.say ""
38
- shell.say "Options:"
39
- shell.say " -m, --models # Interactive model selection"
40
- shell.say " -p, --provider # Switch active provider"
41
- shell.say " -v, --verbose # Show git diff being sent to AI"
42
- shell.say ""
32
+ def self.help(shell, _subcommand = false)
33
+ shell.say 'Usage:'
34
+ shell.say ' aicm # Generate AI commit message (Default)'
35
+ shell.say ' aicm setup # Configure AI provider and settings'
36
+ shell.say ' aicm help [COMMAND] # Describe available commands'
37
+ shell.say ''
38
+ shell.say 'Options:'
39
+ shell.say ' -m, --models # Interactive model selection'
40
+ shell.say ' -p, --provider # Switch active provider'
41
+ shell.say ' -v, --verbose # Show git diff being sent to AI'
42
+ shell.say ''
43
43
 
44
44
  # Show current configuration
45
45
  begin
46
- require "commitgpt/config_manager"
47
- require "commitgpt/string"
46
+ require 'commitgpt/config_manager'
47
+ require 'commitgpt/string'
48
48
  config = CommitGpt::ConfigManager.get_active_provider_config
49
49
  if config
50
- shell.say "Current Configuration:"
50
+ require 'commitgpt/version'
51
+ shell.say "CommitGPT v#{CommitGpt::VERSION}"
52
+ shell.say "Bin Path: #{File.realpath($PROGRAM_NAME)}".gray
53
+ shell.say ''
54
+
55
+ shell.say 'Current Configuration:'
51
56
  shell.say " Provider: #{config['name'].green}"
52
57
  shell.say " Model: #{config['model'].cyan}"
53
58
  shell.say " Base URL: #{config['base_url']}"
54
59
  shell.say " Diff Len: #{config['diff_len']}"
55
- shell.say ""
60
+ shell.say ''
56
61
  end
57
62
  rescue StandardError
58
63
  # Ignore errors during help display if config is missing/invalid