Skip to content

Commit 2c03640

Browse files
authored
Merge pull request #3 from nerdylelouch/docs
Improved_documentation
2 parents 7f36b6a + c9cac39 commit 2c03640

1 file changed

Lines changed: 88 additions & 26 deletions

File tree

README.md

Lines changed: 88 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,56 @@ SnapShell is a powerful command-line utility designed to enhance your Linux term
44

55
## Features
66

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.
88
- **Command History**: Review previously suggested commands at any time.
99
- **History Management**: Clear the command history with a single command.
1010
- **Database Update**: Easily update the database with the installed packages on your system.
1111

1212
## Installation
1313

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:
1522

1623
```sh
1724
pip install snapshell
1825
```
1926

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+
2057
## Usage
2158

2259
Run SnapShell in your terminal using:
@@ -41,55 +78,80 @@ snapshell --view-history
4178
snapshell --clear-history
4279
```
4380

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+
4489
## Functions
4590

4691
- `view_history()`: Fetch and display the command history from the local database.
4792
- `clear_history()`: Clear the command history in the local database.
4893
- `main()`: The primary function that handles user input, command-line arguments, and interaction.
4994

50-
## Dependencies
95+
## API Documentation
5196

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:
5398

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.
58102

59-
## How It Works
103+
## Contributing
60104

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:
62106

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.
64109

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+
```
66113

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.
68117

69-
OR
118+
We currently need help to integrate SnapShell with more shells and support more platforms like windows.
70119

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
78128
```
79129

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:
81131

82-
SnapShell is licensed under the MIT License. For more details, see the LICENSE file.
132+
```sh
133+
cat ~/.snapshell_config.json
134+
```
83135

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:
85138

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+
```
87142

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.
89148

90149
## Contact
91150

92151
For any questions, issues, or feature requests, please reach out to:
93152

94153
**Krishnatejaswi S**
95154
[shentharkrishnatejaswi@gmail.com](mailto:shentharkrishnatejaswi@gmail.com)
155+
156+
## Contributors
157+
- [Nihaal SP](https://github.com/nerdylelouch)

0 commit comments

Comments
 (0)