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
  • How can I get started?
  • What is a .fig file?
  • How should I name my .fig file?
  • How do I share this CLI tool with my team?

⚒️ Build your own CLI

PreviousFull ExamplesNext`fig build`

Last updated 4 years ago

Fig makes it easy to visually build your own Command Line Interface (CLI) for yourself, your team, and your company.

A CLI built with Fig lets you directly execute scripts. For users who often don't remember input parameters, flags, or commands, it lets you build an into the CLI. This makes traditional command line interfaces more discoverable, approachable, and interactive.

How can I get started?

  1. Navigate to the directory where you want to save your CLI

    • e.g. your scripts folder in a shared repo

  2. Run to visually create and edit your CLI tool

    • This will create a .fig file in that folder

  3. Add the directory from Step 1 where your .fig file is saved to your

    • You do this in

    • Make sure your teammates do the same

  4. Run fig CMD SUBCOMMAND

    • where CMD is the name of your .fig file

    • where SUBCOMMAND is a command you defined in fig build

    • Your teammates can do this too 😀

What is a .fig file?

A .fig file is the blueprint for your CLI tool. It is a JSON stringified object that contains the mapping for all of your subcommands.

How should I name my .fig file?

The name of your .fig file (e.g. ACME.fig) defines the root command used to access the subcommands you defined.

e.g. If I had a file named ACME.fig with a subcommand called deploy, I could access it by running fig ACME deploy

How do I share this CLI tool with my team?

  1. You can host the .fig file with Fig (coming soon)

  2. You can put the .fig file in a shared repository

Make sure your teammates add their local path to that shared repo to their

$FIGPATH
interactive runbook
fig build
$FIGPATH
Settings
`fig build`