Laser wakefield accelerators (LWFAs) can produce high-energy electron bunches in short distances. Successfully coupling these sources with undulators has the potential to form an LWFA-driven free-electron laser (FEL), providing high-intensity short-wavelength radiation. Electron bunches produced from LWFAs have a correlated distribution in longitudinal phase space: a chirp. However, both LWFAs and FELs have strict parameter requirements. The bunch chirp created using ideal LWFA parameters may not suit the FEL; for example, a chirp can reduce the high peak current required for free-electron lasing. We, therefore, design a flexible beamline that can accept either positively or negatively chirped LWFA bunches and adjust the chirp during transport to an undulator. We have used the accelerator design program MAD8 to design a beamline in stages, and to track particle bunches. The final beamline design can produce ambidirectional values of longitudinal dispersion ($$R_{56}$$
R
56
): we demonstrate values of + 0.20 mm, 0.00 mm and − 0.22 mm. Positive or negative values of $$R_{56}$$
R
56
apply a shear forward or backward in the longitudinal phase space of the electron bunch, which provides control of the bunch chirp. This chirp control during the bunch transport gives an additional free parameter and marks a new approach to matching future LWFA-driven FELs.