I just pushed the first version of the
discourse_theme CLI to rubygems:
To play with it, make sure you have Ruby 2.2 or up installed.
If you are on Windows, you have 2 options:
Option 1: Windows Subsystem for Linux.
Windows 10 has access to a full Linux environment, you can use it to install ruby simply with
sudo apt-get install ruby, this will give you Ruby 2.3.
Options 2: Older Windows
Older versions of Windows have no access to WSL, you can easily install Ruby with Ruby Installer, go for the recommended version and default settings for the install.
Once Ruby 2.2 or later is running, open a terminal or command shell and run:
gem install discourse_theme
Once installed, to learn more about it:
It provides 3 functions:
You can use it to quickly create a new theme with
discourse_theme new YOUR_DIR_NAME
You can use it to monitor a theme and synchronize with a discourse site (with live refresh) using
discourse_theme watch YOUR_DIR_NAME
What this means is that you can use your own editor to edit you theme and site will magically update with the changes!
You can download an existing theme from Discourse using
discourse_theme download YOUR_DIR_NAME. You will then be given the option to start “watching” straight away!
Credentials are (optionally) stored at
~/.discourse_theme. API keys are stored per-site, and the URL/theme_id for each directory is also tracked. If you ever need to change your settings, just add
--reset to any command and you will be prompted for all values again.
NOTE: You need to use a per user key not a global one, go to admin user and generate the key there.