 
 (def admin {
   :username "admin" :password "foo"
-  :envs [:dev :qa :prod] 
-  :roles #{:celestial.roles/admin} 
+  :envs [:dev :qa :prod]
+  :roles #{:celestial.roles/admin}
   :operations [] })
 
 (defmacro with-admin [& body]
   `(with-redefs [celestial.security/current-user (fn [] {:username "admin"})
                 celestial.persistency.users/get-user! (fn [a#] admin)]
-       ~@body 
+       ~@body
        ))
 
-(defprotocol Repl 
-  "Basic shell like functions on Celestial model types" 
+(defprotocol Repl
+  "Basic shell like functions on Celestial model types"
   (ls [this] [this & opts])
   (find [this exp])
   (rm [this items])

(def types (Types.))

;; (pretty (ls types))
;; (macroexpand-1 '(|> (ls systems) (grep :os :ubuntu-14.04 :four)))
;; (pretty (|> (ls systems) (grep :os :ubuntu-14.04 )))

    (= v (sub k))
    ))

(defrecord Systems [] Repl
  (ls [this]
    (with-admin
      (let [systems (into [] (s/systems-for (celestial.api.systems/working-username)))]
        [this {:systems (doall (map (juxt identity s/get-system) systems))}])))
