{"id":37162602,"url":"https://github.com/freesrz93/ask-gpt","last_synced_at":"2026-01-14T19:21:01.579Z","repository":{"id":252056300,"uuid":"839261729","full_name":"freesrz93/ask-gpt","owner":"freesrz93","description":"A CLI tool to chat with OpenAI LLMs via API. Support custom roles, conversation history and streaming output.","archived":false,"fork":false,"pushed_at":"2025-01-06T05:08:24.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-06T06:19:38.114Z","etag":null,"topics":["chatgpt","cli","go","golang","gpt","gpt-cli","openai","openai-api","openai-cli"],"latest_commit_sha":null,"homepage":"","language":"Go","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/freesrz93.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":"2024-08-07T09:02:28.000Z","updated_at":"2025-01-06T05:08:28.000Z","dependencies_parsed_at":"2024-08-12T08:26:50.325Z","dependency_job_id":"ddcf1823-e9a9-47d7-a355-e792eef1cb4f","html_url":"https://github.com/freesrz93/ask-gpt","commit_stats":null,"previous_names":["freesrz93/ask-gpt"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/freesrz93/ask-gpt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freesrz93%2Fask-gpt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freesrz93%2Fask-gpt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freesrz93%2Fask-gpt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freesrz93%2Fask-gpt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/freesrz93","download_url":"https://codeload.github.com/freesrz93/ask-gpt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freesrz93%2Fask-gpt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28432581,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["chatgpt","cli","go","golang","gpt","gpt-cli","openai","openai-api","openai-cli"],"created_at":"2026-01-14T19:20:59.534Z","updated_at":"2026-01-14T19:21:01.553Z","avatar_url":"https://github.com/freesrz93.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ask GPT\n\nEnglish | [简体中文](./README_ZH.md)\n\nAsk GPT is a CLI tool to chat with OpenAI LLMs via API.\n\n## Features\n\n- **Custom Roles**: Customise multi roles, each with its own system prompt.\n- **Save/Retrieve Conversations**: Save conversations locally and continue it seamlessly in the future.\n- **Streaming Output**: See the output instantly after an input, no need to wait for completion.\n- **Support Pipeline**: Send any output of other CLI tools to AI via pipeline.\n- **Interactive mode**: Chat with AI interactively. Offer a user experience similar to the web-based ChatGPT.\n- **Support Models**: Compatibility with all models accessible through the OpenAI API.\n- **Edit Config Easily**: One-click access to configuration file for easy setup and customization.\n\n## Installation\n\nDownload the pre-built binary from [release](https://github.com/freesrz93/ask-gpt/releases/latest) and add it to path.\n\n## Usage\n\n1. Run ask-gpt for the first time:\n   ```shell\n   ag -v\n   ```\n   and the app will create the config file at\n    ```\n    %USERPROFILE%/.config/ask-gpt/config.yaml\n    ```\n   for Windows and\n    ```\n    $HOME/.config/ask-gpt/config.yaml\n    ```\n   for Linux and macOS.\n\n2. Edit the config. See [Configuration](#configuration) for detail.\n\n3. Quickly ask a question:\n    ```shell\n    ag \"what's the best programming language in the world?\"\n    ```\n\n4. To create or continue a conversation, use `-s`:\n   ```shell\n   ag -s \"chat 1\" \"Tell a story\"\n   ```\n\n5. To chat interactively, use `-i`:\n   ```shell\n   ag -i \"Translate the given sentences to Chinese\"\n   ```\n   `-s` can be used with `-i`:\n   ```shell\n   ag -s \"translation\" -i \"Translate the given sentences to Chinese\"\n   ```\n\n6. Use pipeline:\n   ```shell\n   cat raw.txt | ag -i \"Translate above contents to Chinese\"\n   ```\n\n7. To create a new role, use `-n`:\n   ```shell\n   ag -n\n   ```\n   then set its name, description and prompt interactively.\n\n8. To use a role, use `-r` (the role should already exist):\n   ```shell\n   ag -r \"translator\" -i \"Translate the given sentences to Chinese\"\n   ```\n   `-r` can be used with `-s` but only valid when creating a conversation.\n\n9. To show history of the conversation, use `-h`:\n   ```shell\n   ag -s \"translation\" -h -i\n   ```\n   this will print previous messages and continue with interactive mode.\n\n10. For more usage, see:\n    ```shell\n    chatgpt --help\n    ```\n\n## Configuration\n\n| Name              | Meaning                                                                                                    | Default                     |\n|-------------------|------------------------------------------------------------------------------------------------------------|-----------------------------|\n| url               | The base URL for OpenAI API.                                                                               | \"https://api.openai.com/v1\" |\n| api_key           | Your OpenAI API key.                                                                                       | \"\"                          |\n| model             | The model to be used.                                                                                      | \"gpt-4o-mini\"               |\n| max_tokens        | The maximum token cost in a single API call.                                                               | 4096                        |\n| temperature       | See [OpenAI Doc](https://platform.openai.com/docs/api-reference/chat/create#chat-create-temperature)       | 0.5                         |\n| top_p             | See [OpenAI Doc](https://platform.openai.com/docs/api-reference/chat/create#chat-create-top_p)             | 1.0                         |\n| frequency_penalty | See [OpenAI Doc](https://platform.openai.com/docs/api-reference/chat/create#chat-create-frequency_penalty) | 0                           |\n| presence_penalty  | See [OpenAI Doc](https://platform.openai.com/docs/api-reference/chat/create#chat-create-presence_penalty)  | 0                           |\n| editor            | The editor to be used to edit config file. Must in path.                                                   | \"code\"                      |\n| editor_arg        | The arguments to be passed to the editor. `%path` will be replaced by the actual path.                     | \"%path\"                     |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreesrz93%2Fask-gpt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreesrz93%2Fask-gpt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreesrz93%2Fask-gpt/lists"}