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
  • Functions in Psilo
  • Parsing
  1. Interactive Runbooks
  2. Scripting Language (Psilo)

Full List of Functions

THIS HAS NOT BEEN UPDATED. IT IS AN ACCURATE LIST OF FUNCTIONS BUT THE DESCRIPTIONS ARE INACCURATE. DISREGARD.

Functions in Psilo

When running a function, we take the last elements of the stack

  • lines

    • input: string

    • output: array of strings split on "\n"

  • csv

    • input: string

    • output: array of strings split on ","

  • jsonparse

    • input: string

    • output: json object of string (if valid) (ie array or dictionary)

  • shell, sh,

    • input: string

    • output: result of shell command as string

  • runshell, run

    • input: string

    • output: none

    • action: run shell command in connected terminal

  • insertshell, insert

    • input: string

    • output

    • action: insert shell command in connected terminal (but not run)

  • env

    • input: none

    • output: adds shell environment variables as a JSON object dictionary to the stack

Useful chained command

  • env "PWD" jsprop

    • input: none

    • output: get the value of the "PWD" environment variable

  • figread

    • input: file path as a string

    • output: contents of file as string

  • figwrite

    • input: file path as a string

    • output: none

    • action: writes content of string to file

  • figclose

    • input: none

    • output: none

    • action: closes fig window, ends execution

  • prop

    • input: (json object, string)

    • output: get the value of the "string" from the json object

e.g.

  • "a[0].b.c" prop

  • matches

    • Input: (string, regex pattern (as string))

    • Output: array of strings matching regex pattern

  • prefix?

    • Input: (stringOne, stringTwo)

    • Output: Boolean: checks if stringOne starts with stringTwo

  • suffix?

    • Input: (stringOne, stringTwo)

    • Output: Boolean: checks if stringOne ends with stringTwo

  • contains?

    • Input: (stringOne, stringTwo)

    • Output: Boolean: checks if stringOne contains stringTwo

  • filter

    • input: (array, function)

    • output: new array only keeping results of function that are true

  • map

    • input: (array, function)

    • output: new array mapping function over stack

  • =

    • input (numberOne, numberTwo)

    • output: check if numberOne is equal to numberTwo

  • s=

    • input (stringOne, stringTwo)

    • output: check if stringOne is equal to stringTwo

  • !

    • input: boolean

    • output: opposite of input boolean

Parsing

Types

  • "sdfsdf"

    • String

  • 121

    • Number

  • "[ "sdfs", "aaa", 121 ]" json

    • Array

  • true / false

    • Boolean

  • ??Everything else:

    • Psilo function

PreviousScripting Language (Psilo)NextRunning Runbooks

Last updated 4 years ago

"" prop

gets the value of from the object on the stack

📖
person.name
person.name