# Connect to the running Erlang shell

Source: https://zotonic.com/docs/1639/connect-to-the-running-erlang-shell

URI: https://zotonic.com/id/1639

Language: en

From the checkout root:

```sh
bin/zotonic shell
```

This attaches to the live node. Expressions run against that node's actual code and data, so start with read-only inspection.

```erlang
C = z:c(garden).
z_context:site(C).
```

Expect the site name `garden`. A fresh site context is not automatically an administrator context. Use an authenticated request context or deliberate, local-only elevation when testing mutations.

Leave the remote shell with **Ctrl-C twice**. Do not call `q().` or `halt().` to detach: they can stop the shared node.

If connection fails, check the target node name, Erlang distribution setup, and cookie configuration. See [Work with a site context](/id/2949) and [Inspect content from the Erlang shell](/id/1639).

Inspect content from the Erlang shell
-------------------------------------

With `C = z:c(garden)` in an attached shell:

```erlang
Id = m_rsc:rid(<<"page_home">>, C).
m_rsc:p(Id, title, C).
m_edge:objects(Id, haspart, C).
```

The named resource must exist on that site; `undefined` can mean the chosen name is absent. Use the generated site's real resource names rather than assuming every skeleton creates identical content.

Inspect individual properties first instead of dumping an entire resource containing private fields. Use models for normal content access, and understand the ACL context before interpreting missing results.

For a portable representation, inspect <a href="/id/2500" class="doc-reference doc-reference-model"><code>model#rsc_export</code></a>. For changes, use <a href="/id/1278" class="doc-reference doc-reference-model"><code>model#rsc</code></a> and <a href="/id/1297" class="doc-reference doc-reference-model"><code>model#edge</code></a>, then check the public result separately. See [Use stable resource names](/id/2950).

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1639?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1639?language=en>)
