> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# getgenv

> 通过 pushing LUA_ENVIRONINDEX 返回 current executor environment table。该 function 不接受 arguments，返回 exactly one value，并且没有 registered alias。repository 中的 call-sites 使用 returned table 读取和写入 shared executor globals，例如 __siApiCache 和 saveinstance。

<div className="real-function-page">
  ```lua theme={null}
  getgenv(): table
  ```

  ## 返回值

  <ResponseField name={"environment"} type={"table"}>
    此 state 当前存储在 LUA\_ENVIRONINDEX 的 table。
  </ResponseField>

  ## 示例

  Read and write values on the current executor environment table.

  ```lua theme={null}
  local env = getgenv()

  env.RealDocsValue = "ready"

  print(getgenv().RealDocsValue)
  ```
</div>
