DEV Community

Cover image for `soim`: Social image generator CLI

Posted on

`soim`: Social image generator CLI

In my last post on Social Image generation, I talked about how I built a site which can be used to automate social image generation. Well, I just built a CLI for it! Introducing soim.

GitHub logo SiddharthShyniben / soim

Social Image generator


Cover This image was made by running soim -t "This is some sample output of <b><code>soim</code></b>" -T "social, images, generator" -i "" -c "Made by @SiddharthShyniben" -p "cover.png"

soim is a CLI tool for generating social images. Given data, soim uses Puppeteer to screenshot a page.

soim can also be used as a library. The exported generateImage function takes an object as options, and the options are the same as the CLI options.


# locally
~$ npm i soim
# globally (for CLI)
~$ npm i -g soim
~$ soim -t ...
Enter fullscreen mode Exit fullscreen mode

CLI options

  • -t, --text: The main text.
  • -T, --tags: Comma separated list of tags, shown at the top of the image
  • -p, --path: The place to write the image
  • -l, --link: Custom link where the social image template lives. Useful if you want to design a custom template. See…

It's a small CLI tool to generate social images. Just run soim --text Something --caption something ... and get an image!

It uses puppeteer under the hood to generate images. I'll write a post on it someday.

Hope you like it!

Top comments (5)

nombrekeff profile image

This is pretty cool! Great idea, is the layout of the image fixed at the moment? or can you specify different layouts?

It would be cool if you could create some kind of template, and then pass in the template as well as the data to generate the image. I see potential! Let me know if you want some help at some point, I'm always up for stuff like this!

siddharthshyniben profile image

There is an option called --link to specify a link. It's buggy, but by today it should be done.

nombrekeff profile image

Ohh exceptional, I will give it a go for my next post ;)

siddharthshyniben profile image

@inhuofficial You said you wanted to know when I considered this complete, so It's complete now! Just need to add in a little bit of customization maybe.

grahamthedev profile image

Coool, I will check it out this week, for now, "comment for the algorithm" time!