# Get first kernel by default

**URL:** <https://discourse.jupyter.org/t/get-first-kernel-by-default/15714>\
**Category:** JupyterLab\
**Tags:** how-to, help-wanted\
**Created:** [September 9, 2022, 5:46pm UTC](https://discourse.jupyter.org/t/get-first-kernel-by-default/15714 "2022-09-09T17:46:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dgc](https://avatars.discourse-cdn.com/v4/letter/d/6a8cbe/32.png) [@dgc](https://discourse.jupyter.org/u/dgc)\
**Post date:** [September 9, 2022, 5:46pm UTC](https://discourse.jupyter.org/t/get-first-kernel-by-default/15714/1 "2022-09-09T17:46:06Z")

</div>

I am creating an extension, which creates a notebook and opens it. When opening it with:

```auto
   commands.execute('docmanager:open', {path: newnotebook.path});

```

I get the kernel selection popup, how could I make jupyter select the first available kernel? From the documentation [KernelManager | @jupyterlab](https://jupyterlab.readthedocs.io/en/stable/api/classes/services.kernelmanager-1.html#connectto) but I cant figure out how to connect without getting this pop up.

Thank you very much 🙂 🙂
