n2b 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +32 -6
  3. data/lib/n2b/version.rb +1 -1
  4. data/lib/n2b.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36e89a27c564ad37f194815b57e41bd78179b3ddf50158006c52d779e90e5fc4
4
- data.tar.gz: 77a5f7e26fca5b0a69e8e8f84fe479e850fda943d020aa68f6e3e10e1fa19e13
3
+ metadata.gz: '00568c10ff4e0c1684ef83fe6579d40ac1d89623fbd704db4810b3b031fffb40'
4
+ data.tar.gz: e6f22194fadffcf43ed553bb37693607a49b2a9fe2a614748d9b3ae8e415eb30
5
5
  SHA512:
6
- metadata.gz: adcf95ef2faf2c5d8671ac86ece4144955c8f970c02162f093bfe751bbc72f47d30d38d4805ce7ea97d0b0ce14ba576651d031f966b981290fcd52d74cb4590d
7
- data.tar.gz: d4095cf87fe1e423898be331fba7a639abfe44ff3431a005b7c16e0a5789d4c8b8de74beac618935c4af5d2501b5e32a0c85b359bd7bbf2480d8b234d4c515ab
6
+ metadata.gz: f40a0f2829fc6b2cfcdf512c08bf2a754d41e3fed6bdbbfbe6d63cfde7aa9318b6f8256dea2655e0dfea5485e5bfc358faaae3ee643905ed1c873d2770e62c21
7
+ data.tar.gz: 054066fa79caf2cdc0077017abf6e01d4b06ed361199d0d9471549a232c77af63adf613642056f12aceb300894329ed832c607a4dcf4e537ba5dfa9a4d0fc6fb
data/README.md CHANGED
@@ -11,6 +11,26 @@ N2B (Natural to Bash) is a Ruby gem that converts natural language instructions
11
11
  - Shell history integration
12
12
  - Command history tracking for improved context
13
13
 
14
+ ## Quick Example
15
+
16
+ ```
17
+ n2b init a new github repo called abc, add local files, transmit
18
+ ```
19
+
20
+ results in
21
+ ```
22
+ Translated /bin/zsh Commands:
23
+ ------------------------
24
+ git init
25
+ git remote add origin https://github.com/yourusername/abc.git
26
+ git add .
27
+ git commit -m 'Initial commit'
28
+ git push -u origin main
29
+ ------------------------
30
+ Explanation:
31
+ These commands initialize a new Git repository, add a remote GitHub repository named 'abc', stage all local files, create an initial commit, and push the changes to GitHub. Replace 'yourusername' with your actual GitHub username. Note that you'll need to create the repository on GitHub first before running these commands. Also, ensure you have Git installed and configured with your GitHub credentials.
32
+ ```
33
+ ------------------------
14
34
  ## Installation
15
35
 
16
36
  Install the gem by running:
@@ -44,15 +64,15 @@ Examples:
44
64
 
45
65
  1. Generate commands without executing:
46
66
 
47
- n2b list all PDF files in the current directory
67
+ ```n2b list all PDF files in the current directory ```
48
68
 
49
69
  2. Generate and execute commands:
50
70
 
51
- n2b -x create a new directory named 'project' and initialize a git repository in it
71
+ ```n2b -x create a new directory named 'project' and initialize a git repository in it ```
52
72
 
53
73
  3. Reconfigure the tool:
54
74
 
55
- n2b -c
75
+ ```n2b -c ```
56
76
 
57
77
  ## How It Works
58
78
 
@@ -65,12 +85,18 @@ n2b -c
65
85
  ## Privacy
66
86
 
67
87
  N2B allows you to configure what information is sent to the Claude API:
68
- - Shell history
69
- - Past n2b requests and responses
70
- - Current working directory
88
+ - Shell history / probably not needed, I added the option to give the llm more context
89
+ - Past n2b requests and responses / probably not needed, I added the option to give the llm more context
90
+ - Current working directory / recommended
71
91
 
72
92
  You can adjust these settings during configuration.
73
93
 
94
+ Always sent to llm
95
+ - prompt
96
+ - shell type
97
+ - operating system
98
+
99
+
74
100
  ## Limitations
75
101
 
76
102
  - The quality of generated commands depends on the Claude AI model's capabilities.
data/lib/n2b/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # lib/n2b/version.rb
2
2
  module N2B
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
data/lib/n2b.rb CHANGED
@@ -109,7 +109,7 @@ module N2B
109
109
 
110
110
  def read_llm_history_file
111
111
  history = File.read(HISTORY_FILE) if File.exist?(HISTORY_FILE)
112
- history || ''
112
+ history ||= ''
113
113
  # limit to 20 most recent commands
114
114
  history.split("\n").last(20).join("\n")
115
115
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: n2b
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Nothegger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-08 00:00:00.000000000 Z
11
+ date: 2024-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json