# Using the REPL

The (R)ead (E)valuate (P)rint (L)oop is a core feature of the CLI node. It allows you to execute direct commands inside a running node without having to code everything into a command or API. \
\
For example you can query the status of the network by executing `API.Chain.stats()` inside the REPL of a running and online node.

```elixir
iex(114)> API.Chain.stats()
%{
  height: 29984500,
  pflops: 27.869284354182614,
  circulating: 330546993.68658775,
  cur_validator: "6V65RDdHU8T7TbFxGh42sp2hmXrfmRRFbuTjmJv4yysikdNhtdSC2yMxr7L95gDCKn",
  emission_for_epoch: 905214.287460235,
  next_validator: "7pGZFZpfJbUf8NwqSw84cRvNGabvDdd2SafxvNdTUh7Peus2S1tBv21ETiq46Xg4kb",
  tip: %{ 
    hash: "AxUjrFBJQZ4kUac42S6qoELG3iHFwFK4aKwrFVYFfXtU",
    tx_count: 1,
    header_unpacked: %{
      slot: 29984500,
      dr: "3UaAR71UXvApB3qCvt6dwwrdgERWKhgcmS68yjSLcKjc",
      vr: "22pssGv5SwdJxxD4Q4UwN4upmwQ42ivb8MkY44AW7JczfMTKofjbNirsmAZ6ztAtqdfi1c4w4GZ1MHanqhoRptcKAhU5oTT9P5zboPQ5QKj8sPRigCLmqFAD28cMFMLsDWQT",
      prev_hash: "8VHwdFDXYS2LHukKJYa4rxsrTwyrswJ9mYcwtpMoaCom",
      signer: "6V65RDdHU8T7TbFxGh42sp2hmXrfmRRFbuTjmJv4yysikdNhtdSC2yMxr7L95gDCKn",
      height: 29984500,
      prev_slot: 29984499
    },
    consensus: %{score: 0.848, mut_hash: "4GB4rBv2GGXaQ7TCYPV7THsFzov1KnTkomedKjMW4LN9"}
  },
  tip_hash: "AxUjrFBJQZ4kUac42S6qoELG3iHFwFK4aKwrFVYFfXtU",
  tx_pool_size: 0
}

```

The future instructions here will all make use of the REPL from an OFFLINE running node. An OFFLINE node does not join the network but can communicate with the RPC API of other nodes.\
\
To run a node in offline mode download the latest `amadeusd` release from github [https://github.com/amadeus-robot/node/releases/latest](https://github.com/amadeus-robot/node/releases/tag/v1.1.8) and run it like:

```
OFFLINE=true ./amadeusd
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ama.one/cli/using-the-repl.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
