← Back to posts

Introducing Fig Scripts: Build internal CLI tools faster

Matt Schrage

Fig makes engineers 10x more productive in the terminal. To start, we built Autocomplete — which made CLI tools discoverable and easier to use.

Autocomplete works great for public tools like git or docker. However, any large engineering organization accumulates a hodgepodge of internal tools that are required to compile code, run tests, trigger CI, setup the dev environment and more.

After getting used to Fig, engineers started asking us for a way to make these team-specific scripts and internal CLI workflows easier to use as well.

Today, we're launching Scripts: our replacement for your team's “scripts” folder and internal CLI tools.

This is what executing a Fig Script looks like:

Running a Fig Script to handle a common git flow

Introducing Scripts

Fig Scripts provides a searchable collection of your team's terminal workflows.

  • Powerful, contextual search makes it easy for your team to discover the tools that you've already built — no need to reinvent the wheel.
  • Interactive terminal UIs adds helpful guardrails to the execution process, preventing mistakes and enabling new engineers to get up to speed quickly.
  • Automatic provisioning makes it easy to distribute new scripts and changes to existing ones to your entire team.
  • Out-of-the-box error reporting and usage monitoring lets you gain insights into blockers, helping your team move faster.

Engineering teams have written Fig Scripts for everything from deployment pipelines, to conventional commit flows, to unit tests, to provisioning cloud resources.

💡 To create your first script, just run fig and go to the Scripts tab.

Interested in building your teams internal CLI tooling with Fig Scripts? Let's chat →

Fig Scripts dashboard

What makes Fig Scripts easier to build?

To create a new script, simply define the input parameters. Fig will generate the CLI flags, the terminal user interface, and distribute it to your team for you!

Script creation flow with the corresponding terminal UI

Script creation flow with the corresponding terminal UI

Scripts can be written in most popular scripting language. Out of the box, we support JavaScript, TypeScript, Python & Bash. Parameters are then passed in an idiomatic way, with the correct types.

# bash
git commit -m "{{msg}}"

# javascript

Terminal UIs are easy to customize. The Script editor makes it easy to customize input components like a checkbox, selector, textfield and file-picker. You can tailor each field to your specific use-case by adding descriptions, default values, dynamically generated suggestions and more.

Customize the input fields in the Script editor

Customize the input fields in the Script editor

⚡️ Build and deploy your first Script in ~3min or less! Get started now →

How do I execute a Fig Script?

  • Search for it. Just run fig run and search over all workflows across your team and your personal account. Fig will suggest Scripts based on context and usage data — so the more you and your team use Scripts, the better the recommendations become.
  • Execute it directly. Run fig run <script> [--flags]. If any parameters are missing, a terminal UI will appear with prompts for the required inputs.

Run fig run to execute a script

The Future of Scripts

Our aim with Fig Scripts is to make it easy for engineering teams to create and share internal tools.

Here's what's next on our roadmap:

  • Organize your team's scripts into your own, custom internal CLI tool
  • Link Scripts to projects/git repos - it's time to replace those hairy makefiles
  • Integrations with developer infrastructure, like AWS, Slack, Datadog, Atlassian, Sentry, Github and more.
  • Policy and governance (audit logs, approvals, RBAC)
  • In-line documentation - a runbook in your terminal!

If you have specific feature requests, please just message me at matt [at] fig.io

We are so excited to see how you'll use Scripts to supercharge your team's terminal workflows.

⚡️ Want to migrate your team's developer tooling to Fig? Schedule a demo →

Want to stay up to date? Follow us on Twitter: twitter.com/fig