# .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](../interactive-runbooks-2) 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](../the-fig-cli/figpath)
    * 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](../the-fig-cli/figpath). You can do this in [Settings](../get-started/fig-home/settings).
