diff --git a/renga/cli/notebooks.py b/renga/cli/notebooks.py
index <HASH>..<HASH> 100644
--- a/renga/cli/notebooks.py
+++ b/renga/cli/notebooks.py
@@ -158,14 +158,19 @@ def run(notebook_args):
     else:
         notebook = 'jupyter-notebook'
 
-    file_ = client.current_context.inputs['notebook']
-    click.echo(file_.filename)
-    with file_.open('r') as fp:
-        with open(file_.filename, 'wb') as code:
-            code.write(fp.read())
+    try:
+        file_ = client.current_context.inputs['notebook']
+        click.echo(file_.filename)
+        with file_.open('r') as fp:
+            with open(file_.filename, 'wb') as code:
+                code.write(fp.read())
+
+        cmd = [notebook, file_.filename]
+    except KeyError:
+        cmd = [notebook]
 
-    from subprocess import call
-    cmd = [notebook, file_.filename]
     if notebook_args:
         cmd.extend(notebook_args)
+
+    from subprocess import call
     call(cmd)
cli: run notebook without a file