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
+88-26Lines changed: 88 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,19 +4,56 @@ 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
-
Install SnapShell via pip with the following command:
14
+
### Prerequisites
15
+
16
+
- Python 3.7 or higher
17
+
-`pip` package manager
18
+
19
+
### Installing via pip
20
+
21
+
Install SnapShell with the following command:
15
22
16
23
```sh
17
24
pip install snapshell
18
25
```
19
26
27
+
### Custom Installation
28
+
29
+
SnapShell requires your Groq Api key during installation. Follow the on-screen instructions after installation
30
+
31
+
The installation will automatically store the key in `~/.snapshell_config.json` file.
32
+
33
+
OR
34
+
35
+
```sh
36
+
git clone https://github.com/KTS-o7/snapshell.git
37
+
cd snapshell
38
+
python -m venv env
39
+
source env/bin/activate
40
+
pip install -r requirements.txt
41
+
python setup.py install
42
+
```
43
+
44
+
## Dependencies
45
+
46
+
SnapShell requires the following libraries:
47
+
48
+
-`argparse`: For parsing command-line arguments.
49
+
-`sqlite3`: For local database operations.
50
+
-`os`: To interact with your operating system.
51
+
52
+
## Configuration Instructions
53
+
54
+
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
+
20
57
## Usage
21
58
22
59
Run SnapShell in your terminal using:
@@ -41,55 +78,80 @@ snapshell --view-history
41
78
snapshell --clear-history
42
79
```
43
80
81
+
## Advanced Usage
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
+
85
+
## How It Works
86
+
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.
88
+
44
89
## Functions
45
90
46
91
-`view_history()`: Fetch and display the command history from the local database.
47
92
-`clear_history()`: Clear the command history in the local database.
48
93
-`main()`: The primary function that handles user input, command-line arguments, and interaction.
49
94
50
-
## Dependencies
95
+
## API Documentation
51
96
52
-
SnapShell requires the following libraries:
97
+
SnapShell does not directly expose API endpoints, but it interacts with the GROQ API under the hood. Here’s a brief overview:
53
98
54
-
-`argparse`: For parsing command-line arguments.
55
-
-`colorama`: For colorized terminal output.
56
-
-`sqlite3`: For local database operations.
57
-
-`os`: To interact with your operating system.
99
+
-**GROQ API Key**: Used to authenticate the SnapShell tool.
100
+
-**Command Suggestions**: SnapShell queries the GROQ API with the user's input to retrieve command suggestions in real-time.
101
+
If the project exposes new APIs in the future, detailed endpoint documentation should be added here.
58
102
59
-
## How It Works
103
+
## Contributing
60
104
61
-
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.
105
+
We welcome contributions! If you'd like to contribute, please follow these steps:
62
106
63
-
## Custom Installation
107
+
1.**Fork the repository**:Click the "Fork" button at the top of the GitHub repository page.
108
+
1.**Create a branch**: Create a new feature or bugfix branch.
64
109
65
-
SnapShell requires your GROQ API key during installation. Follow the on-screen instructions after installation
110
+
```sh
111
+
git checkout -b feature/new-feature
112
+
```
66
113
67
-
The installation will automatically detect your shell (bash, zsh, fish) and set the key in the respective configuration file.
114
+
3.**Code Style**: Follow PEP 8 guidelines for Python code.
115
+
4.**Testing**: Ensure your code passes all existing tests and add new tests if necessary.
116
+
5.**Submit a Pull Request**: Once your changes are ready, submit a pull request for review.
68
117
69
-
OR
118
+
We currently need help to integrate SnapShell with more shells and support more platforms like windows.
70
119
71
-
```bash
72
-
git clone https://github.com/KTS-o7/snapshell.git
73
-
cd snapshell
74
-
python -m venv env
75
-
source env/bin/activate
76
-
pip install -r requirements.txt
77
-
python setup.py install
120
+
## Troubleshooting
121
+
122
+
### Common Issues
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
+
126
+
```sh
127
+
pip install --upgrade pip
78
128
```
79
129
80
-
## License
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:
81
131
82
-
SnapShell is licensed under the MIT License. For more details, see the LICENSE file.
132
+
```sh
133
+
cat ~/.snapshell_config.json
134
+
```
83
135
84
-
## Contributing
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.
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:
85
138
86
-
We welcome contributions! If you'd like to contribute, please open an issue or submit a pull request for any bug fixes or feature improvements.
139
+
```sh
140
+
rm ~/.snapshell/system_info.db
141
+
```
87
142
88
-
We currently need help to integrate SnapShell with more shells and support more platforms like windows.
143
+
If you encounter other issues, feel free to open an issue in the GitHub repository or contact us.
144
+
145
+
## License
146
+
147
+
SnapShell is licensed under the MIT License. For more details, see the LICENSE file.
89
148
90
149
## Contact
91
150
92
151
For any questions, issues, or feature requests, please reach out to:
0 commit comments