Implement 'document' command