cli: add per-client thread function