⚒️ Build your own CLI
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 interactive runbook into the CLI. This makes traditional command line interfaces more discoverable, approachable, and interactive.
- 1.Navigate to the directory where you want to save your CLI
- e.g. your scripts folder in a shared repo
fig buildto visually create and edit your CLI tool
- This will create a .fig file in that folder
fig CMD SUBCOMMAND
- where CMD is the name of your .fig file
- where SUBCOMMAND is a command you defined in
- Your teammates can do this too 😀
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.
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