# SnapShell
SnapShell is a powerful command-line utility designed to enhance your Linux terminal experience by auto-completing commands using a Language Learning Model (LLM). SnapShell intelligently suggests commands based on your input, maintains a history of suggested commands, and allows you to manage your command history with ease.
## Features
- **Informed Sugestion**: Get AI-powered command suggestions based on the query and your system's installed packages.
- **Command History**: Review previously suggested commands at any time.
- **History Management**: Clear the command history with a single command.
- **Database Update**: Easily update the database with the installed packages on your system.
## Installation
### Prerequisites
- Python 3.10 or higher
- `pip` package manager
### Installing via pip
Install SnapShell with the following command:
```sh
pip install snapshell
```
### Custom Installation
SnapShell requires your Groq Api key during installation. Follow the on-screen instructions after installation
The installation will automatically store the key in `~/.snapshell_config.json` file.
OR
```sh
git clone https://github.com/KTS-o7/snapshell.git
cd snapshell
python -m venv env
source env/bin/activate
pip install -r requirements.txt
python setup.py install
```
## Dependencies
SnapShell requires the following libraries:
- `argparse`: For parsing command-line arguments.
- `sqlite3`: For local database operations.
- `os`: To interact with your operating system.
## Configuration Instructions
To use SnapShell, you need to provide `GROQ_API_KEY` when prompted for the first time.
For any changes in the key you can edit `~/.snapshell_config.json` file and add the appropriate key.
## Usage
Run SnapShell in your terminal using:
```sh
snapshell
```
### Command-line Arguments
SnapShell supports the following arguments:
- `--update-db`: Updates the database with currently installed packages.
- `--view-history`: Displays the command suggestion history.
- `--clear-history`: Clears all entries from the command history.
Example usage:
```sh
snapshell --update-db
snapshell --view-history
snapshell --clear-history
```
## Advanced Usage
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.
## How It Works
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.
## Functions
- `view_history()`: Fetch and display the command history from the local database.
- `clear_history()`: Clear the command history in the local database.
- `main()`: The primary function that handles user input, command-line arguments, and interaction.
## API Documentation
SnapShell does not directly expose API endpoints, but it interacts with the GROQ API under the hood. Here’s a brief overview:
- **GROQ API Key**: Used to authenticate the SnapShell tool.
- **Command Suggestions**: SnapShell queries the GROQ API with the user's input to retrieve command suggestions in real-time.
If the project exposes new APIs in the future, detailed endpoint documentation should be added here.
## Contributing
We welcome contributions! If you'd like to contribute, please follow these steps:
1. **Fork the repository**:Click the "Fork" button at the top of the GitHub repository page.
1. **Create a branch**: Create a new feature or bugfix branch.
```sh
git checkout -b feature/new-feature
```
3. **Code Style**: Follow PEP 8 guidelines for Python code.
4. **Testing**: Ensure your code passes all existing tests and add new tests if necessary.
5. **Submit a Pull Request**: Once your changes are ready, submit a pull request for review.
We currently need help to integrate SnapShell with more shells and support more platforms like windows.
## Troubleshooting
### Common Issues
1. **Installation Errors**: Ensure that you have the correct version of Python and pip installed. If dependencies fail to install, try updating pip:
```sh
pip install --upgrade pip
```
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:
```sh
cat ~/.snapshell_config.json
```
3. **Permission Denied**: If you encounter a "permission denied" error, try running the command with `sudo` or ensure you have the necessary file permissions.
4. **Clearing History Not Working**: If the history isn’t clearing, you might need to manually reset the SQLite database file used by SnapShell:
```sh
rm ~/.snapshell/system_info.db
```
If you encounter other issues, feel free to open an issue in the GitHub repository or contact us.
## License
SnapShell is licensed under the MIT License. For more details, see the LICENSE file.
## Contact
For any questions, issues, or feature requests, please reach out to:
**Krishnatejaswi S**
[shentharkrishnatejaswi@gmail.com](mailto:shentharkrishnatejaswi@gmail.com)
## Contributors
- [Nihaal SP](https://github.com/nerdylelouch)
Raw data
{
"_id": null,
"home_page": "https://github.com/KTS-o7/snapshell",
"name": "snapshell",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Krishnatejaswi S",
"author_email": "shentharkrishnatejaswi@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/d6/5b/bab80ee522097dbd99046619baea27d2337c4409c4aaafb1058e853f8643/snapshell-1.1.0.tar.gz",
"platform": null,
"description": "# SnapShell\n\nSnapShell is a powerful command-line utility designed to enhance your Linux terminal experience by auto-completing commands using a Language Learning Model (LLM). SnapShell intelligently suggests commands based on your input, maintains a history of suggested commands, and allows you to manage your command history with ease.\n\n## Features\n\n- **Informed Sugestion**: Get AI-powered command suggestions based on the query and your system's installed packages.\n- **Command History**: Review previously suggested commands at any time.\n- **History Management**: Clear the command history with a single command.\n- **Database Update**: Easily update the database with the installed packages on your system.\n\n## Installation\n\n### Prerequisites\n\n- Python 3.10 or higher\n- `pip` package manager\n\n### Installing via pip\n\nInstall SnapShell with the following command:\n\n```sh\npip install snapshell\n```\n\n### Custom Installation\n\nSnapShell requires your Groq Api key during installation. Follow the on-screen instructions after installation\n\nThe installation will automatically store the key in `~/.snapshell_config.json` file.\n\nOR\n\n```sh\ngit clone https://github.com/KTS-o7/snapshell.git\ncd snapshell\npython -m venv env\nsource env/bin/activate\npip install -r requirements.txt\npython setup.py install\n```\n\n## Dependencies\n\nSnapShell requires the following libraries:\n\n- `argparse`: For parsing command-line arguments.\n- `sqlite3`: For local database operations.\n- `os`: To interact with your operating system.\n\n## Configuration Instructions\n\nTo use SnapShell, you need to provide `GROQ_API_KEY` when prompted for the first time.\nFor any changes in the key you can edit `~/.snapshell_config.json` file and add the appropriate key.\n\n## Usage\n\nRun SnapShell in your terminal using:\n\n```sh\nsnapshell\n```\n\n### Command-line Arguments\n\nSnapShell supports the following arguments:\n\n- `--update-db`: Updates the database with currently installed packages.\n- `--view-history`: Displays the command suggestion history.\n- `--clear-history`: Clears all entries from the command history.\n\nExample usage:\n\n```sh\nsnapshell --update-db\nsnapshell --view-history\nsnapshell --clear-history\n```\n\n## Advanced Usage\n\nSnapShell 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.\n\n## How It Works\n\nSnapShell 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.\n\n## Functions\n\n- `view_history()`: Fetch and display the command history from the local database.\n- `clear_history()`: Clear the command history in the local database.\n- `main()`: The primary function that handles user input, command-line arguments, and interaction.\n\n## API Documentation\n\nSnapShell does not directly expose API endpoints, but it interacts with the GROQ API under the hood. Here\u2019s a brief overview:\n\n- **GROQ API Key**: Used to authenticate the SnapShell tool.\n- **Command Suggestions**: SnapShell queries the GROQ API with the user's input to retrieve command suggestions in real-time.\n If the project exposes new APIs in the future, detailed endpoint documentation should be added here.\n\n## Contributing\n\nWe welcome contributions! If you'd like to contribute, please follow these steps:\n\n1. **Fork the repository**:Click the \"Fork\" button at the top of the GitHub repository page.\n1. **Create a branch**: Create a new feature or bugfix branch.\n\n```sh\ngit checkout -b feature/new-feature\n```\n\n3. **Code Style**: Follow PEP 8 guidelines for Python code.\n4. **Testing**: Ensure your code passes all existing tests and add new tests if necessary.\n5. **Submit a Pull Request**: Once your changes are ready, submit a pull request for review.\n\nWe currently need help to integrate SnapShell with more shells and support more platforms like windows.\n\n## Troubleshooting\n\n### Common Issues\n\n1. **Installation Errors**: Ensure that you have the correct version of Python and pip installed. If dependencies fail to install, try updating pip:\n\n```sh\npip install --upgrade pip\n```\n\n1. **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:\n\n```sh\ncat ~/.snapshell_config.json\n```\n\n3. **Permission Denied**: If you encounter a \"permission denied\" error, try running the command with `sudo` or ensure you have the necessary file permissions.\n4. **Clearing History Not Working**: If the history isn\u2019t clearing, you might need to manually reset the SQLite database file used by SnapShell:\n\n```sh\nrm ~/.snapshell/system_info.db\n```\n\nIf you encounter other issues, feel free to open an issue in the GitHub repository or contact us.\n\n## License\n\nSnapShell is licensed under the MIT License. For more details, see the LICENSE file.\n\n## Contact\n\nFor any questions, issues, or feature requests, please reach out to:\n\n**Krishnatejaswi S** \n[shentharkrishnatejaswi@gmail.com](mailto:shentharkrishnatejaswi@gmail.com)\n\n## Contributors\n- [Nihaal SP](https://github.com/nerdylelouch)\n",
"bugtrack_url": null,
"license": null,
"summary": "An AI-powered tool to suggest Linux commands based on user input",
"version": "1.1.0",
"project_urls": {
"Homepage": "https://github.com/KTS-o7/snapshell"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "750dd25967bd535c8b6581d9055f43fa83f388d0b1afd38cdd8fe3dda00508e7",
"md5": "ef73c4c183aa8b4a9d7e9b46ee83fe06",
"sha256": "e33ca781bce18eb5c9534248d5e3f4048dfd6c6dc129f7cfde406def0c37cc06"
},
"downloads": -1,
"filename": "snapshell-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ef73c4c183aa8b4a9d7e9b46ee83fe06",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 24516,
"upload_time": "2024-10-10T06:47:30",
"upload_time_iso_8601": "2024-10-10T06:47:30.196295Z",
"url": "https://files.pythonhosted.org/packages/75/0d/d25967bd535c8b6581d9055f43fa83f388d0b1afd38cdd8fe3dda00508e7/snapshell-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d65bbab80ee522097dbd99046619baea27d2337c4409c4aaafb1058e853f8643",
"md5": "de3c25b296ce690a2d7153ec36f46189",
"sha256": "4cef1b6f83bdc89e9d75ffd937abe5ec23717123578e99ef75fa2dbebae02397"
},
"downloads": -1,
"filename": "snapshell-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "de3c25b296ce690a2d7153ec36f46189",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 23065,
"upload_time": "2024-10-10T06:47:31",
"upload_time_iso_8601": "2024-10-10T06:47:31.136036Z",
"url": "https://files.pythonhosted.org/packages/d6/5b/bab80ee522097dbd99046619baea27d2337c4409c4aaafb1058e853f8643/snapshell-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-10 06:47:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "KTS-o7",
"github_project": "snapshell",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "aiohappyeyeballs",
"specs": [
[
"==",
"2.4.3"
]
]
},
{
"name": "aiohttp",
"specs": [
[
"==",
"3.10.8"
]
]
},
{
"name": "aiosignal",
"specs": [
[
"==",
"1.3.1"
]
]
},
{
"name": "annotated-types",
"specs": [
[
"==",
"0.7.0"
]
]
},
{
"name": "anyio",
"specs": [
[
"==",
"4.6.0"
]
]
},
{
"name": "attrs",
"specs": [
[
"==",
"24.2.0"
]
]
},
{
"name": "certifi",
"specs": [
[
"==",
"2024.8.30"
]
]
},
{
"name": "charset-normalizer",
"specs": [
[
"==",
"3.3.2"
]
]
},
{
"name": "click",
"specs": [
[
"==",
"8.1.7"
]
]
},
{
"name": "distro",
"specs": [
[
"==",
"1.9.0"
]
]
},
{
"name": "docstring_parser",
"specs": [
[
"==",
"0.16"
]
]
},
{
"name": "frozenlist",
"specs": [
[
"==",
"1.4.1"
]
]
},
{
"name": "groq",
"specs": [
[
"==",
"0.11.0"
]
]
},
{
"name": "h11",
"specs": [
[
"==",
"0.14.0"
]
]
},
{
"name": "httpcore",
"specs": [
[
"==",
"1.0.5"
]
]
},
{
"name": "httpx",
"specs": [
[
"==",
"0.27.2"
]
]
},
{
"name": "idna",
"specs": [
[
"==",
"3.10"
]
]
},
{
"name": "instructor",
"specs": [
[
"==",
"1.5.0"
]
]
},
{
"name": "jiter",
"specs": [
[
"==",
"0.5.0"
]
]
},
{
"name": "markdown-it-py",
"specs": [
[
"==",
"3.0.0"
]
]
},
{
"name": "mdurl",
"specs": [
[
"==",
"0.1.2"
]
]
},
{
"name": "multidict",
"specs": [
[
"==",
"6.1.0"
]
]
},
{
"name": "openai",
"specs": [
[
"==",
"1.50.2"
]
]
},
{
"name": "pydantic",
"specs": [
[
"==",
"2.9.2"
]
]
},
{
"name": "pydantic_core",
"specs": [
[
"==",
"2.23.4"
]
]
},
{
"name": "Pygments",
"specs": [
[
"==",
"2.18.0"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.32.3"
]
]
},
{
"name": "rich",
"specs": [
[
"==",
"13.8.1"
]
]
},
{
"name": "setuptools",
"specs": [
[
"==",
"75.1.0"
]
]
},
{
"name": "shellingham",
"specs": [
[
"==",
"1.5.4"
]
]
},
{
"name": "sniffio",
"specs": [
[
"==",
"1.3.1"
]
]
},
{
"name": "tenacity",
"specs": [
[
"==",
"8.5.0"
]
]
},
{
"name": "tqdm",
"specs": [
[
"==",
"4.66.5"
]
]
},
{
"name": "typer",
"specs": [
[
"==",
"0.12.5"
]
]
},
{
"name": "typing_extensions",
"specs": [
[
"==",
"4.12.2"
]
]
},
{
"name": "urllib3",
"specs": [
[
"==",
"2.2.3"
]
]
},
{
"name": "yarl",
"specs": [
[
"==",
"1.13.1"
]
]
}
],
"lcname": "snapshell"
}