SwissFEL is a free electron laser (FEL) under commissioning at the Paul Scherrer Institut (PSI) in Switzerland. Digital low-level RF (LLRF) systems are used in SwissFEL to control more than 30 RF stations with either standing wave cavities (e.g. RF gun) or travelling wave structures working at different frequencies. After conditioned to desired power levels, the RF stations need to be setup for beam operation and the LLRF parameters need to be optimized for maximizing the beam stability. Several beam-based algorithms were developed to facilitate the setup, calibration and optimization of the SwissFEL RF stations for beam operation. The algorithms were implemented as automation procedures in the framework of Experimental Physics and Industrial Control System (EPICS) and were used in commissioning and daily operation of SwissFEL. In this paper, the algorithms and the implementation will be introduced together with the test results during the commissioning of SwissFEL.