How do you beat Djimmi the Great in Cuphead?

Quick answer: It is a five-phase plane fight. Dodge the treasure chest attacks, shoot through the face pillars, stay high near the sarcophagus, then handle the puppet and the giant Djimmi with his Eye Pyramids.
Show walkthrough
Phase 1: treasure chest
Djimmi opens a chest and sends out spinning scimitars, a burst of jewels and goblets, or cat sarcophagi that release homing scarabs. Some swords, one jewel and one scarab per sarcophagus are pink and can be parried. Stay in open space and fly between the waves.
Phase 2: the pillars
The screen scrolls sideways through pillars made of Djimmi’s face. Shoot the face sections to open gaps and fly through them; these hits also count as damage to him. Watch for diagonal saw blades on Regular and Expert.
Phase 3: sarcophagus
Djimmi becomes a slug-like sarcophagus that moves up and down, firing waves of ringed eyeballs and ghostly mummies. Staying near the top of the screen, close to him, while dropping bombs lets you deal damage while avoiding most shots.
Phases 4 and 5
A giant hand lifts a Cuppet puppet that fires bullet lines and blue parryable bullets, while Djimmi’s turban shoots bursts. In the last phase the giant Djimmi summons three Eye Pyramids that fire cross-shaped beams and shoots rings from his turban gem. Shrink to slip through gaps in the patterns.
Secret phase
If you shrink into the mini plane while Djimmi scans you before phase 4, he makes a mini Cuppet instead. This skips phase 4 but makes the final phase harder. Only try it if you are going for the secret.
