In the case that there are no other inputs acting on the system and the system starts at $x=x_\mathrm{cmd}$, then in order to ensure that you keep perfect tracking you also need that $\dot{x}=\dot{x}_\mathrm{cmd}$. This can be achieved by solving for $u_\mathrm{cmd}$ in
$$
\dot{x}_\mathrm{cmd} = A\,x_\mathrm{cmd} + B\,u_\mathrm{cmd}. \tag{1}
$$
This does require that $x_\mathrm{cmd}$ is a feasible trajectory as a function of time, namely $\dot{x}_\mathrm{cmd} - A\,x_\mathrm{cmd}$ should lie in the span of $B$. If this is the case, then the feedforward term can be found using a pseudo inverse if $B^\top\,B$ is full rank
$$
u_\mathrm{cmd} = \left(B^\top\,B\right)^{-1} B^\top\left(\dot{x}_\mathrm{cmd} - A\,x_\mathrm{cmd}\right). \tag{2}
$$
So the total control law would become
$$
u = u_\mathrm{cmd} - K\,(x - x_\mathrm{cmd}). \tag{3}
$$
From here by defining $e = x - x_\mathrm{cmd}$, under the assumption that no other inputs are acting on the system, then it can be shown that the dynamics of $e$ becomes
$$
\dot{e} = (A - B\,K)\,e. \tag{4}
$$
So if $A-B\,K$ is Hurwitz, then as time goes to infinity $e$ should go to zero. And when $e=0$ by definition you also have $x = x_\mathrm{cmd}$.