Skip to content
TheChatArchiveThe Chat Archive
gpt-4.1-mini-2025-04-14· OpenAIHugging Face LMArena Human Preference 140K

give me a shell command to get the latest release from github

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Geminigemini-2.5-pro-preview-03-25’s answer.
  1. User

    give me a shell command to get the latest release from github

  2. Assistant

    To get the latest release tag from a GitHub repository using a shell command, you can use curl to query the GitHub API and jq to parse the JSON response.

    Here’s a generic command to get the latest release tag name:

    curl --silent "https://api.github.com/repos/OWNER/REPO/releases/latest" | jq -r .tag_name
    

    Replace:

    • OWNER with the GitHub username or organization name
    • REPO with the repository name

    Example:

    To get the latest release tag of the docker/cli repository:

    curl --silent "https://api.github.com/repos/docker/cli/releases/latest" | jq -r .tag_name
    

    Notes:

    • You need jq installed to parse JSON. On Amazon Linux 2023, you can install it with:
      sudo dnf install jq
      
    • If you want to avoid rate limits, you can authenticate with a GitHub token by adding a header:
      curl -H "Authorization: token YOUR_GITHUB_TOKEN" --silent "https://api.github.com/repos/OWNER/REPO/releases/latest" | jq -r .tag_name
      

    Let me know if you want a version without jq!

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.