{"id":20391337,"url":"https://github.com/shadowy-pycoder/goso","last_synced_at":"2025-07-09T21:33:06.934Z","repository":{"id":262468049,"uuid":"886174081","full_name":"shadowy-pycoder/goso","owner":"shadowy-pycoder","description":"Stack Overflow CLI search tool written in Go","archived":false,"fork":false,"pushed_at":"2025-01-07T18:14:27.000Z","size":7648,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T05:23:30.432Z","etag":null,"topics":["chroma","cli","golang","google","serp","serpapi","stackoverflow"],"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/shadowy-pycoder.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-11-10T11:59:48.000Z","updated_at":"2025-01-07T18:12:38.000Z","dependencies_parsed_at":"2024-11-12T16:19:50.333Z","dependency_job_id":"554fa1d3-f573-40dc-998a-20f93d2296b2","html_url":"https://github.com/shadowy-pycoder/goso","commit_stats":null,"previous_names":["shadowy-pycoder/goso"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/shadowy-pycoder/goso","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadowy-pycoder%2Fgoso","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadowy-pycoder%2Fgoso/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadowy-pycoder%2Fgoso/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadowy-pycoder%2Fgoso/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shadowy-pycoder","download_url":"https://codeload.github.com/shadowy-pycoder/goso/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadowy-pycoder%2Fgoso/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264503951,"owners_count":23618762,"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":["chroma","cli","golang","google","serp","serpapi","stackoverflow"],"created_at":"2024-11-15T03:31:41.066Z","updated_at":"2025-07-09T21:33:06.913Z","avatar_url":"https://github.com/shadowy-pycoder.png","language":"Go","readme":"# goso - [Stack Overflow](https://stackoverflow.com/) CLI Tool written in Go\n\n![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/shadowy-pycoder/goso/go.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Go Reference](https://pkg.go.dev/badge/github.com/shadowy-pycoder/goso.svg)](https://pkg.go.dev/github.com/shadowy-pycoder/goso)\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/shadowy-pycoder/goso)\n[![Go Report Card](https://goreportcard.com/badge/github.com/shadowy-pycoder/goso)](https://goreportcard.com/report/github.com/shadowy-pycoder/goso)\n![GitHub Release](https://img.shields.io/github/v/release/shadowy-pycoder/goso)\n![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/shadowy-pycoder/goso/total)\n\n\n## Features\n\n- Syntax highlighting \n- Fast search\n- Easy to use\n- Support for Linux, Windows, macOS\n\n\n## Demo\n\n![goso - Animated gif demo](demo/demo.gif)\n\n\n\n## Installation\n\nYou can download the binary for your platform from [Releases](https://github.com/shadowy-pycoder/goso/releases) page.\n\nAlternatively, you can install it using `go install` command (requires Go [1.23](https://go.dev/doc/install) or later):\n\n```shell\nCGO_ENABLED=0 go install -ldflags \"-s -w\" -trimpath github.com/shadowy-pycoder/goso/cmd/goso@latest\n```\nThis will install the `goso` binary to your `$GOPATH/bin` directory.\n\nIf none of the above works for you, you can use the [Makefile](https://github.com/shadowy-pycoder/goso/blob/master/Makefile) to build the binary from source.\n\n```shell\ngit clone https://github.com/shadowy-pycoder/goso.git\ncd goso\nmake build\n```\n\n\n## Search Engine Setup\n\n###  Google Search JSON API\nThis approach employs [Custom Search JSON API](https://developers.google.com/custom-search/v1/overview) from Google to obtain most relevant results from Stack Overflow. So, to make it work, you need to get an API key from Google and also a [Search Engine ID](https://developers.google.com/custom-search/v1/overview#search_engine_id). That gives you `100 requests per day`, which I believe is enough for most use cases.\n\nSetup your `Search Engine ID` like this:\n\n![Screenshot from 2024-11-12 13-17-26](https://github.com/user-attachments/assets/3dd798fb-d9de-438a-aeeb-81ffc47e488b)\n\nAdd variables to your environment:\n```shell\necho \"export GOSO_API_KEY=\u003cYOUR_API_KEY\u003e\" \u003e\u003e $HOME/.profile\necho \"export GOSO_SE=\u003cYOUR_SEARCH_ENGINE_ID\u003e\" \u003e\u003e $HOME/.profile\nsource $HOME/.profile\n```\n\n###  OpenSerp API\n`goso` also supports [OpenSERP (Search Engine Results Page)](https://github.com/karust/openserp) from [Karust](https://github.com/karust). This is a completely *FREE* alternative to the Google Search JSON API, though it works a little bit slower, but gives basically the same results. \n\nSo, to make it work, you need to run OperSERP server locally. You can do it like this:\n\nWith Docker:\n```shell\ndocker run -p 127.0.0.1:7000:7000 -it karust/openserp serve -a 0.0.0.0 -p 7000\n```\n\nOr as a CLI command:\n\n```shell\nopenserp serve \n```\nYou can learn more on how to install OpenSERP [here](https://github.com/karust/openserp).\n\nOnce you have it running, add variables to your environment:\n```shell\necho \"export GOSO_OS_HOST=127.0.0.1\" \u003e\u003e $HOME/.profile\necho \"export GOSO_OS_PORT=7000\" \u003e\u003e $HOME/.profile\nsource $HOME/.profile\n```\nThese variables will have priority over the `GOSO_API_KEY` and `GOSO_SE`.\n\n\n## Usage\n\n```shell\ngoso -h\n                                                                  \n .d88b.   .d88b.  .d8888b   .d88b.  \nd88P\"88b d88\"\"88b 88K      d88\"\"88b \n888  888 888  888 \"Y8888b. 888  888 \nY88b 888 Y88..88P      X88 Y88..88P \n \"Y88888  \"Y88P\"   88888P'  \"Y88P\"  \n     888                            \nY8b d88P  Stack Overlow CLI Tool by shadowy-pycoder                         \n \"Y88P\"   GitHub: https://github.com/shadowy-pycoder/goso                        \n                                                                                                                                                                                              \nUsage: goso [OPTIONS] QUERY\nOptions:\n  -h    Show this help message and exit.\n  -a int\n        The number of answers for each result [min=1, max=10] (default 3)\n  -l string\n        The name of Chroma lexer. See https://github.com/alecthomas/chroma/tree/master/lexers/embedded (default \"bash\")\n  -q int\n        The number of questions [min=1, max=10] (default 10)\n  -s string\n        The name of Chroma style. See https://xyproto.github.io/splash/docs/ (default \"onedark\")\n  -v    print version\n``` \n\nIt is possible to adjust default values for the number of questions and answers, lexer and style.\n```shell\necho \"export GOSO_LEXER=python\" \u003e\u003e $HOME/.profile\necho \"export GOSO_STYLE=onedark\" \u003e\u003e $HOME/.profile\necho \"export GOSO_ANSWERS=5\" \u003e\u003e $HOME/.profile\necho \"export GOSO_QUESTIONS=5\" \u003e\u003e $HOME/.profile\nsource $HOME/.profile\n```\n\nBy default, `goso` will not show question body, but you can enable it like this:\n```shell\necho \"export GOSO_SHOW_QUESTIONS=1\" \u003e\u003e $HOME/.profile\n```\n\u003e [!WARNING]\n\u003e Enabling the question body requires additional call to Stack Overflow API.\n\n## Example\n\n```shell\ngoso  -l go -s onedark -q 1 -a 1 Sort maps in Golang\n```\nOutput:\n\n![Screenshot from 2024-11-14 10-16-52](https://github.com/user-attachments/assets/43282839-1719-44ae-a0e8-c2ed44d8e9e6)\n\nYou can also use `less` command for instance to page through the results:\n```shell  \n#!/bin/bash\ngoso \"$@\" | less -F -R -X\n```\n\n## Contributing\n\nAre you a developer?\n\n- Fork the repository\n- Create your feature branch: `git switch -c my-new-feature`\n- Commit your changes: `git commit -am 'Add some feature'`\n- Push to the branch: `git push origin my-new-feature`\n- Submit a pull request\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshadowy-pycoder%2Fgoso","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshadowy-pycoder%2Fgoso","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshadowy-pycoder%2Fgoso/lists"}