Fig Docs
  • 🏠Welcome to Fig
  • 👋Get Started
    • Download and Install
    • `fig home`
      • My Apps
      • The Sidebar
      • Settings
    • The Fig App Store
    • Hotkeys
  • 💪Autocomplete
  • 😀The Fig CLI
    • 1. Fig Overrides
    • 2. Fig Aliases
    • 3. $FIGPATH
    • 4. Fig Apps
  • 📖Interactive Runbooks
    • Form Elements
      • Input
      • Textarea
      • Dropdown
      • Checkboxes
      • Buttons
    • Templating & Interpolation
    • Scripting Language (Psilo)
      • Full List of Functions
    • Running Runbooks
    • Full Examples
  • ⚒️ Build your own CLI
    • `fig build`
    • .fig Files
  • 🧰Build your own App
    • Get Started
    • App Lifecycle
    • Key Concepts
      • Running Shell Commands
      • Reading Environment Variables
      • Accessing Files & Saving Data
      • Loading Local Resources
    • Window Managment
      • Setting Window Properties
      • Repositioning the Window
      • Focusing & Blurring the Window
    • Advanced
      • Creating a Pseudo-Terminal Session
  • Other
    • Fig for Teams
    • Security & Privacy
    • FAQ
    • Contact Us
  • Interactive Runbooks
Powered by GitBook
On this page
  • Fig CLI Structure
  • CLI Hierarchy
  • Examples

The Fig CLI

PreviousAutocompleteNext1. Fig Overrides

Last updated 4 years ago

Fig CLI Structure

Fig's CLI makes it easy to access apps, commonly used files (), and commonly used scripts.

The general syntax for Fig commands is:

fig <command, app name, or file name> [subcommands] [inputs]

Below

  1. CLI Hierarchy explains how Fig parses and routes every command it receives

  2. Examples gives some examples CLI commands and how Fig would route them

Remember: Fig commands can display websites, fig apps, interactive runbooks (.run files). and execute scripts

CLI Hierarchy

Fig follows a specific hierarchy when determining how to parse any given command. Fig has a hierarchy to avoid conflicts. For example, fig deploy could refer to an app named deploy and a script in your $FIGPATH named deploy.

Let's say you run fig CMD. Fig will check (in this order):

    • Is CMD a native Fig command that can't be overridden?

    • Have you defined a custom Fig Alias for CMD?

    • Is there a file like , CMD/index.html, , CMD.html or an executable like CMD, CMD.sh, CMD.py, or CMD.js in any of the directories you have specified in your $FIGPATH

    • For help setting up your $FIGPATH, go to

    • Is there an App on the Fig App Store called CMD

Examples

  • fig dir --> Opens the dir app

  • fig google hello world --> Opens the Google app and searches "hello world"

  • fig web https://github.com/pulls --> Open your Pulls page in Github

  • fig local index.html --> Opens the index.html file in your current working directory

  • fig deploy --flag --> Runs the deploy.sh script and passes in a flag

Hint: Just running fig gives you a list of all the subcommands you have available.

fig run heroku--> Opens the interactive runbook, heroku, located in your current working directory

fig acme forkdb --> Runs the forkdb subcommand specified by your acme file

😀
like interactive runbooks
Fig Overrides
Fig Aliases
$FIGPATH
CMD.fig
CMD.run
Settings
Fig Apps
.run
.fig