> For the complete documentation index, see [llms.txt](https://fig.gitbook.io/fig/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fig.gitbook.io/fig/apps/getting-started.md).

# Get Started

In order to start building Fig apps, you'll need to download [Fig](https://withfig.com).

1. Currently, Fig is a limited beta. To sign up for the developer preview, please fill out [this form](https://withfig.typeform.com/to/GndELJ) and join our [developer community](https://figcommunity.slack.com/). We're really excited to see what you build. :)<br>
2. Once you have Fig, you'll need to create the project structure for your Fig app.

   Luckily, this is very simple. The minimal project requires no dependencies (besides `fig.js` which is included automatically at runtime) and no build process.

{% code title="sample.html" %}

```markup
<html>
  <head>
    <meta fig:app = "sample-app">
    <script>
      fig.init = (stdin, options) => {
        // fig.init is the entry point to your app's logic.
        // Calling any fig command prior will result in undefined behavior. 
        
        fig.title = fig.env.PWD
        fig.icon = `fig://${fig.env.PWD}`
        
        fig.execute('ls -1', (files) => {
          document.body.innerText = files
        })
      }
    </script>
  </head>
  <body>

  </body>
</html>
```

{% endcode %}

`fig local sample.html`

1. **Debugging your app.**

   You can open the Safari Web Inspector by right clicking on your app. The Fig API is still maturing, so if you run into unexpected behavior, please let me know at <matt@withfig.com> or in the [#bugs channels](https://figcommunity.slack.com/messages/bugs) of the Slack community.<br>

2. **Running your app**

   `fig local path/to/app.html`  \
   \
   While testing, it can be useful to add this snippet to your sidebar for quick access.&#x20;

   1. Run `fig home`&#x20;
   2. Press "Add Code Snippet" button
   3. Choose an emoji and a name
   4. Add `fig local path/to/app.html`

3. **(Advanced) Adding apps to your `$FIGPATH`**

   If you want to access your Fig apps without typing out the full path, you can add them to your `FIGPATH` - a colon separated list of paths where Fig will check for a matching app.\
   \
   For instance, if you run `fig sample-app` , Fig will check every directory added to your `FIGPATH` for...

   1. `sample-app.html`
   2. `sample-app/index.html`

   \
   You can update your `FIGPATH` by adding something like`export FIGPATH=/User/mschrage/path/to/apps` to your `.profile` .


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://fig.gitbook.io/fig/apps/getting-started.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
