1.0.9 • Published 1 year ago

@joel-y85/social-image v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

social-image

At the moment, there is no Github API for setting social media preview images. This repo is heavily inspired by @mheap's github-social-image. All credits go to the original author. This is a CLI tool that sets a social image of the current repo via command.

Example

Installation

npm install -g @joel-y85/social-image

Usage

Authentication details can be provided in the environment or as CLI arguments

FieldEnvironment VariableCLI option
PasswordGITHUB_PASSWORD--password
OTPGITHUB_OTP--otp
social-image \
  --password your_password \
  --theme dark \
  --font inter \
  --background plus \
  --logo https://www.myimage.com/myimage.svg \
  --language true \
  --owner true \
  --stars true \
  --forks true \
  --issues true \
  --pulls true \
  --description "This is the description of the repo" \
  --otp 123456 

To debug

DEBUG=gsi:entrypoint,gsi:browser \
social-image \
  --password your_password \
  --theme dark \
  --font inter \
  --background plus \
  --logo https://www.myimage.com/myimage.svg \
  --language true \
  --owner true \
  --stars true \
  --forks true \
  --issues true \
  --pulls true \
  --description "This is the description of the repo" \
  --otp 123456 \
  --show

Behaviour options

FlagDescription
passwordGitHub account password
otpOne Time Password code, required for accounts that use 2FA
showShow the Puppeteer browser for debug purposes

Image related options

FlagDescriptionDefaultPossible values
themeTheme to uselightlight, dark
fontFont to useinterinter, bitter, raleway, rokkitt, source-code-pro, koho
backgroundBackground to useplussignal, charlie-brown, formal-invitation, plus, circuit-board, overlapping-hexagons, brick-wall, floating-cogs, diagonal-stripes
logoLogo to useGithub LogoAny URL that returns an image
languageShow the language icontrueN/A
ownerShow the owner in addition to the repo nametrueN/A
starsShow the number of starsfalseN/A
forksShow the number of forksfalseN/A
issuesShow the number of issuesfalseN/A
pullsShow the number of pullsfalseN/A
descriptionDescription to useN/ASpecify as --description to use the description from the repo, or `--description "Text Here" to use a custom description
1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.3

1 year ago