> 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/build-a-cli/.fig-file.md).

# .fig Files

This page outlines how a .fig file is structured.  The`fig build` command lets you visually create and edit .fig files. You should not have edit the the actual file.&#x20;

### File Name

Every .fig file must have a name. This name is the root command for all the subcommands defined in .fig file.&#x20;

{% hint style="success" %}
e.g. ACME.fig with a subcommand *deploy* is accessible with `fig ACME deploy`
{% endhint %}

### File Structure

Every .fig file consists of nested javascript objects with the following properties. Each object is its own CLI command. Any nested objects (nested inside the children property) are considered subcommands of that command.&#x20;

* **command:**&#x20;
  * the command (or subcommand)&#x20;

* **text:**&#x20;
  * the [rundown](/fig/interactive-runbooks-2.md) that is displayed in a Fig window if a user runs the CLI but passes no inputs

* **script:**
  * The shell script to run when the specific command (or subcommand is called)
  * The *$SELECTEDPATH* variable is used to signify the path the user specified in [$FIGPATH](/fig/the-fig-cli/figpath.md)
    * You don't have to use *$SELECTEDPATH*  but it lets you share CLI workflows across teams when repos may be in different directories&#x20;
    * *$SELECTEDPATH* does not have a trailing slash
    * e.g.&#x20;

      * `python3 my/path/to/deploy.py` will work on your computer
      * `python3 $SELECTEDPATH/deploy.py` will work on your computer and your teammates' so long as you both have added the path to the .fig file to your $FIGPATH

* **runWithNoInput:**&#x20;
  * If true, and the user passes no inputs, parameters or flags to the CLI, Fig will run the script command rather than the opening the runbook defined in the text

* **children**
  * The subcommands for the given command
  * An array of objects with the same properties as this object

```javascript
// File Name: ACME.fig --> ACME is the root command

{
    command: "deploy", // STRING
    
    text: "# Deploy \n ", // STRING
    
    script: "" // STRING
    
    runWithNoInput: true // BOOLEAN
    
    children: [ ] // ARRAY OF OBJECTS 
}
```

### File Location

In order to access the CLI tool, you must add the directory that contains the .fig file to your [$FIGPATH](/fig/the-fig-cli/figpath.md). You can do this in [Settings](/fig/get-started/fig-home/settings.md).
