{"id":13478582,"url":"https://github.com/samtay/so","last_synced_at":"2025-05-14T19:08:46.742Z","repository":{"id":37238682,"uuid":"268159767","full_name":"samtay/so","owner":"samtay","description":"A terminal interface for Stack Overflow","archived":false,"fork":false,"pushed_at":"2024-08-23T14:33:45.000Z","size":7585,"stargazers_count":1376,"open_issues_count":13,"forks_count":35,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-05-14T19:08:44.778Z","etag":null,"topics":["cli","cursive","rust","stackexchange","stackoverflow","terminal","tui"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/samtay.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"samtay","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-05-30T21:06:13.000Z","updated_at":"2025-05-12T06:19:13.000Z","dependencies_parsed_at":"2023-02-12T08:01:41.162Z","dependency_job_id":"e88086de-5845-42ad-9e91-3fc754f4fb45","html_url":"https://github.com/samtay/so","commit_stats":{"total_commits":183,"total_committers":11,"mean_commits":"16.636363636363637","dds":0.2786885245901639,"last_synced_commit":"f033ced221a52befc34edc76a18162c6cf6e0b26"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samtay%2Fso","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samtay%2Fso/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samtay%2Fso/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samtay%2Fso/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samtay","download_url":"https://codeload.github.com/samtay/so/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254209859,"owners_count":22032897,"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":["cli","cursive","rust","stackexchange","stackoverflow","terminal","tui"],"created_at":"2024-07-31T16:01:58.981Z","updated_at":"2025-05-14T19:08:45.553Z","avatar_url":"https://github.com/samtay.png","language":"Rust","readme":"\u003ch1 align=\"center\"\u003e\n\u003cimg width=\"300px\" src=\"assets/logo.png\" /\u003e\n\n[![ci][s0]][l0] [![appveyor][s1]][l1] [![crates][s2]][l2] [![MIT][s3]][l3] [![Packaging status](https://repology.org/badge/tiny-repos/so.svg)](https://repology.org/project/so/versions)\n\u003c/h1\u003e\n\n[s0]: https://github.com/samtay/so/actions/workflows/ci.yml/badge.svg\n[l0]: https://github.com/samtay/so/actions/workflows/ci.yml\n[s1]: https://ci.appveyor.com/api/projects/status/pu7e63f2sqq6x1iq/branch/master?svg=true\n[l1]: https://ci.appveyor.com/project/samtay/so/branch/master\n[s2]: https://img.shields.io/crates/v/so.svg\n[l2]: https://crates.io/crates/so\n[s3]: https://img.shields.io/badge/license-MIT-blue.svg\n[l3]: ./LICENSE\n\n\u003ch5 align=\"center\"\u003e A terminal interface for StackOverflow written in Rust \u003c/h5\u003e\n\n\u003ch1 align=\"center\"\u003e\n\n![](assets/demo.gif)\n\n\u003c/h1\u003e\n\n## example usage\nWhile I like the acronym *so*, this tool would actually be better described as\n*se*: an interface to the StackExchange network. In particular one thing that\ndifferentiates it from [similar](https://github.com/santinic/how2)\n[tools](https://github.com/gleitz/howdoi) is that you can simultaneously search\nany number of sites in the StackExchange network:\n```shell\n# search using your default configuration\n$ so how do i reverse a list in python\n\n# search for a latex solution\n$ so --site tex how to put tilde over character\n\n# use google to search stackoverflow.com, askubuntu.com, and unix.stackexchange.com\n$ so -e google -s askubuntu -s stackoverflow -s unix how do i install linux\n```\n\n## installation\n\n#### Arch Linux\nYou can install the AUR package\n[so](https://aur.archlinux.org/packages/so/) (tracks latest release)\nor\n[so-git](https://aur.archlinux.org/packages/so-git/) (tracks master), e.g.\n```\nyay -S so-git\n```\n\n#### FreeBSD\nYou can install the package [so](https://cgit.freebsd.org/ports/tree/www/so) via\n```\npkg install so\n```\n\n#### NetBSD\nYou can install the package [so](https://pkgsrc.se/www/so) via\n```\npkgin install so\n```\n\n#### MacOS\nYou can install the homebrew [formula](https://formulae.brew.sh/formula/so)\n```\nbrew install so\n```\n\nAlternatively, you can use [MacPorts](https://www.macports.org) to install [so](https://ports.macports.org/port/so/):\n```\nsudo port install so\n```\n\n#### Windows\nIf you have [scoop](https://scoop.sh/) you can install via the extras bucket:\n```shell\n# add extras bucket\nscoop bucket add extras\n\n# install so\nscoop install so\n```\n\n#### from source\nFor any OS you can install the crate [so](https://crates.io/crates/so) directly:\n```\n# everything but windows\ncargo install so\n\n# windows\ncargo install so --no-default-features --features windows\n```\nFor more information on the feature flags, see [selecting a\nbackend](#selecting-a-backend).\n\n#### release binaries\nStatic binaries are available on the [releases\npage](https://github.com/samtay/so/releases) for common Linux, MacOS, and\nWindows targets. You can quickly install the one you need to directory `DEST`\nwith:\n```bash\ncurl --proto '=https' --tlsv1.2 -sSf https://samtay.github.io/so/install.sh \\\n  | bash -s -- --to DEST\n```\nRight now I'm only building the most common targets, but in theory it should be\neasy to add more, so if you don't see what you are looking for just open an\nissue and I can add it. Here's a\nlist of the [supported\ntargets](https://github.com/japaric/trust#supported-targets). If you don't know\nwhat you need, you can install [rustc](https://www.rust-lang.org/tools/install)\nand open an issue with the output of `rustc -Vv | grep host | cut -d' ' -f2`.\n\n## documentation\n\n### configuration\nThe configuration files for e.g. a user `Alice` can be found in the following\ndirectories:\n\n- Linux: `/home/alice/.config/so`\n- Windows: `C:\\Users\\Alice\\AppData\\Roaming\\Sam Tay\\so`\n- MacOS: `/Users/Alice/Library/Preferences/io.Sam-Tay.so`\n\n#### defaults\nThe `config.yml` file lets you specify your CLI defaults. So if you dislike the\nlucky prompt, always search serverfault.com and unix.stackexchange.com, and\nwant the [fastest search engine](#search-engines), you can set your config file like this:\n```yaml\n# config.yml\n---\napi_key: ~\nlimit: 10\nlucky: false\nsites:\n  - serverfault\n  - unix\nsearch_engine: stackexchange\n```\nRun `so --help` to see your current defaults.\n\n#### themes\nIn the same directory you'll find `colors.toml` which is self-documented. The\ndefault theme attempts to blend in with your default terminal theme, but you can\nchange it as necessary. In particular, you may want to change the `highlight_text` if the current selection is difficult to read. There are some themes in the [themes](./themes) directory as well.\n\n#### system clipboard integration\nThere's a very primitive integration in place to copy the contents of\nthe currently focused question or answer to the system clipboard. This requires\nsome command in your PATH that can accept stdin and pipe to the clipboard.\nOn mac \u0026 windows, this will work out of the box with the default set to `pbcopy`\n\u0026 `clip` respectively. On Linux, I've made the assumption that `xclip` is likely\nthe most popular, but if you use something else (e.g. `wl-copy` on wayland),\nyou'll need to set the command directly:\n```yaml\n# config.yml\n---\ncopy_cmd: copy --option-to-take-stdin\n```\n\n#### api keys\nIf you want to use your own [StackExchange API\nKey](https://api.stackexchange.com/docs) you can set it via\n```\nso --set-api-key \u003cKEY\u003e\n```\nYou can also choose to use no key by editing your configuration to `api_key: ~`.\nIf for some reason my API key is globally throttled, you can hit the\nStackExchange API with no key up to 300 times per day per IP, which I imagine is\nfine for most users.\n\n### search engines\nThe available search engines are StackExchange, DuckDuckGo, and Google.\nStackExchange will always be the fastest to search because it doesn't require an\nadditional request or any HTML parsing; however, it is also very primitive.\n~~DuckDuckGo is in second place for speed, as its response HTML is much smaller\nthan Google's. I've found that it performs well for my queries, so it is the\ndefault search engine.~~\n\nDuckDuckGo [sometimes blocks requests](https://github.com/samtay/so/issues/16), so\nit is no longer the default.\n\n### multi-site searching\nAs stated in the [docs](https://api.stackexchange.com/docs/throttle),\n\n\u003e If a single IP is making more than 30 requests a second, new requests will be dropped.\n\nSo, don't go crazy with the multi-site search, since it is all done in parallel.\nIn particular, if you specify more than 30 sites, SE will likely ban you for a short time.\n\n### selecting a backend\nIf you're installing from source, you can choose from a number of available\nbackend rendering engines. Note that the package `default` and `windows` feature\nflags do not have an ncurses dependency, for the sake of portability.  The\ndefault backend is [termion](https://github.com/redox-os/termion), a bindless\nlibrary in pure Rust which seems to work quite well on Linux, MacOS, BSD, and\nRedox.  The windows backend is by default\n[crossterm](https://github.com/crossterm-rs/crossterm), and while its level of\nsupport is awesome, it does comes at a price in performance. On my machine, the\napp kind of flashes between draws. So if you are on Mac, Linux, or Redox, your\nbest bet is to compile with default features which uses the termion backend. If\nyou are on windows, use crossterm, but know it will be slightly jumpy.\n\nIf the crossterm folks figure out a fix for allowing ncurses to receive [resize\nevents](https://github.com/crossterm-rs/crossterm/issues/447), and you have\n[ncurses installed](https://github.com/gyscos/cursive/wiki/Install-ncurses) on\nyour system, then the ncurses and pancurses backends are likely the most\nperformant.  Just know that *currently* if you choose this option, and you run\nthe `--lucky` prompt, you won't be able to resize the terminal window while the\nTUI is open.\n\nAvailable backends:\n\n- `termion-backend`\n- `ncurses-backend`\n- `pancurses-backend`\n- `crossterm-backend`\n\nE.g. to use `ncurses-backend`:\n```\ncargo install so --no-default-features --features ncurses-backend\n```\n\nSee more information about this choice\n[here](https://github.com/gyscos/cursive/wiki/Backends).\n\n## contributing\n**Warning**: this was my first time writing Rust and there is very likely some\nnon-idiomatic and straight up ugly code throughout this project, so don't come\nlooking here for a good Rust example! That being said, I would love to improve\nthe codebase. Feel free to check out the [contributing\nguidelines](.github/CONTRIBUTING.md) and submit any refactoring issues or pull\nrequests.\n\n## credits\nCredit to my good friend [Charles](http://heyitscharles.com) for logo design.\n","funding_links":["https://ko-fi.com/samtay"],"categories":["Rust","Stackoverflow","cli","\u003ca name=\"online\"\u003e\u003c/a\u003eOnline search and resources","Other"],"sub_categories":["Misc"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamtay%2Fso","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamtay%2Fso","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamtay%2Fso/lists"}