# Using Stakpak

## Using Stakpak Interactively (Interactive Mode)

<figure><img src="https://2684022488-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOFDKnFMEMmJjoclGx9Hr%2Fuploads%2FLAQXocQEXLXrBuEoTgH5%2Fimage.png?alt=media&#x26;token=b1790f35-8e27-45cd-88d1-5b97876c059b" alt=""><figcaption></figcaption></figure>

To run stakpak interactively, all you have to do is to open the terminal in the directory you want to work in and type: `stakpak`

## Using Stakpak in Async (Async Mode)

<figure><img src="https://2684022488-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOFDKnFMEMmJjoclGx9Hr%2Fuploads%2FBMX0oZSoAc3p9ePzq8el%2Fimage.png?alt=media&#x26;token=7e4268d9-93ca-473f-8214-d674b77d4a69" alt=""><figcaption></figcaption></figure>

To run stakpak in async mode all you have to do is to open the terminal and type: `stakpak -a "your prompt"`&#x20;

You can set the max number of steps the agent can take by adding the `-m` flag

{% hint style="info" %}
The default number of steps in async mode is 50
{% endhint %}

## Using Stakpak on Remote Servers (SSH)

Stakpak’s file editing tools support SFTP, so you can create/edit/remove files on a remote host without installing anything on it.

all you have to do is to open stakpak on your local machine and then typing:

`command ssh username@<ip> -p <portnumber>`

Once connected, Stakpak can operate on the remote filesystem using the following commands:

* **create** – create new files on the remote host
* **str\_replace** – modify existing files by replacing content
* **view** – read and inspect remote files
* **run\_command** – execute commands on the remote server

or you can use [shell-mode](https://stakpak.gitbook.io/docs/how-it-works/shell-mode "mention")
