  We present CloudFlex, a new open-source tool for predicting the
absorption-line signatures of cool gas in galaxy halos with complex small-scale
structure. Motivated by analyses of cool material in hydrodynamical simulations
of turbulent, multiphase media, we model individual cool gas structures as
assemblies of cloudlets with a power-law distribution of cloudlet mass $\propto
m_{\rm cl}^{-\alpha}$ and relative velocities drawn from a turbulent velocity
field. The user may specify $\alpha$, the lower limit of the cloudlet mass
distribution ($m_{\rm cl,min}$), and several other parameters that set the
total mass, size, and velocity distribution of the complex. We then calculate
the MgII 2796 absorption profiles induced by the cloudlets along pencil-beam
lines of sight. We demonstrate that at fixed metallicity, the covering fraction
of sightlines with equivalent widths $W_{2796} < 0.3$ Ang increases
significantly with decreasing $m_{\rm cl,min}$, cool cloudlet number density
($n_{\rm cl}$), and cloudlet complex size. We then present a first application,
using this framework to predict the projected $W_{2796}$ distribution around
${\sim}L^*$ galaxies. We show that the observed incidences of $W_{2796}>0.3$
Ang sightlines within 10 kpc < $R_{\perp}$ < 50 kpc are consistent with our
model over much of parameter space. However, they are underpredicted by models
with $m_{\rm cl,min}\ge100M_{\odot}$ and $n_{\rm cl}\ge0.03$ $\rm cm^{-3}$, in
keeping with a picture in which the inner cool circumgalactic medium (CGM) is
dominated by numerous low-mass cloudlets ($m_{\rm cl}\lesssim100M_{\odot}$)
with a volume filling factor ${\lesssim}1\%$. When used to simultaneously model
absorption-line datasets built from multi-sightline and/or spatially-extended
background probes, CloudFlex will enable detailed constraints on the size and
velocity distributions of structures comprising the photoionized CGM.
