github.com/coxley/codesearch/cs (go): GraphQL specifics  Unfortunately the strongly-typed gql libs for Go aren't perfect for dynamic-length queries. If the entire query structure isn't known at compile time, there's not a great way to model it.  So we use text/template with a bit of care. The alternative is to make a bunch of queries in parallel. Let's err on the side of not increasing surface area for issues - especially since GitHub likes to ratelimit.  This is the high-level flow:  - Run search with given terms - Coerce results into our own minimal structure - Look up default branch names for every returned repo  - Fetch file contents for every returned Path - Overlay colorized text matches onto the contents - Write each line to stdout
Keywords: cli|code|codesearch|command-line|enterprise|find|free|github|grep|livegrep|productivity|ripgrep|search|sourcegraph|terminal