  We describe the time-dependent restricted-active-space self-consistent-field
(TD-RASSCF) method for a system of interacting bosons. We provide the theory of
the method and discuss its numerical implementation. The method provides a
general wavefunction based approach to solve the time-dependent and
time-independent Schr\"odinger equation for a system of bosons. It is based on
the time-dependent variational principle to optimize at each instant of time a
set of time-dependent coefficients and time-dependent orbitals used to describe
the total wavefunction. Including the concept of a restricted-active-space, the
exponential growth of the configurational space, resulting from all possible
distributions of $N$ bosons in $M$ orbitals, can be controlled trough a
specific excitation scheme. We show, by illustrative time-independent and
time-dependent examples, that the method provides an accurate description of
the system with a substantially smaller configurational space than the one
required in the multi-configurational time-dependent Hartree method for bosons
(MCTDHB). The TD-RASSCF method can also tackle problems beyond the reach of the
MCTDHB method when a large number of orbitals are required.
