Skip to content

Instantly share code, notes, and snippets.

@cx0
Created February 17, 2024 23:01
Show Gist options
  • Save cx0/90b8df2232561b48c3ca8b6d60abbcc2 to your computer and use it in GitHub Desktop.
Save cx0/90b8df2232561b48c3ca8b6d60abbcc2 to your computer and use it in GitHub Desktop.

Revisions

  1. cx0 created this gist Feb 17, 2024.
    14 changes: 14 additions & 0 deletions copilot_cli.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    Use GitHub Copilot in the command line.

    ```bash
    pip uninstall gh
    brew install gh
    gh auth login
    gh extension install github/gh-copilot
    gh extension upgrade gh-copilot
    gh copilot suggest 'read text file line by line and return the total number of alphanum chars in each line'

    Suggestion:

    while IFS= read -r line; do echo "$line" | tr -d -c '[:alnum:]' | wc -m; done < filename.txt
    ```