# How to tell if a Pluto notebook is being run in Pluto or from REPL?

**URL:** <https://discourse.julialang.org/t/how-to-tell-if-a-pluto-notebook-is-being-run-in-pluto-or-from-repl/84282>\
**Category:** General Usage\
**Tags:** pluto\
**Created:** [July 15, 2022, 5:05pm UTC](https://discourse.julialang.org/t/how-to-tell-if-a-pluto-notebook-is-being-run-in-pluto-or-from-repl/84282 "2022-07-15T17:05:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Nahabedian](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mark_nahabedian/32/16562_2.png) [@Mark\_Nahabedian](https://discourse.julialang.org/u/Mark_Nahabedian)\
**Post date:** [July 15, 2022, 5:05pm UTC](https://discourse.julialang.org/t/how-to-tell-if-a-pluto-notebook-is-being-run-in-pluto-or-from-repl/84282/1 "2022-07-15T17:05:42Z")

</div>

I have a Pluto notebook that uses the Pluto package manager.

I can run that notebook within Pluto.

I’d like to also be able to run it from the Julia REPL. When run from the REPL, I’d like some of the output to be written to files rather that to notebook output cells.

Also, to run the notebook in the REPL I need to conditionally call `activate_notebook_environment` to activate the right environment.

How can code in my notebook tell if it is being run in Pluto or in the Julia REPL.

Sorry, I think I asked this before, but can’t find the thread.

Thanks.

---

<div class="post-metadata">

**Author:** ![ederag](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ederag/32/4106_2.png) [@ederag](https://discourse.julialang.org/u/ederag)\
**Post date:** [July 15, 2022, 8:35pm UTC](https://discourse.julialang.org/t/how-to-tell-if-a-pluto-notebook-is-being-run-in-pluto-or-from-repl/84282/2 "2022-07-15T20:35:01Z")

</div>

There’s

```julia
if @isdefined PlutoRunner # running inside Pluto
    ...
end

```

---

<div class="post-metadata">

**Author:** ![Mark\_Nahabedian](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mark_nahabedian/32/16562_2.png) [@Mark\_Nahabedian](https://discourse.julialang.org/u/Mark_Nahabedian)\
**Post date:** [July 15, 2022, 10:57pm UTC](https://discourse.julialang.org/t/how-to-tell-if-a-pluto-notebook-is-being-run-in-pluto-or-from-repl/84282/3 "2022-07-15T22:57:14Z")

</div>

Excellent!

Thanks much.

---

<div class="post-metadata">

**Author:** ![fonsp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fonsp/32/222349_2.png) [@fonsp](https://discourse.julialang.org/u/fonsp)\
**Post date:** [January 16, 2024, 1:49pm UTC](https://discourse.julialang.org/t/how-to-tell-if-a-pluto-notebook-is-being-run-in-pluto-or-from-repl/84282/4 "2024-01-16T13:49:34Z")

</div>

Hi all! There is now an **official API** for this: **`AbstractPlutoDingetjes.is_inside_pluto`**.  
Check out the [AbstractPlutoDingetjes.jl](https://github.com/JuliaPluto/AbstractPlutoDingetjes.jl) package to learn more!

* * *

Also useful is the “Disable in File” button in the the (…) context menu of a cell:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/8/2/82bf5621126033cd5a8d7f003bf4fc5c8ed5c033.jpeg)
