Skip to content
/ fl Public

Command line generator using Postman Flows

Notifications You must be signed in to change notification settings

rabbah/fl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fl: Command Line AId powered by Postman Flows

Unit Tests

This command line tool, fl, is designed to convert natural language descriptions of command line tasks into valid Unix commands. It simplifies the process of executing tasks on a Unix command line by allowing users to describe their actions in plain language.

You can read more about the story of fl here.

Development

git clone this repo then run the setup command to configures git hooks.

./run.sh setup

Build Installation

Ensure go is in your path and run the following command to build the binary.

./run.sh build

To install the fl binary in your $GOPATH run the following command.

./run.sh install

To run the unit test, use the following command.

./run.sh test

Usage

To use fl, simply provide a natural language description of the command line task you want to perform, and the tool will generate the corresponding Unix command.

A sample prompt is provide by running the example helper.

./run.sh example

You can run the tool either by installing fl in your path and using it directly or using the helper script.

./run.sh fl your prompt here

Other flags are available and example usage will be provided by passing the -h or --help flags.

Sample Calls

Here are some sample calls for using fl:

  1. Description: Remove a directory and all its contents.

    fl remove a directory and all its contents

    Sample output:

    rm -r directory_name
  2. Description: Search for files containing a specific keyword in the src directory.

    fl search for files containing keyword in src directory

    Sample output:

    grep -r "keyword" src
  3. Description: Process a CSV file to extract a column and count unique occurences of a value.

    fl count the number of unique values that appear in the second column of a csv file, make sure the count is case insensitive, report the total count only

    Sample output:

    awk -F, '{print tolower($2)}' file.csv | sort -u | wc -l
  4. Description: Call an authenticated API and pass in some JSON data.

    fl call an api that returns JSON and sends some data {"foo":"bar"} as json where the api uses basic auth and the secret is an environment variable called API_KEY

    Sample output:

    curl -X POST -H 'Content-Type: application/json' -H 'Authorization: Basic $API_KEY' -d '{"foo":"bar"}' https://api.example.com/endpoint

Postman Flows

The entire backend for fl is implemented using Postman Flows. Flows is a visual and low-code programming language for working with APIs and creating workflows with direct manipulation of APIs and data.

Notes and References

This README Usage and Sample Calls sections were entirely generated with fl itself. There are related command line tools for using LLMs with a CLI that I've found. There are surely others, so let me know what other interesting and related tools I should check out.