Giter VIP home page Giter VIP logo

njfio / fluent_cli Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 2.16 MB

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

Home Page: https://fluentcli.com

License: Apache License 2.0

Rust 65.70% Shell 20.48% PowerShell 2.74% Batchfile 4.56% TypeScript 6.52%
ai anthropic automation cli flowise-ai gemini generation groqapi langchain llama3 llamaindex llm make openai rag rust workflow zapier langflow

fluent_cli's Introduction

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

fluent_cli's People

Contributors

njfio avatar

Stargazers

 avatar  avatar  avatar Ben Geyer avatar  avatar

Watchers

 avatar

fluent_cli's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.