# REPL - Commands

<figure><img src="https://3631540137-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN446vsAcgRhUQmWQjww9%2Fuploads%2FXtkWYIyiTT9csupmAgXz%2FScreenshot%20from%202023-05-24%2022-16-13.png?alt=media&#x26;token=17e7f529-3b00-4b00-b242-654bcf5d8b40" alt=""><figcaption><p>REPL ENVIRONMENT COMMAND EXAMPLE </p></figcaption></figure>

### REPL - Commands

SkyLine also has built in REPL commands that do not count as direct code to be executed. This happens by first checking if every bit of input is directly matching a REPL command and if so to return once executed. The commands allow you to do many things such as viewing, exporting and replaying events. This module will explain specific commands.

### REPL - Event (REPL\_ENVIRONMENT)

The `REPL_ENVIRONMENT` command allows you to inspect and view the current environment within the current project. REPL is designed to only read specific amounts of input and it is not designed to develop full projects, however, in some cases it can be beneficial to view the environment to make sure everything is going as planned. The command to view an environment will look something like the one below.

<figure><img src="https://3631540137-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN446vsAcgRhUQmWQjww9%2Fuploads%2FCjGgSe8AxkG8DXIUEEyp%2FScreenshot%20at%202023-05-24%2022-21-10.png?alt=media&#x26;token=e35d425f-0537-4782-ad63-64b00f575aca" alt=""><figcaption><p>Example of viewing a workspace within the REPL</p></figcaption></figure>

This can definitely help you during test cases especially if you are testing imports for a module and do not always want to setup project environments.

### REPL - Event (REPL\_SAVE)

The save command allows you to take the given workspace and save it to a temporary file. In the case of you coming across a issue with the code and you want to clean the REPL you can tell it to save the environment that you are currently in using the command `REPL_SAVE` .

Saving an environment if successful will look like the following output

<figure><img src="https://3631540137-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN446vsAcgRhUQmWQjww9%2Fuploads%2FSVY0L6v3dWnKvgcq1y2L%2FScreenshot%20from%202023-05-24%2022-23-28.png?alt=media&#x26;token=1dc4682c-cbc1-4106-a7db-71c824140d36" alt=""><figcaption><p>REPL SAVE WORKSPACE</p></figcaption></figure>

### REPL - Event (REPL\_REPLAY\_LAST)

This command and event will replay the last line of code that you have given to the REPL or the last line of code that was executed within the environment. If you have a command like `10.Outln()` and you want to replay it you can do so using the command `REPL_REPLAY_LAST` . The execution of this looks like the following.

<figure><img src="https://3631540137-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN446vsAcgRhUQmWQjww9%2Fuploads%2Fx8H0mYimn80xAqIRSMN5%2FScreenshot%20from%202023-05-24%2022-26-12.png?alt=media&#x26;token=2d4d2ef5-6965-434c-8497-74fe69b77245" alt=""><figcaption><p>RESULT FROM REPLAY COMMAND </p></figcaption></figure>

It is important to note that this will not store the result in the code environment.

### REPL - Event (REPL\_REPLAY\_ALL)

This command is kind of a wild thing to use but it is similar to replay last. Instead of replaying the last command it will replay everything within the environment or code environment but never save it. The following image shows an environment being replayed.

<figure><img src="https://3631540137-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN446vsAcgRhUQmWQjww9%2Fuploads%2F95uRMhaAUpOQiL3G2ERf%2FScreenshot%20from%202023-05-24%2022-29-57.png?alt=media&#x26;token=86fbe175-42ab-4861-bf02-b52ed208c318" alt=""><figcaption></figcaption></figure>

### REPL - Event (REPL\_SETTINGS)

This will just show you the basic REPL settings, depending on the version and leaf of SkyLine ( Referring to the family member of the SkyLine language tree ) this can show anything from active thread count to user and OS info that the REPL uses.

<figure><img src="https://3631540137-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN446vsAcgRhUQmWQjww9%2Fuploads%2FOBVRfNWH5v6pPXX7S1NQ%2FScreenshot%20from%202023-05-24%2022-32-27.png?alt=media&#x26;token=0e512ad7-dbc1-48f0-8493-849df924e9ee" alt=""><figcaption></figcaption></figure>



