Biofilm formation by Vibrio cholerae facilitates environmental persistence, and hyperinfectivity within the host. Biofilm formation is regulated by 3',5'-cyclic diguanylate (c-di-GMP) and requires production of the type IV mannose-sensitive hemagglutinin (MSHA) pilus. Here, we show that the MSHA pilus is a dynamic extendable and retractable system, and its activity is directly controlled by c-di-GMP. The interaction between c-di-GMP and the ATPase MshE promotes pilus extension, whereas low levels of c-di-GMP correlate with enhanced retraction. Loss of retraction facilitated by the ATPase PilT increases near-surface roaming motility, and impairs initial surface attachment. However, prolonged retraction upon surface attachment results in reduced MSHA-mediated surface anchoring and increased levels of detachment. Our results indicate that c-di-GMP directly controls MshE activity, thus regulating MSHA pilus extension and retraction dynamics, and modulating V. cholerae surface attachment and colonization.