> ## Documentation Index
> Fetch the complete documentation index at: https://gcore-doc-1046.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# FastEdge CLI

Run and test your FastEdge HTTP applications locally with the Gcore [FastEdge CLI tool](https://github.com/G-Core/FastEdge-lib). The following instructions will help you install, build, and execute some basic commands with FastEdge CLI.

<Tip>
  **Tip**

  We are actively developing [FastEdge CLI](https://github.com/G-Core/FastEdge-lib) and recommend regularly checking the FastEdge-lib repository for updates and new versions.
</Tip>

## Install and set up FastEdge CLI

1\. Clone the [FastEdge-lib](https://github.com/G-Core/FastEdge-lib) repository.

2\. Install Rust by running the following command:

`curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source "$HOME/.cargo/env"`

3\. In the directory where you cloned the repository, run the following command to initialize and update all submodules: `git submodule update --init --recursive -f`

4\. Build the CLI tool and all required dependencies: `cargo build –release`

5\. Compile and run the binary with the `help` flag to view the full list of available CLI commands and parameters: `cargo run --bin cli -- --help`

## Run FastEdge CLI

To run the compiled CLI tool, use the following command:

```sh theme={null}
./target/release/fastedge-run [command]
```

For example, if you want to open help and view the list of supported commands, run: `./target/release/fastedge-run http --help`.

## Example commands

This section provides some basic examples of how to work with FastEdge CLI. The sample commands use a test application from the [FastEdge-examples](https://github.com/G-Core/FastEdge-examples) repository.

### Run a FastEdge application and print all its headers

Execute the following command:

```sh theme={null}
./target/release/fastedge-run http –w [path-to-your-application] –-port [port number]
```

For example: `./target/release/fastedge-run http -w ../FastEdge-examples/rust/target/wasm32-wasip1/release/print.wasm –-port 8080`

To view the list of all printed headers, run `curl http://localhost:8080`

### Run a FastEdge application with environment variables

Execute the following command:

```sh theme={null}
./target/release/fastedge-run http –w [path-to-your-application] –-env [variables] --port [port number] 
```

For example, to set the BASE variable to the URL of the repository's README:

`./target/release/fastedge-run http -w ../FastEdge-examples/rust/target/wasm32-wasip1/release/markdown.wasm env BASE=https://raw.githubusercontent.com/G-Core/FastEdge-lib/main --port 8080`

After executing the command, you can run the FastEdge application, which will output the contents of the README: `http://localhost:8080/README.md`

### Run an application with sample geo headers

FastEdge CLI can add sample geo headers to your application without using a real IP address:

```sh theme={null}
./target/release/fastedge-run http -w [path-to-your-application] –geo –port [port number] 
```

For example: `./target/release/fastedge-run http -w ../FastEdge-examples/rust/target/wasm32-wasip1/release/print.wasm –-geo --port 8081`

To view the list of sample geo headers, run `curl http://localhost:8081`. You should see an output similar to the following:

```yaml theme={null}
Headers:
  host: localhost:8081
  user-agent: curl/8.6.0
  accept: */*
  pop-country-name: luxembourg
  pop-city: luxembourg
  pop-country-code: au
  server_name: test.localhost
  pop-continent: eu
  pop-lat: 49.6113
  pop-long: 6.1294
  pop-reg: lu%
```
