Usage of imperative
Imperative is the main mode to express an order to the positive form and a defense on the negative form. L'impératif est le mode par excellente pour exprimer un ordre à la forme positive ou une défense à la forme négative. The imperative can also be used to give advice or make a suggestion under the guise of an order.
Viens nous voir ! (imperative of order) Ne viens pas chez nous ! (imperative of defense)
In writing, order is expressed from the infinitive. This makes it possible to soften the notion of order a little bit. A simple example is to take a cookbook: Faire bouillir à feu doux is better than Faites bouillir à feu doux.
The imperative past is relatively rare but it allows to express a notion of anteriority compared to another action:
Ayez fini de ranger votre chambre à mon retour.
The imperative is not the only one to allow the expression of order. For reasons of politeness, we prefer to express an order in an indirect way often by a question:
Pouvez-vous me donner le sel SVP ?
Pourriez-vous venir un instant SVP ?