Skip to content

Fluent CLI is an advanced command-line interface designed to interact seamlessly with multiple workflow systems like FlowiseAI, Langflow, Make, and Zapier. Tailored for developers and IT professionals, Fluent CLI facilitates robust automation, simplifies complex interactions, and enhances productivity through a powerful and command suite

License

njfio/fluent_cli

Repository files navigation

fluent_logo

FluentCLI

fluent

Fluent CLI is a command-line interface (CLI) tool designed to simplify interaction with various workflow engines, including FlowiseAI, Langflow, and custom webhooks. It provides a streamlined way to send requests, manage configurations, and handle responses, making it easier to integrate AI workflows into your projects.

Features

  • Multi-Engine Support: Interact with FlowiseAI, Langflow, and Webhook workflows seamlessly.
  • Simplified Request Handling: Send requests to your workflows with a simple command structure.
  • Context Management: Provide additional context via stdin or files for richer interactions.
  • Configuration Management: Load and modify workflow configurations from a centralized JSON file.
  • Environment Variable Integration: Securely store sensitive information like API keys in environment variables and reference them in your configurations.
  • System Prompt Override: Easily override system messages for greater control over your workflows.
  • File Upload: Upload images and other files to your workflows.
  • Upsert Functionality: Send JSON payloads and upload files to endpoints for data management.
  • Output Customization: Control output format, including stylized markdown, parsed code blocks, and full JSON responses.
  • Media Download: Download media files linked in responses directly from the CLI.
  • Autocomplete Generation: Generate Bash and Fig autocomplete scripts for enhanced usability.
  • Amber Integration: Securely decrypt and manage sensitive keys using the Amber secrets management tool.

Installation

From Source

  1. Ensure you have Rust and Cargo installed.
  2. Clone this repository: git clone https://github.com/njfio/fluent_cli.git
  3. Navigate to the project directory: cd fluent_cli
  4. Build the project: cargo build --release
  5. The executable will be located in target/release/fluent.

Pre-built Binaries

Pre-built binaries for various platforms are available in the Releases section of this repository.

Configuration

Fluent CLI uses a config.json file to store workflow configurations. A sample configuration file is provided in the repository. You can customize this file to include your own workflows and settings.

Structure

[
  {
    "name": "FlowName",
    "engine": "flowise|langflow|webhook",
    "protocol": "http|https",
    "hostname": "your-hostname",
    "port": 80|443,
    "chat_id": "your-chat-id",
    "request_path": "/api/v1/prediction/",
    "upsert_path": "/api/v1/vector/upsert/", // Optional, for upsert functionality
    "sessionId": "your-session-id",
    "bearer_token": "your-bearer-token",
    "overrideConfig": {}, // Workflow-specific overrides
    "tweaks": {}, // Workflow-specific tweaks
    "timeout_ms": 50000 
  },
  // ... more workflows
]

Explanation:

  • name: A unique name for your workflow.
  • engine: The type of workflow engine (flowise, langflow, webhook).
  • protocol, hostname, port, chat_id, request_path: Connection details for your workflow.
  • upsert_path: (Optional) The path for upsert requests.
  • sessionId: The session ID for your workflow (if applicable).
  • bearer_token: The authentication token for your workflow.
  • overrideConfig: A JSON object containing workflow-specific configuration overrides.
  • tweaks: A JSON object containing workflow-specific tweaks.
  • timeout_ms: The request timeout in milliseconds.

Notes:

  • You can use environment variables in your configuration by prefixing the variable name with AMBER_. For example, to use the environment variable MY_API_KEY in your bearer token, set bearer_token to AMBER_MY_API_KEY.
  • Fluent CLI will automatically attempt to decrypt keys starting with AMBER_ using the Amber secrets management tool.

Usage

Basic Requests

To send a request to a workflow, use the following command:

fluent <flowname> "<request>"

Example:

fluent MyFlow "What is the weather like today?"

Context

You can provide additional context to your request through stdin or a file:

Stdin:

echo "Here is some context." | fluent MyFlow "What is the weather like today?"

File:

fluent MyFlow "What is the weather like today?" --context "context.txt"

System Prompt Override

To override the system message of a Flowise workflow, use the following options:

Inline:

fluent MyFlow "What is the weather like today?" --system-prompt-override-inline "You are a helpful weather bot."

File:

fluent MyFlow "What is the weather like today?" --system-prompt-override-file "system_prompt.txt"

File Upload

To upload an image to a workflow, use the --upload-image-path option:

fluent MyFlow "Describe this image." --upload-image-path "image.png"

Upsert

With Upload:

fluent MyFlow --upsert-with-upload "file1.txt,file2.csv"

Without Upload:

fluent MyFlow --upsert-no-upload

Output Customization

Markdown:

fluent MyFlow "What is the weather like today?" --markdown-output

Parsed Code Blocks:

fluent MyFlow "Generate some Python code." --parse-code-output

Full JSON Output:

fluent MyFlow "What is the weather like today?" --full-output

Media Download

fluent MyFlow "Find me some images of cats." --download-media "/path/to/directory"

Autocomplete Generation

Bash:

fluent --generate-autocomplete > fluent_autocomplete.sh
source fluent_autocomplete.sh

Fig:

fluent --generate-fig-autocomplete > fluent.ts

Override Configuration Values

fluent MyFlow "What is the weather like today?" --override modelName="gpt-4" --override tweaks.Prompt-PbKIE.template="You are a helpful pirate."

Contributing

Contributions to Fluent CLI are welcome! Please open an issue or submit a pull request if you have any suggestions, bug reports, or feature requests.

License

Fluent CLI is licensed under the MIT License.

Nicholas Ferguson - [email protected]

Project Link: https://github.com/njfio/fluent-cli

About

Fluent CLI is an advanced command-line interface designed to interact seamlessly with multiple workflow systems like FlowiseAI, Langflow, Make, and Zapier. Tailored for developers and IT professionals, Fluent CLI facilitates robust automation, simplifies complex interactions, and enhances productivity through a powerful and command suite

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published