Heavy metal contamination has emerged as a significant global environmental concern. The contamination of Ni2+ and Zn2+ has attracted increasing attention, not only because of the pollution it causes but also because of the potential risks it poses to human health. It is of great importance to explore sensitive and rapid analytical methods for the accurate detection of Ni2+ and Zn2+. This paper presents the design and synthesis of a peptide fluorescent probe, TPE-HN (TPE-Pro-Trp-His-Glu-Phe-Gln-NH2), coupled with a peptide to tetraphenylethylene (TPE). The aggregation-induced emission (AIE) effect has been employed to construct a rapid ‘turn-on’ assay for Ni2+and Zn2+ peptide fluorescent probes. The probe is capable of qualitatively detecting Ni2+ and Zn2+ in different buffer systems and can be distinguished by changes in buffer systems. The limit of detection for Ni2+ and Zn2+ in a 15% buffer solution was 9.613 mM (R2 = 0.9924), whereas the limit of detection for Ni2+ in a 20% buffer solution was 1.215 mM (R2 = 0.9922). The probe exhibits high sensitivity, high cell permeability and low biotoxicity, rendering it suitable for live-cell imaging under biological conditions. This demonstrates that TPE-HN is capable of detecting Ni2+ and Zn2+ in biological environments.