# ChatCMD #
[![PyPI version](https://img.shields.io/pypi/v/chatcmd.svg?style=flat-square)](https://pypi.org/project/chatcmd)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/chatcmd.svg?style=flat-square)](https://pypi.org/project/chatcmd)
[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://en.wikipedia.org/wiki/MIT_License)
#### **ChatCMD** is an open source AI-driven CLI-based command lookup using ChatGPT to lookup relevant CLI commands based on user input and other generating and lookup features. ####
#### Boost Your Productivity, ***Say Goodbye*** to Manual Searches ####
## Features ##
- CLI-based command lookup using ChatGPT.
- Generate SQL query using ChatGPT.
- Generate a random user-agent.
- Generate a random password.
- Get your public IP address.
- Get a color Hex code by describing the color.
- Lookup HTTP Code.
- Lookup any port number
- Auto copy command to clipboard.
- Disable copy feature.
- Store Data in Sqlite Database.
- Add or update ChatGPT API key.
- Validate ChatGPT API key.
- Display ChatGPT API Key.
- Display last command.
- Display last {number} of commands.
- Delete last Command.
- Delete last {number} of commands.
- Display the total number of commands.
- Clear all history records.
- Display the database file size.
- Clear and validate user inputs.
- Clear and validate lookup results to ensure only valid CLI commands are returned.
- Error handling
- Display library information.
## Requirements ##
Python >= 3.8.9
OpenAI account and valid API key
https://platform.openai.com/signup
## Installation ##
pip3 install chatcmd
If pip not installed:
python3 -m pip install chatcmd
Installation output should display:
Collecting chatcmd
Using cached chatcmd-1.1.13-py3-none-any.whl (6.8 kB)
Installing collected packages: chatcmd
Successfully installed chatcmd-1.1.13
### Upgrade ###
pip3 install --upgrade chatcmd
If pip not installed:
python3 -m pip install --upgrade chatcmd
### Uninstall ###
pip3 uninstall chatcmd
If pip not installed:
python3 -m pip uninstall chatcmd
## Usage ##
```
Usage:
chatcmd [options]
Options:
-l, --lookup-cmd looking up a CLI command.
-q, --sql-query generate SQL query.
-u, --random-useragent generate a random user-agent
-i, --get-ip get your public IP address.
-p, --random-password generate a random password.
-c, --color-code get a color Hex code.
-a, --lookup-http-code lookup HTTP Code by code number.
-z, --port-lookup lookup any port number.
-k, --set-key set or update ChatGPT API key.
-o, --get-key display ChatGPT API key.
-g, --get-cmd display the last command.
-G, --get-last=<value> display the last [number] of commands.
-d, --delete-cmd delete the last command.
-D, --delete-last-cmd=<value> delete the last [number] of commands.
-t, --cmd-total display the total number of commands.
-r, --clear-history clear all history records.
-s, --db-size display the database size.
-n, --no-copy disable copy feature.
-h, --help display this screen.
-v, --version display ChatCMD version.
-x, --library-info display library information.
```
## Error Codes ##
Include an exception message for each error if occurs.
| Code | Description |
|------|:-----------------------------------:|
| 1001 | General exception |
| 1002 | Failed to connect to database |
| 1003 | Failed to get API key from database |
| 1004 | Failed to output API key |
| 1005 | Failed to save API key to database |
| 1006 | Invalid ChatGPT API key |
| 1007 | Failed requesting API key |
| 1008 | Failed to add command |
| 1009 | API key is invalid or missing |
| 1010 | OpenAI API error occurred |
| 1011 | Lookup exception occurred |
| 1012 | Failed to add command |
| 1013 | Failed to get last command |
| 1014 | Failed to get list of command |
| 1015 | Failed deleting last command |
| 1016 | Failed to get last command |
| 1017 | Failed clearing history |
| 1018 | Failed to copy command |
### Linux copy command issue
In order to perform a Graphics-related job in a Unix environment,
the DISPLAY variable needs to be set initially.
An error can occur when connecting to Linux via SSH, particularly if there is no copy/paste mechanism like Xclip installed.
To resolve this, you can try installing Xclip using the following command: "sudo apt-get install xclip".
Additionally, you need to export the DISPLAY variable by running: "export DISPLAY=:0.0".
To avoid the error message, you can use the "-no-copy" option when looking up a command, as it disables the copy feature.
## Screenshots ##
### Help screen: ###
<img src="https://github.com/naifalshaye/chatcmd/raw/master/chatcmd/images/help.png" alt="Help Screen" style="width:550px;"/>
### Library Info: ###
<img src="https://github.com/naifalshaye/chatcmd/raw/master/chatcmd/images/library-info.png" alt="Lookup Screen" style="width:500px;"/>
### Command Lookup screen: ###
<img src="https://github.com/naifalshaye/chatcmd/raw/master/chatcmd/images/lookup.png" alt="Lookup Screen" style="width:500px;"/>
### Tested on: ###
- Ubuntu 22.04
- Windows Server 2022
- macOS Ventura 13.0
## Support ##
[Issues](https://github.com/naifalshaye/chatcmd/issues)
Developed and maintained by:\
Naif Alshaye\
[https://naif.io](https://naif.io)\
naif@naif.io
## License
The MIT License (MIT). Please see License File [MIT License](https://choosealicense.com/licenses/mit/) for more information.
Raw data
{
"_id": null,
"home_page": "https://github.com/naifalshaye/chatcmd",
"name": "chatcmd",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7.1",
"maintainer_email": "",
"keywords": "cli,command,command-line,commandline,terminal,development,linux,ai,artificial-intelligence,chatgpt,chatcmd,lookup,open source,MIT",
"author": "Naif Alshaye",
"author_email": "Naif Alshaye <naif@naif.io>",
"download_url": "https://files.pythonhosted.org/packages/1e/c4/e017a9340b69ed63c01d2a9df2489baaadc6e49088795e861a67e9564635/chatcmd-1.1.13.tar.gz",
"platform": null,
"description": "# ChatCMD #\n\n[![PyPI version](https://img.shields.io/pypi/v/chatcmd.svg?style=flat-square)](https://pypi.org/project/chatcmd)\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/chatcmd.svg?style=flat-square)](https://pypi.org/project/chatcmd)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://en.wikipedia.org/wiki/MIT_License)\n\n#### **ChatCMD** is an open source AI-driven CLI-based command lookup using ChatGPT to lookup relevant CLI commands based on user input and other generating and lookup features. ####\n\n#### Boost Your Productivity, ***Say Goodbye*** to Manual Searches ####\n\n## Features ##\n- CLI-based command lookup using ChatGPT.\n- Generate SQL query using ChatGPT.\n- Generate a random user-agent.\n- Generate a random password.\n- Get your public IP address.\n- Get a color Hex code by describing the color.\n- Lookup HTTP Code.\n- Lookup any port number\n- Auto copy command to clipboard.\n- Disable copy feature.\n- Store Data in Sqlite Database.\n- Add or update ChatGPT API key.\n- Validate ChatGPT API key.\n- Display ChatGPT API Key.\n- Display last command.\n- Display last {number} of commands.\n- Delete last Command.\n- Delete last {number} of commands.\n- Display the total number of commands.\n- Clear all history records.\n- Display the database file size.\n- Clear and validate user inputs.\n- Clear and validate lookup results to ensure only valid CLI commands are returned.\n- Error handling\n- Display library information.\n\n## Requirements ##\n Python >= 3.8.9\n OpenAI account and valid API key\n https://platform.openai.com/signup\n## Installation ##\n pip3 install chatcmd\n \nIf pip not installed:\n\n python3 -m pip install chatcmd\n\nInstallation output should display:\n\n Collecting chatcmd\n Using cached chatcmd-1.1.13-py3-none-any.whl (6.8 kB)\n Installing collected packages: chatcmd\n Successfully installed chatcmd-1.1.13\n\n### Upgrade ###\n pip3 install --upgrade chatcmd\n\nIf pip not installed:\n\n python3 -m pip install --upgrade chatcmd\n\n### Uninstall ###\n pip3 uninstall chatcmd\n\nIf pip not installed:\n\n python3 -m pip uninstall chatcmd\n## Usage ##\n\n```\nUsage:\n\nchatcmd [options]\n \nOptions:\n -l, --lookup-cmd looking up a CLI command.\n -q, --sql-query generate SQL query.\n -u, --random-useragent generate a random user-agent\n -i, --get-ip get your public IP address.\n -p, --random-password generate a random password.\n -c, --color-code get a color Hex code.\n -a, --lookup-http-code lookup HTTP Code by code number.\n -z, --port-lookup lookup any port number.\n -k, --set-key set or update ChatGPT API key.\n -o, --get-key display ChatGPT API key.\n -g, --get-cmd display the last command.\n -G, --get-last=<value> display the last [number] of commands.\n -d, --delete-cmd delete the last command.\n -D, --delete-last-cmd=<value> delete the last [number] of commands.\n -t, --cmd-total display the total number of commands.\n -r, --clear-history clear all history records.\n -s, --db-size display the database size.\n -n, --no-copy disable copy feature.\n -h, --help display this screen.\n -v, --version display ChatCMD version.\n -x, --library-info display library information.\n\n```\n\n## Error Codes ##\nInclude an exception message for each error if occurs.\n\n| Code | Description |\n|------|:-----------------------------------:|\n| 1001 | General exception |\n| 1002 | Failed to connect to database |\n| 1003 | Failed to get API key from database |\n| 1004 | Failed to output API key |\n| 1005 | Failed to save API key to database |\n| 1006 | Invalid ChatGPT API key |\n| 1007 | Failed requesting API key |\n| 1008 | Failed to add command |\n| 1009 | API key is invalid or missing |\n| 1010 | OpenAI API error occurred |\n| 1011 | Lookup exception occurred |\n| 1012 | Failed to add command |\n| 1013 | Failed to get last command |\n| 1014 | Failed to get list of command |\n| 1015 | Failed deleting last command |\n| 1016 | Failed to get last command |\n| 1017 | Failed clearing history |\n| 1018 | Failed to copy command |\n\n### Linux copy command issue\nIn order to perform a Graphics-related job in a Unix environment,\nthe DISPLAY variable needs to be set initially.\nAn error can occur when connecting to Linux via SSH, particularly if there is no copy/paste mechanism like Xclip installed.\nTo resolve this, you can try installing Xclip using the following command: \"sudo apt-get install xclip\".\nAdditionally, you need to export the DISPLAY variable by running: \"export DISPLAY=:0.0\".\n\nTo avoid the error message, you can use the \"-no-copy\" option when looking up a command, as it disables the copy feature.\n\n## Screenshots ##\n### Help screen: ###\n<img src=\"https://github.com/naifalshaye/chatcmd/raw/master/chatcmd/images/help.png\" alt=\"Help Screen\" style=\"width:550px;\"/>\n\n### Library Info: ###\n<img src=\"https://github.com/naifalshaye/chatcmd/raw/master/chatcmd/images/library-info.png\" alt=\"Lookup Screen\" style=\"width:500px;\"/>\n\n### Command Lookup screen: ###\n<img src=\"https://github.com/naifalshaye/chatcmd/raw/master/chatcmd/images/lookup.png\" alt=\"Lookup Screen\" style=\"width:500px;\"/>\n\n### Tested on: ###\n - Ubuntu 22.04\n - Windows Server 2022\n - macOS Ventura 13.0\n\n## Support ##\n[Issues](https://github.com/naifalshaye/chatcmd/issues)\n\n\nDeveloped and maintained by:\\\nNaif Alshaye\\\n[https://naif.io](https://naif.io)\\\nnaif@naif.io\n\n\n\n## License\nThe MIT License (MIT). Please see License File [MIT License](https://choosealicense.com/licenses/mit/) for more information.\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "ChatCMD is an open source AI-driven CLI-based command lookup using ChatGPT to lookup relevant CLI commands based on user input.",
"version": "1.1.13",
"project_urls": {
"Bug Tracker": "https://github.com/naifalshaye/chatcmd/issues",
"Documentation": "https://github.com/naifalshaye/chatcmd/blob/master/README.md",
"Homepage": "https://github.com/naifalshaye/chatcmd",
"Repository": "https://github.com/naifalshaye/chatcmd.git"
},
"split_keywords": [
"cli",
"command",
"command-line",
"commandline",
"terminal",
"development",
"linux",
"ai",
"artificial-intelligence",
"chatgpt",
"chatcmd",
"lookup",
"open source",
"mit"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1bc8fddf1081f4f8f058525215261191b40e9e40325f0c0bff293c56b6172746",
"md5": "b4d6622623905540477627e3fd945051",
"sha256": "eb27e14c144fb1908adc959244252d7d6ac27aa71a6fd807824819554aa49200"
},
"downloads": -1,
"filename": "chatcmd-1.1.13-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b4d6622623905540477627e3fd945051",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7.1",
"size": 13046,
"upload_time": "2023-10-19T16:43:37",
"upload_time_iso_8601": "2023-10-19T16:43:37.844623Z",
"url": "https://files.pythonhosted.org/packages/1b/c8/fddf1081f4f8f058525215261191b40e9e40325f0c0bff293c56b6172746/chatcmd-1.1.13-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1ec4e017a9340b69ed63c01d2a9df2489baaadc6e49088795e861a67e9564635",
"md5": "bb7c1a1fe1362e0eaf50158d750156cb",
"sha256": "f1b80d690fcb5b003bba10b3627023444394614a69b987d4e3c616773a4c7aa9"
},
"downloads": -1,
"filename": "chatcmd-1.1.13.tar.gz",
"has_sig": false,
"md5_digest": "bb7c1a1fe1362e0eaf50158d750156cb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7.1",
"size": 13297,
"upload_time": "2023-10-19T16:43:40",
"upload_time_iso_8601": "2023-10-19T16:43:40.309847Z",
"url": "https://files.pythonhosted.org/packages/1e/c4/e017a9340b69ed63c01d2a9df2489baaadc6e49088795e861a67e9564635/chatcmd-1.1.13.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-19 16:43:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "naifalshaye",
"github_project": "chatcmd",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "chatcmd"
}