Mayor de Blasio has directed police to play a shell game with homeless people — shuffling them from place to place to make it appear he is cleaning up the city, two groups charge.

In a letter to the city’s Commission on Human Rights on Thursday, the New York Civil Liberties Union and the advocacy group Picture the Homeless accused de Blasio of ordering the NYPD to tell vagrants to “move along,” even if they soon return.

At a press conference, NYCLU Executive Director Donna Lieberman described it as a game of whack-a-mole. “Many are herded from block to block without reason,” she said.

The groups asked that the commission probe the city’s “move along” policy and its potential links to the mayor.

In one incident near the Metro-North station at East 125th Street, cops told PTH staffers “that they [the officers] were acting under orders from the mayor’s office and ‘that the mayor wants the area cleaned up,’ ” the letter said.

“When PTH staff members later asked [an officer] . . . if there was a policy of removing homeless people from the plaza, the officer said ‘yes,’ and that there was an ‘edict from the Mayor’s Office,’” the letter said.

De Blasio spokesman Monica Klein responded, “The city respects the rights of our homeless New Yorkers and has put in place a new comprehensive plan to reduce homelessness.”