You can clone with
;;; Eshell stuff
(when (fboundp 'eshell)
;; This and rmb are my two vices. rmb is defined as an eshell alias.
(defalias 'eshell/lo #'eshell/exit)
(defalias 'eshell/logout #'save-buffers-kill-emacs)
;; I'm obsessive/compulsive with clear.
(defun eshell/clear ()
"\"Clear the screen,\" as it were."
(defun eshell/emacs (&rest args)
"Open a file in emacs. Some habits die hard."
(if (null args)
;; If I just ran "emacs", I probably expect to be launching
;; Emacs, which is rather silly since I'm already in Emacs.
;; So just pretend to do what I ask.
;; We have to expand the file names or else naming a directory in an
;; argument causes later arguments to be looked for in that directory,
;; not the starting directory
(eshell-flatten-list (reverse args))))))
(defalias 'eshell/emacsclient #'eshell/emacs))