     [celestial.security :refer (set-user current-user)]
     [taoensso.timbre  :as timbre :refer (set-level!)]
     [io.aviso.columns :refer (format-columns write-rows)]
+    [io.aviso.ansi :refer :all]
     ))
 
 (set-level! :debug)

(defn select-keys* [m & paths]
  (into {} (map (fn [p] [(last p) (get-in m p)])) paths))

(defn format-systems 
  [{:keys [meta systems]}]
  (let [formatter (format-columns  [:right 10] "  "  [:right 5] "  " :none)
        systems' (map #(select-keys* % [:owner] [:machine :hostname] [:machine :os]) (map second systems))]
      (write-rows *out* formatter  [:hostname :owner :os] systems')))
 
(ls types :foo 1)
(format-systems (ls systems))
;; (ls types)
 

(def systems (Systems.))

(defrecord Types [] Repl 
  (ls [this]
    {:types (map t/get-type (t/all-types))})
  (ls [this & opts])
  (find [& opts])
  (rm [& opts]))

