The assembly of DNA fragments is extremely important for molecular biology. Increasing numbers of studies have focused on streamlining the laborious and costly protocols via in vivo DNA assembly. However, the existing methods were mainly developed for Escherichia coli or Saccharomyces cerevisiae, whereas there are few direct in vivo DNA assembly methods for other microorganisms. The use of shuttle vectors and tedious plasmid extraction and transformation procedures make DNA cloning in other microorganisms laborious and inefficient, especially for DNA library construction. In this study, we developed a "phage enzymeassisted in vivo DNA assembly" (PEDA) method via combinatorial expression of T5 exonuclease and T4 DNA ligase. PEDA facilitated the in vivo assembly of DNA fragments with homologous sequences as short as 5 bp, and it is applicable to multiple microorganisms, such as Ralstonia eutropha, Pseudomonas putida, Lactobacillus plantarum, and Yarrowia lipolytica. The cloning efficiency of optimized PEDA is much higher than that of the existing in vivo DNA assembly methods and comparable to that of in vitro DNA assembly, making it extremely suitable for DNA library cloning. Collectively, PEDA will boost the application of in vivo DNA assembly in various microorganisms.