[
    {
        "role": "user",
        "content": "I%20have%20this%20setup%20in%20powershell%20but%20am%20getting%20error%20when%20I%20use%20it%20that%20-t%20is%20not%20a%20supported%20copilot%20cli%20flag.%20function%20%3F%3F%20%7B%20%24args%20-join%20%27%20%27%20|%20gh%20copilot%20suggest%20-t%20shell%20%7D"
    },
    {
        "role": "assistant",
        "content": "You're hitting the error because the `-t` flag isn't recognized in the current version of `gh copilot` you have installed. `-t` (short for `--target`) was part of the **deprecated** `gh-copilot` CLI extension, and in later versions of GitHub Copilot CLI (the replacement), this flag no longer exists. ([github.com](https://github.com/github/gh-copilot?utm_source=openai))\n\n---\n\n## What changed\n\n- The older `gh extension install github/gh-copilot` extension allowed you to do things like `gh copilot suggest -t shell`, `-t git`, `-t gh`. ([dev.to](https://dev.to/github/stop-struggling-with-terminal-commands-github-copilot-in-the-cli-is-here-to-help-4pnb?utm_source=openai))\n- That has been deprecated. GitHub has moved to the **agentic** Copilot CLI, which is invoked directly as `copilot ...` instead of via `gh copilot`. ([github.com](https://github.com/github/gh-copilot?utm_source=openai))\n- In the new version, commands like `copilot suggest --target shell ...` are valid; the `-t` flag may exist, but only under the `copilot` command, not `gh copilot`. ([docs.github.com](https://docs.github.com/en/free-pro-team%40latest/copilot/reference/cli-command-reference?utm_source=openai))\n\n---\n\n## What to do to fix your function\n\nIf you want to keep using the existing setup in PowerShell with the newer version, you should:\n\n1. **Install** the standalone Copilot CLI (if not already). Instructions are here: `copilot --version`, or install via Homebrew / WinGet / script. ([github.blog](https://github.blog/changelog/2026-01-14-github-copilot-cli-enhanced-agents-context-management-and-new-ways-to-install?utm_source=openai))\n\n2. **Modify your function** to call `copilot suggest`, instead of `gh copilot suggest -t shell`. Use the newer CLI and the `--target shell` flag. For example:\n\n   ```powershell\n   function ?? {\n     $args -join ' ' | copilot suggest --target shell\n   }\n   ```\n\n3. If you want to continue using `gh copilot` (old extension) **and** the `-t` flag, you\u2019ll likely need to install an older version (if still available) or confirm if the extension still supports those flags. But note: the `gh-copilot` extension has been deprecated. ([github.com](https://github.com/github/gh-copilot?utm_source=openai))\n\n---\n\n## Additional details\n\n- The **new Copilot CLI** supports specifying a target for the suggestion, such as `shell`, `git`, or `gh`, using the `--target` (or `-t`) flag but only when using the standalone `copilot` command. ([docs.github.com](https://docs.github.com/en/free-pro-team%40latest/copilot/reference/cli-command-reference?utm_source=openai))\n- The new CLI also has flags like `--silent` to make outputs cleaner in scripts. ([github.blog](https://github.blog/changelog/2026-01-14-github-copilot-cli-enhanced-agents-context-management-and-new-ways-to-install?utm_source=openai))\n\n---\n\nIf you like, I can help you update your PowerShell profile to use aliases so you can type things like `?? greet`, and it\u2019ll work with the new CLI seamlessly. Do you want me to build that for you?"
    }
]