Skip to content
aryan02420 edited this page Nov 5, 2021 · 13 revisions

CLI

Flag Type Description
-h --help [boolean] [optional] Show help
-v --version [boolean] [optional] Show version number
-u --user [string] [optional] Login of the user to fetch.
If none, your data will be fetched
-c --config [string] [optional] Path to a custom .mjs config file
-s --svg [string] [optional]
not yet implemented
Path to save svg output to
-t --token [boolean] [optional] Asks for your GitHub PAT through stdin
The token must have repo, read:org, read:user, and user:email scopes
--ci [boolean] [optional] Continuous Integration mode
Disables writing to and reading of config dir
Requires --config
Disables --token --first-run
--no-color --nocolor [boolean] [optional]
not yet implemented
Disables colored output in terminal
--first-run --firstrun [boolean] [optional]
WARNING: This will overwrite your config file with default one
Trigger the firstrun script
-d --debug [boolean] [optional] Show additional debugging output
You can use this to find all variables that can used in the config file

config.mjs

This file contains all customizable options. It must export template and templateDeafult functions.

symbols, colors, meta, and terminal are optional.


template / templateDefault

Use the template function to create a personal template for yourself. Use templateDefault to create a generic template for all users.

Available functions inside the template function (first argument)

ascii(import.meta.url, "./path/to/ascii.art")

Draw the ascii art from file. The path is relative to this config file

ascii(imports.meta.url, "./path/to/ascii-art")

title(string)

Displays the string in bold, primary color

title("Your Username ...")

underline()

Underlines the previous line

underline()

info(string, string)

Display a key-value pair

info("Twitter", "@whatever")

list(string, string[])

Display an unordered list

list("Languages", ["JavaScript", "Python"])

text(string)

Insert plain text

text("Elit enim officia veniam minim ullamco aute culpa qui esse occaecat Lorem ut pariatur eiusmod.")

bar(string, number)

not yet implemented

bar("idk", 85)

blank()

Insert a blank line

blank()

raw(string)

Use Chalk`s tagged template syntax to colorize the output

raw("Hello {green World}!")

left()

Switch to the left column

left()

right()

Switch to the right column

right()

variables

The second argument to the template function. To see the complete list run userfetch -debug

username, name, email, location, bio, status, followers, following, sponsors, sponsoring, gists, organizations, contributedTo, packages, projects, pullRequests, issues, starred, commits, repositories ...


colors

This is an optional export. It can have primary, secondary, tertiary, alternate keys. The possible color values are "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white", "blackBright", "redBright", "greenBright", "yellowBright", "blueBright", "magentaBright", "cyanBright", "whiteBright"

primary

Used in titles and info key

secondary

Used in text, list text, info value

tertiary

Used to color symbols like bullets and underline

alternate

Used to color the ascii art


symbols

underline

infoSeparator

listMarker


terminal

This is an optional export. These color values will be used to colorize the SVG output.

not yet implemented

background

background color of the terminal

black / red / green / yellow / blue / magenta / cyan / white

blackBright / redBright / greenBright / yellowBright / blueBright / magentaBright / cyanBright / whiteBright