Keyboard Layout Switcher is a command-line application for macOS that allows to see enabled keyboard layouts (input sources) and select one as current.
To see the list of enabled keyboard layouts run the application without arguments:
> kblswitcher
Enabled keyboard layouts:
1. ABC
(current) 2. English - Ilya Birman Typography
3. Russian - Ilya Birman Typography
Run the application with a number above passed as an argument to select a layout as current.
To select a keyboard layout as current run the application with number of the layout:
> kblswitcher 3
In this example layout named “Russian - Ilya Birman Typography” will be selected as current.
An actual version of the application is written in Swift, but you still may see earlier and more simple version written in Objective-C.
WTFPL