Context : The Gaia-ESO Public Spectroscopic Survey will observe a large sample of clusters and cluster stars , covering a wide age-distance-metallicity-position-density parameter space . Aims : We aim to determine C , N , and O abundances in stars of Galactic open clusters of the Gaia-ESO survey and to compare the observed abundances with those predicted by current stellar and Galactic evolution models . In this pilot paper , we investigate the first three intermediate-age open clusters . Methods : High-resolution spectra , observed with the FLAMES-UVES spectrograph on the ESO VLT telescope , were analysed using a differential model atmosphere method . Abundances of carbon were derived using the { C } _ { 2 } band heads at 5135 and 5635.5 Å . The wavelength interval 6470–6490 Å , with CN features , was analysed to determine nitrogen abundances . Oxygen abundances were determined from the [ O i ] line at 6300 Å . Results : The mean values of the elemental abundances in Trumpler 20 as determined from 42 stars are : { [ Fe / H ] } = 0.10 \pm 0.08 ( s.d . ) , { [ C / H ] } = -0.10 \pm 0.07 , { [ N / H ] } = 0.50 \pm 0.07 , and consequently { C / N } = 0.98 \pm 0.12 . We measure from five giants in NGC 4815 : { [ Fe / H ] } = -0.01 \pm 0.04 , { [ C / H ] } = -0.17 \pm 0.08 , { [ N / H ] } = 0.53 \pm 0.07 , { [ O / H ] } = 0.12 \pm 0.09 , and { C / N } = 0.79 \pm 0.08 . We obtain from 27 giants in NGC 6705 : { [ Fe / H ] } = 0.0 \pm 0.05 , { [ C / H ] } = -0.08 \pm 0.06 , { [ N / H ] } = 0.61 \pm 0.07 , { [ O / H ] } = 0.13 \pm 0.05 , and { C / N } = 0.83 \pm 0.19 . The C/N ratios of stars in the investigated open clusters were compared with the ratios predicted by stellar evolutionary models . For the corresponding stellar turn-off masses from 1.9 to 3.3 M _ { \odot } , the observed C/N ratio values are very close to the predictions of standard first dredge-up models as well as to models of thermohaline extra-mixing . They are not decreased as much as predicted by the recent model in which the thermohaline- and rotation-induced extra-mixing act together . The average [ O/H ] abundance ratios of NGC 4815 and NGC 6705 are compared with the predictions of two Galactic chemical evolution models . The data are consistent with the evolution at the solar radius within the errors . Conclusions : The first results of CNO determinations in open clusters show the potential of the Gaia-ESO Survey to judge stellar and Galactic chemical evolution models and the validity of their physical assumptions through a homogeneous and detailed spectral analysis .