Command line interface for creating and managing Thumbsmith thumbnails.
Features a light weight, live reloading, vite-based development environment for best developer experience.
Read more at http://thumbsmith.com/
npm i @thumbsmith/cli -g
init [name] Create a new thumbnail template
dev <file> Start the development server on a thumbnail
deploy <file> Deploy a thumbnail template to your account
download <name> Download a thumbnail template file from your account
Create a new thumbnail template.
thumbsmith init [name] --starter <starter>
A new template file will be created in the directory where you ran the command.
You can then open and edit this file with your code editor of choice.
thumbsmith init blog
You can also specify a starter template to start from via the --starter option.
thumbsmith init product --starter=e-commerce
Start the development server on a thumbnail.
thumbsmith dev <file>
A development server will be open on http://localhost:3000/
thumbsmith dev blog.thumbnail.html
thumbsmith dev blog.thumbnail.html --open --port=4000
--host [host]: [string] specify hostname
--port <port>: [number] specify port
--open: open browser on startup
You can create a public folder that lives next to the thumbnail file to serve images for your thumbnail during development. In production, you can host them on your website or in any way you see fit.
Deploy a thumbnail template to your account. Requires authorization.
thumbsmith deploy <file>
The specified file will be synced to your account and made available on the Thumbsmith CDN.
This can be useful to setup automatic deployment of the thumbnail in your CI/CD workflows.
thumbsmith deploy blog.thumbnail.html
thumbsmith deploy blog.thumbnail.html --api-token=MY_THUMBSMITH_TOKEN
Download a thumbnail template file from your account. Requires authorization.
thumbsmith download <name>
A template file with the contents of the specified template will be added in the directory where you ran the command.
thumbsmith download blog
thumbsmith download blog --api-token=MY_THUMBSMITH_TOKEN
Some commands require authorization (via API token) to an account to operate.
Getting an API token
Each account gets an API token on signup. Once you're logged in your account, go in the settings page and scroll to the "API Token" section.
Once there, you can see and copy the token by clicking on the eye icon on the input.