termpilot 0.1.0 → 0.1.1

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: 4e4a484bd4f496557a819f238c658e150aa2a84d31f02fb968aae58c4e1972d6
4
- data.tar.gz: 1e3c8c41cf4308ef0b0aa1220fa3dcb9ee03453e4f424b262b6a78ae9c8b9adf
3
+ metadata.gz: 2c7362568c06c84d321922bbbb4db3e93345bfed3911964bad3d11ceb6537bdb
4
+ data.tar.gz: c1398ae58653d61d6c8e3b6d364e2ef2e5ed24f5f9d0e72ba13b5769d195da12
5
5
  SHA512:
6
- metadata.gz: b5b693f5421a0d137f91cdc1ba7420c41a8aba46a7a9fd9ce84235a9cd48ba58acbdce000da0a54940fb5dc7fe7e865447c057648468a6e367cbdf061c3e023c
7
- data.tar.gz: 2bfd59ad9e93736ae2bcff331f440e9ada198efd1525f75367d9691deddc47a9487ea315c6adade22237c18bad62764445910a0d75f97576183d0aa47b769dac
6
+ metadata.gz: 34dceb19b4386df7353ea5eae45e3280ee4fd95fe5aa9d1f7718fd7a6787b1cc2633392cb792222407b4d2107166fe5dc1692f4e5f9268d576ad877a3da37fc3
7
+ data.tar.gz: 81a866c62018bc63271440ed6e04f8c1f4465fc1e776b7f6694de5d7c35294bdbb0ff0b5f67b2cff8fcf7e228937e432c8c09bdcd03725d22f17e7a12d007e4f
data/bin/termpilot CHANGED
@@ -1,8 +1,23 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
+ require 'optparse'
4
5
  require_relative '../lib/termpilot'
5
6
 
6
- query = ARGV.join(' ')
7
+ options = { empty_prompt: false }
8
+
9
+ OptionParser.new do |opts|
10
+ opts.banner = 'Usage: termpilot [options]'
11
+
12
+ opts.on('-e', '--emtpy-context', 'Empty context: removes termplilot\'s
13
+ default context so that you can ask a more general question.') do |_text|
14
+ options[:empty_prompt] = true
15
+ end
16
+ end.parse!
17
+
18
+ query = {
19
+ prompt: ARGV.join(' '),
20
+ context: options[:empty_prompt]
21
+ }
7
22
 
8
23
  Termpilot.run query
@@ -26,8 +26,12 @@ module Services
26
26
  end
27
27
 
28
28
  def self.prepare_query(query)
29
- "I want you to respond only wth the code snippet or terminal command I ask
30
- for, nothing else. No other text, only the code or command. I would like to know the command to #{query}"
29
+ if query[:context]
30
+ query[:prompt]
31
+ else
32
+ "I want you to respond only wth the code snippet or terminal command I ask
33
+ for, nothing else. No other text, only the code or command. I would like to know the command to #{query[:prompt]}"
34
+ end
31
35
  end
32
36
 
33
37
  # Only works on macOS
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: termpilot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Collins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-10 00:00:00.000000000 Z
11
+ date: 2024-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-openai
@@ -48,7 +48,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
48
48
  requirements:
49
49
  - - ">="
50
50
  - !ruby/object:Gem::Version
51
- version: '0'
51
+ version: 3.1.0
52
52
  required_rubygems_version: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - ">="