Skip to main content

Add your description here

Project description

Fid

Python versions Python versions PyPI Status PyPI Status

AI for the command line, built for pipelines.

Fid brings Large Language Models (LLMs) directly to your terminal. It can take command output, process it with AI, and return results in formats like Markdown, JSON, or plain text. Think of it as a lightweight way to make your command-line workflows smarter with just a touch of AI.

You can also use OpenAI, Cohere, Groq, or Azure OpenAI.

Installation

uv pip install fid

What Can It Do?

Fid reads from standard input and pairs it with a prompt you provide via command-line arguments. That input is then sent to an LLM, which generates an answer, formatted in Markdown.

You can configure models in your settings file by running fid --settings.

Examples

1. Summarize logs

cat /var/log/syslog | fid summarize the key errors

2. Shell commands

fid explain "ls -lh /etc"

3. Get one-liner shell fixes (using a custom role)

fid --role shell find all .py files modified in the last 24 hours

Usage

  • -m, --model: Specify Large Language Model to use
  • --role: Specify the role to use (See custom roles)
  • --list-roles: List the roles defined in configuration
  • --settings: Open settings
  • --dirs: Print directories where config is stored
  • --reset-settings: Restore settings to default
  • --version: Show version

Custom Roles

Roles allow you to set system prompts. Here is an example of a shell role:

roles:
  shell:
    - you are a shell expert
    - you do not explain anything
    - you simply output one liners to solve the problems you're asked
    - you do not provide any explanation whatsoever, ONLY the command

Then, use the custom role in fid:

fid --role shell list files in the current directory

Setup

Gemini

Fid uses gemini-2.0-flash by default.

Set the GOOGLE_API_KEY enviroment variable. If you don't have one yet, you can get it from the Google AI Studio.

Open AI

Set the OPENAI_API_KEY environment variable. If you don't have one yet, you can grab it the OpenAI website.

Alternatively, set the [AZURE_OPENAI_KEY] environment variable to use Azure OpenAI. Grab a key from Azure.

Cohere

Cohere provides enterprise optimized models.

Set the COHERE_API_KEY environment variable. If you don't have one yet, you can get it from the Cohere dashboard.

Groq

Groq provides models powered by their LPU inference engine.

Set the GROQ_API_KEY environment variable. If you don't have one yet, you can get it from the Groq console.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fid-0.1.2.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fid-0.1.2-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file fid-0.1.2.tar.gz.

File metadata

  • Download URL: fid-0.1.2.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for fid-0.1.2.tar.gz
Algorithm Hash digest
SHA256 81da5b7540dcf4653e8c2b7ca95058b3ed7d4970f1a81a91792ca6b868e1758e
MD5 629ce9fac3f8a99952ae850789ef53db
BLAKE2b-256 b460a2c90a1da0d7dab570c91dd272e8459d085f63f9e9cfc92f47913dd038c4

See more details on using hashes here.

File details

Details for the file fid-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: fid-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for fid-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 79a8272101635745fe2115094f41d89a5a37a33db5071fe5535a2b5105c396a0
MD5 23216c87b35e218ead0b0cef721c26c9
BLAKE2b-256 6df3147af63f3d4f4b8ee03d24b13f8536d3c4446c75fec4be1a242ecced34b1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page