Conventional wireless communication schemes indiscriminately transmit information into the whole space and pose inherent security risks. Recently, directional information modulation (DIM) has attracted enormous attention as a promising technology. DIM generates correct constellation symbols in the desired directions and distorts them in undesired directions, thus ensuring the security of the transmitted information. Although several DIM schemes have been reported, they suffer from defects of bulkiness, energy consumption, high cost, and inability to support two-dimensional (2D) and high-order modulations. Here, we propose a DIM scheme based on a 2-bit programmable metasurface (PM) that overcomes these defects. A fast and efficient discrete optimization algorithm is developed to optimize the digital coding sequences, and the correct constellation symbols can be generated and transmitted in multi-directional beams. As a proof-of-concept, three sets of constellation diagrams (8 phase shift keying (PSK), 16 quadrature amplitude modulation (QAM), and 64QAM) are realized in the multi-channel modes. This work provides an important route of employing DIM for ensuring physical-layer security and serves as a stepping stone toward endogenous secure communications.