The present invention provides novel compounds of formula (I) and methods of use thereof. In certain embodiments, the compounds of the invention are useful as nucleocapsid assembly inhibitors. In other embodiments, the compounds of the invention are useful as pregenomic RNA encapsidation inhibitors of Hepatitis B virus (HBV). In yet other embodiments, the compounds of the invention are useful for the treatment of viral infection, including HBV and related viral infections.