You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40-28Lines changed: 40 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,27 +4,31 @@ SnapShell is a powerful command-line utility designed to enhance your Linux term
4
4
5
5
## Features
6
6
7
-
-**Smart Auto-completion**: Get AI-powered command suggestions based on what you're typing.
7
+
-**Informed Sugestion**: Get AI-powered command suggestions based on the query and your system's installed packages.
8
8
-**Command History**: Review previously suggested commands at any time.
9
9
-**History Management**: Clear the command history with a single command.
10
10
-**Database Update**: Easily update the database with the installed packages on your system.
11
11
12
12
## Installation
13
13
14
14
### Prerequisites
15
+
15
16
- Python 3.7 or higher
16
17
-`pip` package manager
17
18
18
-
### Installing via pip
19
+
### Installing via pip
20
+
19
21
Install SnapShell with the following command:
20
22
21
23
```sh
22
24
pip install snapshell
23
25
```
26
+
24
27
### Custom Installation
28
+
25
29
SnapShell requires your Groq Api key during installation. Follow the on-screen instructions after installation
26
30
27
-
The installation will automatically detect your shell (bash, zsh, fish) and set the key in the respective configuration file.
31
+
The installation will automatically store the key in `~/.snapshell_config.json` file.
28
32
29
33
OR
30
34
@@ -36,6 +40,7 @@ source env/bin/activate
36
40
pip install -r requirements.txt
37
41
python setup.py install
38
42
```
43
+
39
44
## Dependencies
40
45
41
46
SnapShell requires the following libraries:
@@ -45,23 +50,11 @@ SnapShell requires the following libraries:
45
50
-`os`: To interact with your operating system.
46
51
47
52
## Configuration Instructions
48
-
To use SnapShell, you need to set up the `HELPER_GROQ_API_KEY` environment variable. This is required for connecting to the underlying Language Model API.
49
-
### Setting the `HELPER_GROQ_API_KEY`
50
-
1. Obtain your API key from the GROQ service.
51
-
1. Set it as an environment variable:
52
-
```sh
53
-
export HELPER_GROQ_API_KEY="your_api_key_here"
54
-
```
55
-
Alternatively, you can add this to your shell's configuration file (`.bashrc`, `.zshrc`, etc.):
To use SnapShell, you need to provide `GROQ_API_KEY` when prompted for the first time.
55
+
For any changes in the key you can edit `~/.snapshell_config.json` file and add the appropriate key.
56
+
57
+
## Usage
65
58
66
59
Run SnapShell in your terminal using:
67
60
@@ -84,12 +77,13 @@ snapshell --update-db
84
77
snapshell --view-history
85
78
snapshell --clear-history
86
79
```
80
+
87
81
## Advanced Usage
88
-
You can chain arguments or integrate SnapShell with other terminal utilities for more advanced operations. Here's an example:
89
-
```sh
90
-
snapshell --update-db | grep "package-name"
91
-
```
82
+
83
+
SnapShell is intuitive and primitive to use. It suggests commands based on your input and maintains a history of suggestions. You can view or clear the command history at any time.
84
+
92
85
## How It Works
86
+
93
87
SnapShell leverages a Language Learning Model to suggest relevant Linux commands based on user input. It keeps a local history of suggestions that can be reviewed or cleared at your discretion. Upon installation, SnapShell can update its internal database with packages installed on your system, ensuring up-to-date suggestions.
94
88
95
89
## Functions
@@ -99,42 +93,57 @@ SnapShell leverages a Language Learning Model to suggest relevant Linux commands
99
93
-`main()`: The primary function that handles user input, command-line arguments, and interaction.
100
94
101
95
## API Documentation
96
+
102
97
SnapShell does not directly expose API endpoints, but it interacts with the GROQ API under the hood. Here’s a brief overview:
98
+
103
99
-**GROQ API Key**: Used to authenticate the SnapShell tool.
104
100
-**Command Suggestions**: SnapShell queries the GROQ API with the user's input to retrieve command suggestions in real-time.
105
-
If the project exposes new APIs in the future, detailed endpoint documentation should be added here.
101
+
If the project exposes new APIs in the future, detailed endpoint documentation should be added here.
106
102
107
103
## Contributing
108
104
109
-
We welcome contributions! If you'd like to contribute, please follow these steps:
105
+
We welcome contributions! If you'd like to contribute, please follow these steps:
106
+
110
107
1.**Fork the repository**:Click the "Fork" button at the top of the GitHub repository page.
111
108
1.**Create a branch**: Create a new feature or bugfix branch.
109
+
112
110
```sh
113
111
git checkout -b feature/new-feature
114
112
```
113
+
115
114
3.**Code Style**: Follow PEP 8 guidelines for Python code.
116
115
4.**Testing**: Ensure your code passes all existing tests and add new tests if necessary.
117
116
5.**Submit a Pull Request**: Once your changes are ready, submit a pull request for review.
118
117
119
118
We currently need help to integrate SnapShell with more shells and support more platforms like windows.
120
119
121
120
## Troubleshooting
121
+
122
122
### Common Issues
123
+
123
124
1.**Installation Errors**: Ensure that you have the correct version of Python and pip installed. If dependencies fail to install, try updating pip:
125
+
124
126
```sh
125
127
pip install --upgrade pip
126
128
```
127
-
2.**Missing GROQ_API_KEY**: If SnapShell is not functioning properly, make sure the `HELPER_GROQ_API_KEY` is correctly set as an environment variable. You can check this by running:
129
+
130
+
1.**Missing GROQ_API_KEY**: If SnapShell is not functioning properly, make sure the api-key is correctly set in config. You can check this by running:
131
+
128
132
```sh
129
-
echo$HELPER_GROQ_API_KEY
133
+
cat ~/.snapshell_config.json
130
134
```
135
+
131
136
3.**Permission Denied**: If you encounter a "permission denied" error, try running the command with `sudo` or ensure you have the necessary file permissions.
132
137
4.**Clearing History Not Working**: If the history isn’t clearing, you might need to manually reset the SQLite database file used by SnapShell:
138
+
133
139
```sh
134
-
rm ~/.snapshell/history.db
140
+
rm ~/.snapshell/system_info.db
135
141
```
142
+
136
143
If you encounter other issues, feel free to open an issue in the GitHub repository or contact us.
144
+
137
145
## License
146
+
138
147
SnapShell is licensed under the MIT License. For more details, see the LICENSE file.
139
148
140
149
## Contact
@@ -143,3 +152,6 @@ For any questions, issues, or feature requests, please reach out to:
0 commit comments