We present millimeter line observations of the HH 111 outflow and its driving source. The molecular gas emission observed with IRAM 30m and the CSO reveals a small condensation of cold and dense gas. The low-velocity outflow has been mapped with the IRAM PdBI interferometer. The cold gas is distributed in a hollow cylinder surrounding the optical jet. The formation of this cavity and its kinematics are well accounted for in the frame of outflow gas entrainment by jet bow shocks. Evidence of gas acceleration is found along the cavity walls, correlated with the presence of optical bow shocks. The cavity has been expanding with a mean velocity of 4 km/s on a timescale of 8700 yr, similar to the dynamical age of the optical jet. The separation of the inner walls reaches 8-10, which matches the transverse size of the wings in the bow shock. CSO observations of the J=7-6 line show evidence of a high-velocity and hot gas component (T=300-1000 K) with a low filling factor, associated with shocked molecular gas in the jet. [CI] observations are consistent with C-type non-dissociative shocks. Mapping of the high-velocity molecular bullets B1-B3 located beyond the optical jet, with the PdBI, reveals small structures of 3 by 7 flattened perpendicular to the flow direction. They are made of cold gas of moderate density(a few 10^3 cm-3). The bullets appear to expand into the low-density surrounding medium. We conclude that they are probably shocked gas knots resulting from past time-variable ejections in the jet.