Skip to content

Latest commit

 

History

History
104 lines (75 loc) · 4.8 KB

README.md

File metadata and controls

104 lines (75 loc) · 4.8 KB

Instacli Command Reference

Overview of standard commands in Instacli.

REST API interaction

Http client

  • GET - Sends a GET request to an HTTP endpoint
  • POST - Sends a POST request to an HTTP endpoint
  • PUT - Sends a PUT request to an HTTP endpoint
  • PATCH - Sends a PATCH request to an HTTP endpoint
  • DELETE - Sends a DELETE request to an HTTP endpoint
  • Http request defaults - Sets the default parameters for all subsequent HTTP commands.

Manage credentials

Http server

  • Http server - Starts an embedded HTTP server, based on an OpenAPI-flavored spec and backed by Instacli scripts

Core instacli

Script definition

  • Script info - Contains script description and input parameter definitions.

Variables

  • ${..} assignment - Sets a variable value
  • As - Sets a variable to the contents of the output variable
  • Output - Sets the output variable

Testing

Control flow

  • Do - Executes one or more commands
  • Exit - Stops running the current script
  • For each - Loops over or transforms a list or object
  • Repeat - Executes a block of code until a condition is satisfied
  • If - exectues commands if a condition holds
  • When - Executes a single command from a list of conditions

Error handling

User interaction

  • Prompt - Asks the user for input with an interactive prompt
  • Prompt object - Asks mutlitple questions and stores the answers into one object

Data manipulation

  • Add - Adds items
  • Add to - Adds items to existing variables
  • Append - Adds items to the output variable
  • Find - Retrieves a snippet from a larger object
  • Replace - Does a text-based find&replace
  • Size - Gives you the size of things
  • Sort - Sorts an array

Files

Shell

  • Shell - Executes a shell command

Util