How do I change currently selected keyboard layout from command line?

You could use xkb-switch (-n switches to next layout):

xkb-switch -n

or xkblayout-state (with set +1 to wrap around, in your case) :

xkblayout-state set +1

or xte from xautomation to simulate Control_L+Shift_L key press/release:

xte 'keydown Control_L' 'keydown Shift_L' 'keyup Shift_L' 'keyup Control_L'

Searches of Stack Exchange for kbdmap find this page with no mention of that word. For clarity, here's an answer (not exactly fitting with the X11 tag of the question, but it should help someone) …

When limited to a virtual console

without X.

kbdmap(1)

kbdmap, vidfont -- front end for syscons and vt

… allows easy setting of available keymaps …

Truly, it's easy and (for me, changing to a UK keyboard layout) effective.

When using X

– for example, with FreeBSD-based TrueOS Desktop.

From post 5 under Change keyboard layout? | The FreeBSD Forums (2015-08-03):

kbdmap is for the console. setxkbmap is the utility you want for X11. …

There's a warning, for example when changing to United Kingdom:

$ kbdmap
kbdcontrol: getting keymap: Inappropriate ioctl for device
You are not on a virtual console - expect certain strange side-effects
lang_default = en
dialect = en_...UTF-8
lang_abk = en

…

keymap="uk.kbd"
$ 

Depending on the distro for the keyboard layouts, the command is

loadkeys <path/to/file>

loadkey /lib/kbd/keymaps/i386/qwerty/pt_PT.map.gz

If I remember correctly. Also check manpage for loadkeys if you want to assign specific keys to specific behavior.