As reported by engadget,
Nearly four years after NieR: Automata was released, a modder has discovered the RPG’s final secret. Lance McDonald spotted some unfamiliar code when he was reverse engineering the game. He figured out it related to a cheat code that allows players to skip right to the end of NieR: Automata.
You can only activate the cheat code at a specific location. Once you beat prologue boss Marx and speak to 9S, you need to stand between some barrels. In a video detailing the cheat, McDonald explained how to input the code on the PS4 version — hold down R2, then press up, down, up, right, left, square, circle, triangle and cross. It might be easier if you pause the game first. If you enter the code correctly, you’ll be taken to the post-credits scene.