A compact flat-field soft x-ray grazing-incidence grating spectrometer equipped with a cryogenically cooled back-illuminated charge-coupled device camera was built and implemented at the Heidelberg Electron Beam Ion Trap. The instrument spans the spectral region from 1 to 37 nm using two different gratings. In slitless operation mode, it directly images a radiation source, in this case ions confined in an electron beam ion trap, with high efficiency and reaching hereby a resolving power of lambda/Deltalambda approximately =130 at 2 nm and of lambda/Deltalambda approximately =600 at 28 nm. Capable of automatized operation, its low noise and excellent stability make it an ideal instrument not only for spectroscopic diagnostics requiring wide spectral coverage but also for precision wavelength measurements.