         else
           gist
 
+  cmd 'load', 'Loads a file from GitHub', (path, options={}) ->
+    url = github.to_repo_url path
+    @async ->
+      @fns.text "Loading file #{path}"
+      promise = github.get_repo_contents(url)
+      .then (file) =>
+        notebook.handle_file @, file, options
+      promise.fail (response) =>
+        @fns.error response.statusText
+      promise
 
   cmd 'gist', 'Loads a script from a gist', (gist, options={}) ->
     if arguments.length is 0

        site = settings.get 'githubs', github.default()
        build_url site, gist
      else
        uri = URI gist
        site = github.get_github uri

        if github?
          [id, rest...] = uri.filename().split '.'


  github =
    context_fns: context_fns
    get_github: (url) ->
      uri = URI url
      hostname = uri.hostname()
      if hostname == 'gist.github.com' or hostname == 'api.github.com'
        host = 'github.com'
