We present the extension of our COCAL -Compact Object CALculator -code to compute general-relativistic initial data for binary compact-star systems. In particular, we construct quasiequilibrium initial data for equalmass binaries with spins that are either aligned or antialigned with the orbital angular momentum. The IsenbergWilson-Mathews formalism is adopted and the constraint equations are solved using the representation formula with a suitable choice of a Green's function. We validate the new code with solutions for equal-mass binaries and explore its capabilities for a wide range of compactnesses, from a white dwarf binary with compactness ∼ 10 −4 , up to a highly relativistic neutron-star binary with compactness ∼ 0.22. We also present a comparison with corotating and irrotational quasiequilibrium sequences from the spectral code LORENE [Taniguchi and Gourgoulhon, Phys. Rev. D 66, 104019 (2002)] and with different compactness, showing that the results from the two codes agree to a precision of the order of 0.05%. Finally, we present equilibria for spinning configurations with a nuclear-physics equation of state in a piecewise polytropic representation.