Docs
Creating GitHub Personal Access Token
Click Here to generate your GitHub Personal Access Token. repo
, read:packages
, read:org
, read:user
, user:email
scopes are required.
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 fileRequired when used with --ci |
-s --svg | [string] [optional] | 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:packages , read:user , and user:email scopesNo effect when used with --ci |
--ci | [boolean] [optional] | Continuous Integration mode Disables writing to and reading of config dir Requires --config Disables --token --first-run |
--color --no-color | [boolean] [optional] | Enable/Disable colored output in terminal Automatically inferred if flag is absent |
--first-run --firstrun | [boolean] [optional] | WARNING: This will overwrite your config file with default oneTrigger the firstrun script No effect when used with --ci |
-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 svgOptions
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
export const colors = {
primary: 'blueBright',
secondary: 'white',
tertiary: 'gray',
alternate: 'whiteBright',
}
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
DEFAULT: blueBright
Used in titles and info key
secondary
DEFAULT: white
Used in text, list text, info value
tertiary
DEFAULT: gray
Used to color symbols like bullets and underline
alternate
DEFAULT: whiteBright
Used to color the ascii art
symbols
export const symbols = {
underline: '-',
infoSeparator: ':',
listMarker: '-',
columnSeparator: ' ',
}
underline
DEFAULT:
-
character to be used as underline
infoSeparator
DEFAULT:
:
character to be used as separator of key and value
listMarker
DEFAULT:
-
character to be used as bullet in list
columnSeparator
DEFAULT:
character to be used as underline
svgOptions
export const svgOptions = {
colors: {
backgroundColor: '#18181b',
foregroundColor: '#fcfcfc',
black: '#232627',
red: '#ef4444',
green: '#22c55e',
yellow: '#eab308',
blue: '#3b82f6',
magenta: '#d946ef',
cyan: '#06b6d4',
white: '#f5f5f5',
blackBright: '#7f8c8d',
redBright: '#f87171',
greenBright: '#4ade80',
yellowBright: '#fde047',
blueBright: '#60a5fa',
magentaBright: '#e879f9',
cyanBright: '#22d3ee',
whiteBright: '#ffffff',
},
rows: 16,
cols: 80,
paddingX: 20,
paddingY: 15,
radius: 6,
fontSize: 13.6,
lineHeight: 19.72,
animationDuration: 1000,
}
This is an optional export. This will be used to format the SVG output.
colors
Contains the following keys
backgroundColor
, foregroundColor
, black
, red
, green
, yellow
, blue
, magenta
, cyan
, white
, blackBright
, redBright
, greenBright
, yellowBright
, blueBright
, magentaBright
, cyanBright
, whiteBright
The value is a valid CSS Color string.
rows
DEFAULT: 16
Number of rows in the terminal window
cols
DEFAULT: 80
Number of columns in the terminal window
paddingX
DEFAULT: 20
horizontal padding between the terminal window and text in pixels
paddingY
DEFAULT: 15
vertical padding between the terminal window and text in pixels
radius
DEFAULT: 6
Border radius of the terminal window in pixels
fontSize
DEFAULT: 13.6
font size of text inside terminal in pixels
lineHeight
DEFAULT: 19.72
line height of text inside terminal in pixels
animationDuration
DEFAULT: 1000
Time (in ms) it takes for all the lines to animate in. If set to 0
, animation will be disabled