n2b 0.1.0 → 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 +6 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3de539be7363cf775fc09b14001ae6775670075543030ba46d1b8c176e3ec7e
4
- data.tar.gz: c01a0bca5a0df44a9736c78c574d9f9c0ba056012d188c6b8a1386bcad48d6cb
3
+ metadata.gz: '00568c10ff4e0c1684ef83fe6579d40ac1d89623fbd704db4810b3b031fffb40'
4
+ data.tar.gz: e6f22194fadffcf43ed553bb37693607a49b2a9fe2a614748d9b3ae8e415eb30
5
5
  SHA512:
6
- metadata.gz: 2c815152121062403a7f5985c3cad091caaaa04f5774f467debae307747072fb293343e7d25fa008aed916e1b2c40c3ef08436af25f21a6b6a9dc0e6d7fe9aae
7
- data.tar.gz: a144fd904d8c7b37d28eb56e2f6977275fa4107a70da126ea936e727271149bc9146e6ce1103b2dab3cc03ee896186027e220c332d02f1508435f96d8d1530f1
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.0"
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.0
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
@@ -68,7 +68,10 @@ files:
68
68
  homepage: https://github.com/stefan-kp/n2b
69
69
  licenses:
70
70
  - MIT
71
- metadata: {}
71
+ metadata:
72
+ homepage_uri: https://github.com/stefan-kp/n2b
73
+ source_code_uri: https://github.com/stefan-kp/n2b
74
+ changelog_uri: https://github.com/stefan-kp/n2b/blob/main/CHANGELOG.md
72
75
  post_install_message:
73
76
  rdoc_options: []
74
77
  require_paths: