{"id":17001666,"url":"https://github.com/shresht7/nlpowershell","last_synced_at":"2025-03-22T08:48:27.793Z","repository":{"id":103221653,"uuid":"577444670","full_name":"Shresht7/NLPowerShell","owner":"Shresht7","description":"Use natural language to interact with PowerShell","archived":false,"fork":false,"pushed_at":"2025-03-05T09:29:38.000Z","size":128,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T10:30:01.647Z","etag":null,"topics":["command-line","natural-language","powershell"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Shresht7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-12T18:51:24.000Z","updated_at":"2025-03-05T09:27:26.000Z","dependencies_parsed_at":"2024-02-09T15:44:06.029Z","dependency_job_id":"e64faa8e-5451-41e3-beef-255f0f1f2c3b","html_url":"https://github.com/Shresht7/NLPowerShell","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shresht7%2FNLPowerShell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shresht7%2FNLPowerShell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shresht7%2FNLPowerShell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shresht7%2FNLPowerShell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shresht7","download_url":"https://codeload.github.com/Shresht7/NLPowerShell/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244931586,"owners_count":20534010,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","natural-language","powershell"],"created_at":"2024-10-14T04:25:43.319Z","updated_at":"2025-03-22T08:48:27.788Z","avatar_url":"https://github.com/Shresht7.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NLPowerShell\n\nUse natural language to interact with PowerShell\n\nInspired by: [Codex-CLI](https://github.com/microsoft/Codex-CLI)\n\n![Demonstration](Docs/demo.gif)\n\n\u003e [!CAUTION]\n\u003e\n\u003e _Nothing is perfect!_ Read and verify AI-generated commands before running them. Treat them as if you found them on the internet—because they **are** commands from the internet. **Do not run** any command that you **do not understand**.\n\n---\n\n## ⭐ Features\n\n1. Convert Natural Language to PowerShell Commands\n2. Get an Explanation\n\n### 1. Convert Natural Language to PowerShell Commands\n\n```powershell\nPS\u003e # Get a list of the 5 most CPU-intensive processes\n```\n\nPress \u003ckbd\u003eCtrl\u003c/kbd\u003e + \u003ckbd\u003eShift\u003c/kbd\u003e + \u003ckbd\u003eInsert\u003c/kbd\u003e\n\n```powershell\nPS\u003e Get-Process | Sort-Object CPU -Descending | Select-Object -First 5  # Get a list of the 5 most CPU-intensive processes\n```\n\n\u003e[!TIP]\n\u003e \n\u003e  **NLPowerShell can leverage `Get-Help` or `--help` automatically to improve prediction accuracy**\n\u003e\n\u003e ```powershell\n\u003e PS\u003e git # list all tags\n\u003e ```\n\u003e\n\u003e Press \u003ckbd\u003eCtrl\u003c/kbd\u003e + \u003ckbd\u003eCtrl\u003c/kbd\u003e + \u003ckbd\u003eInsert\u003c/kbd\u003e\n\u003e\n\u003e ```powershell\n\u003e PS\u003e git tag --list  # list all tags\n\u003e ```\n\n### 2. Get an Explanation\n\n```powershell\nPS\u003e Get-Command | Get-Random | Get-Help -Full\n```\n\nPress \u003ckbd\u003eCtrl\u003c/kbd\u003e + \u003ckbd\u003eShift\u003c/kbd\u003e + \u003ckbd\u003eInsert\u003c/kbd\u003e\n\n```powershell\nPS\u003e Get-Command | Get-Random | Get-Help -Full  # Retrieve a random command and display its full help information.\n```\n\n---\n\n## 📦 Installation\n\n### 1. Clone this repository\n\n```powershell\ngit clone https://github.com/Shresht7/NLPowerShell.git\n```\n\nor\n\n```powershell\ngh repo clone Shresht7/NLPowerShell\n```\n\n\n### 2. Import the module\n\n```powershell\nImport-Module -Name \u003cPath\\To\\This\\Module\u003e\n```\n\n\u003e [!TIP]\n\u003e \n\u003e If the module is placed in `$PSModulePath` (either manually, by installation, or via symlink), it can be imported with `Import-Module -Name NLPowerShell`.\n\n\u003e[!NOTE]\n\u003e\n\u003e Adding this import to your `$PROFILE` will load the module automatically when PowerShell starts. You can also `Initialize-NLPowerShell` straight-away with your desired configuration.\n\u003e \n\u003e ```powershell\n\u003e Import-Module -Name NLPowerShell\n\u003e Initialize-NLPowerShell -Ollama -Model \"qwen2.5-coder\" -Temperature 0.2\n\u003e ```\n\n### 3. Initialize the configuration\n\n#### Using Ollama\n\n```powershell\nInitialize-NLPowerShell -Ollama -Model \"llama3.2\" \n```\n\n#### Using OpenAI\n\n```powershell\nInitialize-NLPowerShell -OpenAI -Model \"gpt-4\" -API_KEY (Read-Host -AsSecureString -Prompt \"OpenAI API Key\") \n```\n\nor you can read configuration from a file\n\n```powershell\nInitialize-NLPowerShell -Path \"Config.json\"\n```\n\n#### Changing the Keybinding\n\n```powershell\nInitialize-NLPowerShell -KeyBind \"Ctrl+Insert\"\n```\n\n---\n\n## ⚙️ Configuration\n\n### To view the configuration\n\n```powershell\nGet-NLPowerShellConfig\n```\n\n### To update the configuration parameters\n\n```powershell\nSet-NLPowerShellConfig -Provider Ollama -Model \"llama3.2\" -MaxTokens 64\n```\n\n### To export the configuration to file\n\n```powershell\nExport-NLPowerShellConfig -Path \"Config.json\"\n```\nor\n```powershell\nExport-NLPowerShellConfig -Path \"config.xml\"\n```\n\n### To import the configuration\n\n```powershell\nImport-NLPowerShellConfig -Path \"config.xml\"\n```\n---\n\n## 📖 Examples\n\n```powershell\nPS\u003e # Get a list of markdown files\n```\n\nPress \u003ckbd\u003eCtrl\u003c/kbd\u003e + \u003ckbd\u003eShift\u003c/kbd\u003e + \u003ckbd\u003eInsert\u003c/kbd\u003e\n\n```powershell\nPS\u003e Get-ChildItem -Path . -Filter \"*.md\"    # Get a list of markdown files\n```\n\n```powershell\nPS\u003e Get-Date\n```\n\nPress \u003ckbd\u003eCtrl\u003c/kbd\u003e + \u003ckbd\u003eShift\u003c/kbd\u003e + \u003ckbd\u003eInsert\u003c/kbd\u003e\n\n```powershell\nPS\u003e Get-Date    # Get the current date\n```\n\n\n---\n\n## 📄 License\n\nThis project is licensed under the [MIT License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshresht7%2Fnlpowershell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshresht7%2Fnlpowershell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshresht7%2Fnlpowershell/lists"}