steampipe plugin install github

Table: github_my_gist - Query GitHub Gists using SQL

GitHub Gists are a simple way to share snippets and pastes with others. Gists are Git repositories, which means that you can fork and clone them. Gists can be public or secret, and you can share them with specific people using the GitHub interface.

Table Usage Guide

The github_my_gist table provides insights into Gists within GitHub. As a developer or GitHub user, explore gist-specific details through this table, including file content, comments, and associated metadata. Utilize it to manage and analyze your Gists, such as those with certain content, the number of comments, and the details of the files in the Gists.

Important Notes

  • To query ANY gist that you have access to (including any public gists), use the github_gist table.

Examples

List your gists

Identify and review all the gists you have created on GitHub. This is useful for managing and keeping track of your code snippets shared through GitHub.

select
*
from
github_my_gist;
select
*
from
github_my_gist;

List your public gists

Explore which of your code snippets on GitHub are publicly accessible. This is useful for reviewing your open-source contributions and ensuring you're not unintentionally sharing private code.

select
*
from
github_my_gist
where
public;
select
*
from
github_my_gist
where
public = 1;

Summarize your gists by language.

Determine the distribution of your GitHub gists by programming language. This will help you understand the languages you use most frequently when creating gists.

select
file ->> 'language' as language,
count(*)
from
github_my_gist g
cross join jsonb_array_elements(g.files) file
group by
language
order by
count desc;
select
json_extract(file.value, '$.language') as language,
count(*)
from
github_my_gist g,
json_each(g.files) as file
group by
language
order by
count(*) desc;

Schema for github_my_gist

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
commentsbigintThe number of comments for the gist.
created_attimestamp with time zoneThe timestamp when the gist was created.
descriptiontextThe gist description.
filesjsonbFiles in the gist.
git_pull_urltextThe https url to pull or clone the gist.
git_push_urltextThe https url to push the gist.
html_urltextThe HTML URL of the gist.
idtextThe unique id of the gist.
node_idtextThe Node ID of the gist.
owner_idbigintThe user id (number) of the gist owner.
owner_logintextThe user login name of the gist owner.
owner_typetextThe type of the gist owner (User or Organization).
publicbooleanIf true, the gist is public, otherwise it is private.
updated_attimestamp with time zoneThe timestamp when the gist was last updated.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- github

You can pass the configuration to the command with the --config argument:

steampipe_export_github --config '<your_config>' github_my_gist