@eighty4/poultry
v0.0.1
Published
Language sampling from GitHub to local filesystem
Maintainers
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:
npm i -g @eighty4/poultryRequired 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:
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:
GH_TOKEN=$(gh auth token) poultry --ext cql --lang sql --user apache --user datastax --user scylladb --out-dir outSearch 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!
