Welcome to FluentCLI

The docs are a work in progress but what docs aren't?

Welcome to the official documentation for FluentCLI, a versatile command-line interface designed to interact with FlowiseAI, Langflow, and Webhook workflows. This documentation will guide you through the installation, configuration, and usage of FluentCLI.

Table of Contents

  1. Introduction

  2. Installation

  3. Configuration

  4. Basic Usage

  5. Advanced Commands

  6. Outputs and Formats

  7. Integration with Other Tools

  8. Examples

  9. Troubleshooting

  10. Appendix

Introduction

FluentCLI is a command-line tool that facilitates interactions with various AI engines and services, including FlowiseAI, Langflow, and Webhooks. By leveraging FluentCLI, users can easily send requests, upload files, and receive responses in different formats directly from the terminal.

Key Features

  • Easy Configuration: Define multiple flows with customizable configurations.

  • Versatile Usage: Supports multiple AI engines and services including FlowiseAI, Langflow, and Webhooks.

  • Rich Output Options: Choose from various output formats, including JSON, markdown, and plain text.

  • File Uploads: Upload files to endpoints seamlessly.

  • Integration: Easily integrate with other tools and services in your workflow.

This documentation aims to cover all aspects of FluentCLI, from initial setup to advanced usage scenarios. Let's get started!

Installation

To get started with FluentCLI, you must first install it. FluentCLI is written in Rust, so you'll need to have Rust installed on your system. Follow the steps below to install Rust and then FluentCLI.

Installing Rust

If you don't have Rust installed, you can install it using the following command:

Follow the on-screen instructions to complete the installation. After installation, ensure Rust is correctly installed by running:

Installing FluentCLI

Clone the FluentCLI repository from GitHub and navigate to the project directory:

Next, build and install FluentCLI using Cargo:

This command compiles the FluentCLI source code and installs the fluent command on your system.

Verifying the Installation

After installation, you can verify that FluentCLI is installed correctly by running:

You should see the version information of FluentCLI displayed in the terminal.

Configuration

FluentCLI uses a configuration file to manage different flows and their settings. The configuration file is written in JSON format and must be placed in a directory specified by the FLUENT_CLI_CONFIG_PATH environment variable.

Setting Up the Configuration File

Create a JSON configuration file and set the FLUENT_CLI_CONFIG_PATH environment variable to the directory containing the file. Here's an example configuration file:

Environment Variables

Set the FLUENT_CLI_CONFIG_PATH environment variable to the directory containing your configuration file:

You can also add this line to your shell's configuration file (e.g., .bashrc, .zshrc) to make it persistent.

Configuration Fields

  • name: The name of the flow.

  • engine: The AI engine or service to be used (e.g., "flowise", "langflow").

  • protocol: The protocol to use ("http" or "https").

  • hostname: The hostname of the service.

  • port: The port number of the service.

  • chat_id: The chat ID or endpoint identifier.

  • request_path: The request path for the service.

  • sessionId: The session ID (can use environment variables prefixed with "AMBER_").

  • bearer_token: The bearer token for authentication (can use environment variables prefixed with "AMBER_").

  • overrideConfig: Custom configuration overrides.

  • tweaks: Additional configuration tweaks.

  • timeout_ms: Request timeout in milliseconds.

Basic Usage

Once you have installed and configured FluentCLI, you can start using it to interact with various AI engines and services.

Sending a Simple Request

To send a request to a configured flow, use the following command:

For example:

This command sends the request "What is the weather today?" to the flow named "LocalGoogleGeminiChain".

Adding Context

You can provide additional context to your request using the --context flag or by piping input from a file or stdin.

Using the --context flag:

Piping input from a file:

Uploading Files

FluentCLI allows you to upload files as part of your request using the --upload-image-path flag:

Specifying Output Formats

FluentCLI supports multiple output formats such as markdown, plain text, and JSON.

Markdown output:

Extracting code blocks:

Full JSON output:

Advanced Commands

FluentCLI offers several advanced commands and flags to customize your interactions and workflows.

Overriding Configuration

You can override configuration settings directly from the command line using the --override flag:

This command overrides the modelName setting for the specified request.

Generating Autocomplete Scripts

FluentCLI can generate autocomplete scripts for Bash and Fig.

Generating a Bash autocomplete script:

Generating a Fig autocomplete script:

Upserting Data

You can upsert data using the --upsert-no-upload or --upsert-with-upload flags.

Upserting without file upload:

Upserting with file upload:

Outputs and Formats

FluentCLI provides flexible output options to suit different use cases.

Default Output

By default, FluentCLI prints the response text to the terminal:

Markdown Output

To format the response in markdown, use the --markdown-output flag:

Example markdown output:

Extracting Code Blocks

To extract and display only the code blocks from the response, use the --parse-code-output flag:

Example extracted code:

Full JSON Output

To view the full JSON response, use the --full-output flag:

Example JSON output:

Integration with Other Tools

FluentCLI can be integrated with other tools and services to enhance your workflow.

Integrating with Scripts

You can use FluentCLI in shell scripts to automate tasks:

Piping Data

FluentCLI supports piping data to and from other commands:

Scheduling Tasks

You can use FluentCLI with cron to schedule tasks:

Examples

Here are some examples to help you get started with FluentCLI.

Example 1: Simple Request

Send a simple request to the "LocalGoogleGeminiChain" flow:

Example 2: Request with Context

Send a request with additional context:

Example 3: File Upload

Upload an image file as part of the request:

Example 4: Markdown Output

Get the response in markdown format:

Example 5: Extract Code Blocks

Extract and display only the code blocks:

Troubleshooting

If you encounter issues while using FluentCLI, this section provides some troubleshooting tips.

Common Issues

  • Invalid configuration file path: Ensure that the FLUENT_CLI_CONFIG_PATH environment variable is set correctly.

  • Missing dependencies: Ensure that all required dependencies are installed, including Rust.

  • Network issues: Check network connectivity and ensure that the specified host and port are accessible.

Debugging

Enable debug logging to get more detailed output:

Error Messages

If you encounter error messages, refer to the detailed error output and logs to diagnose the issue.

Appendix

JSON Configuration Example

Here is a complete example of a JSON configuration file:

Environment Variables

Here are the environment variables used in FluentCLI:

  • FLUENT_CLI_CONFIG_PATH: Path to the directory containing the configuration file.

  • RUST_LOG: Set to debug to enable debug logging.

This concludes the documentation for FluentCLI. We hope you find it helpful and informative. If you have any questions or need further assistance, please refer to the troubleshooting section or contact support. Used Tools:

Last updated