https://github.com/eighty4/poultry
Language sampling from GitHub to local filesystem
https://github.com/eighty4/poultry
Last synced: 5 months ago
JSON representation
Language sampling from GitHub to local filesystem
- Host: GitHub
- URL: https://github.com/eighty4/poultry
- Owner: eighty4
- Created: 2025-11-25T19:30:52.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-11-27T17:18:18.000Z (7 months ago)
- Last Synced: 2025-12-26T19:44:38.970Z (6 months ago)
- Language: TypeScript
- Size: 11.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
## Pulls code samples from GitHub repo trees
This utility is for collecting language samples for AST testing.
Getting started is quick and easy with your favorite NPM package manager:
```shell
npm i -g @eighty4/poultry
```
### Required for auth!
`poultry` uses the `GH_TOKEN` environment variable to authorize requests to the GitHub Search Code API
for searching for language samples and GraphQL API for retrieving file contents.
If using the `gh` cli from GitHub, you can set it for a `poultry` command like so:
```shell
GH_TOKEN=$(gh auth token) poultry ...
```
### Output
Files will be written to the `--out-dir` in a flat structure using repo name, subpath and filename.
For example, the output path for a file from Apache Cassandra's docs will be `apache_cassandra_doc_modules_cassandra_examples_CQL_sum.cql`.
### Full example
Here is an example of collecting CQL for Cassandra from Apache, Datastax & ScyllaDB accounts:
```shell
GH_TOKEN=$(gh auth token) poultry --ext cql --lang sql --user apache --user datastax --user scylladb --out-dir out
```
## Search options
Supported options mirror the search qualifiers available for the query string of the Search Code API
including `extension`, `lang`, `org` & `user` and can be included multiple times just like the Search Code API query string.
Full listing of options available with `poultry --help` and thorough details are on the
[GitHub Search Code API documentation](https://docs.github.com/en/search-github/searching-on-github/searching-code)!