termpilot 0.1.0 → 0.1.2

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: f18a5ba3b28addb63bc15b1a6be6399523b2c8fb3d7e488b8fa61a0f7a652a14
4
+ data.tar.gz: d1209961390f701013ced27a896680c9f4af77bf4a1240a42eacf289b28b5036
5
5
  SHA512:
6
- metadata.gz: b5b693f5421a0d137f91cdc1ba7420c41a8aba46a7a9fd9ce84235a9cd48ba58acbdce000da0a54940fb5dc7fe7e865447c057648468a6e367cbdf061c3e023c
7
- data.tar.gz: 2bfd59ad9e93736ae2bcff331f440e9ada198efd1525f75367d9691deddc47a9487ea315c6adade22237c18bad62764445910a0d75f97576183d0aa47b769dac
6
+ metadata.gz: 84e0eac1b41b8a8302279200ff1e9e1ec59c7cff8b4470fc2c1148e536e092bc5cf16180c7cbe8d640bec37099396163376920cce7b9751c2832337ec75d9b09
7
+ data.tar.gz: a4e9505e37614516fe8901fc87a6aa23dd6723c36a1d352e7f324a6ac9c41a370e562ee22ec2d8e606dba040a9c2ee37108c0457fa5cda7d2c5a5dfbb9cdc734
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.2
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
@@ -39,7 +39,8 @@ files:
39
39
  homepage: https://github.com/taylorcc33/termpilot
40
40
  licenses:
41
41
  - MIT
42
- metadata: {}
42
+ metadata:
43
+ source_code_uri: https://github.com/taylorcc33/termpilot
43
44
  post_install_message:
44
45
  rdoc_options: []
45
46
  require_paths:
@@ -48,7 +49,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
48
49
  requirements:
49
50
  - - ">="
50
51
  - !ruby/object:Gem::Version
51
- version: '0'
52
+ version: 3.1.0
52
53
  required_rubygems_version: !ruby/object:Gem::Requirement
53
54
  requirements:
54
55
  - - ">="