getemoji π¨π
getemoji is a command-line interface (CLI) tool that allows you to generate emoji images in SVG or PNG format.
It downloads the emoji from twemoji and can optionally resize it to a specified size.
β¨ Features
- Generate emoji images in SVG or PNG format
- Resize emojis to a specific size (for PNG output)
- Support for emoji shortcodes and Unicode characters
- Configurable via command-line flags, environment variables, or a YAML config file
π Installation
There are two ways to install getemoji:
-
Using Go:
To install getemoji, you need to have Go installed on your system. Then, you can use the following command:
go install github.com/igolaizola/getemoji@latest
-
Downloading pre-built binaries:
You can download pre-built binaries for your operating system from the Releases page of the GitHub repository.
π Usage
The basic syntax for using getemoji is:
getemoji --emoji <emoji> --size <size> --output <output>
π© Flags
-emoji
: The emoji to generate (required)
-size
: The size of the output image in pixels (required for PNG output)
-output
: The output file name (optional, defaults to icon.svg
or icon<size>.png
)
-config
: Path to a YAML configuration file (optional)
πΏ Environment Variables
You can also use environment variables to set the flags. Prefix the flag name with GETEMOJI_
. For example:
GETEMOJI_EMOJI="smile" GETEMOJI_SIZE=64 GETEMOJI_OUTPUT="smile.png" getemoji
π Examples
-
Generate an SVG of a smiley face emoji:
getemoji -emoji "smile" -output smile.svg
-
Generate a 64x64 PNG of a heart emoji:
getemoji -emoji "β€οΈ" -size 64 -output heart.png
-
Use a configuration file:
getemoji -config config.yaml
Example config.yaml
:
emoji: "rocket"
size: 128
output: rocket.png
You can check the version of getemoji by running:
getemoji version
This will display the version number, commit hash, and build date (if available).
π Dependencies
getemoji uses the following open-source libraries:
π License
getemoji is licensed under the MIT License.
The emoji graphics are from twemoji and are downloaded using https://cdn.jsdelivr.net/gh/jdecked/twemoji
.
These graphics are licensed under the Creative Commons Attribution 4.0 International License (CC-BY-4.0).
To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.
π€ Contributing
Contributions to getemoji are welcome! Please feel free to submit a Pull Request.
π¬ Support
If you encounter any problems or have any questions about getemoji, please open an issue on the GitHub repository.