client: Add command mode and agent mode helper functions