kamaludu/bash4llm: Bash-first wrapper for Groq’s OpenAI-compatible API. Secure, portable, Termux-friendly. · GitHub

logo 320

CLI
License: GPLv3
shellcheck
smoke test

Bash4LLM⁺ – Wrapper CLI Securo, bash-first and full auditability per l’API Chat Completion Compatible OpenAI de Groc (Estensible Ad Alter Provider).

Bash4LLM⁺ is a singolo script bash, auto‑contenuto, legal and verifiable.
Scaricallo, rendillo aseguibil, esporta la tua api key y inizia subito e usarlo.

Compatible with Unix environments: Linux, macOS, WSL, Cygwin, Termux (Android), BSD.


characteristic principle

  • Lista Modeli Dynamica
    tramite GET https://api.groq.com/openai/v1/models
    → Nessun Modelo Hardcoded.

  • Securezza by Design
    → Nessun uso di /tmpNessun evalPermesse restritivi, verification provider avanzata.

  • Struttura modular of a sezioni
    → precore_boot, precore_run, provider, core_setup, core_provider.

  • State UI System (ui_state)
    → Core Espeon content metadata in JSON format for integrating GUI or home assistant (e.g. Home Assistant).

  • Streaming and non-streaming
    → Output in tempo real meets a fine response.

  • salvetagio automatico
    → According to another configuration per output.

  • Gestione Modelli Avanzata
    → Refresh, Lista, Default Persistent, Whitelist Dynamica, Auto-Selection.

  • additional options
    → Provider addons (Gemini, Hugging Face, Mistral), templates, documentation, security tools.

  • prompt for termux/android
    → Ambient Termux bypass automatically released flock (a limiting condition of live kernel/SELinux on Android) and enforcing directory locks to ensure transparency (mkdir nuclear).


Modello di Minaccia (Version Brave)

Bash4LLM⁺ is single-user (PC/Laptop, server individual) per environment.

  • I provider sono code esseguito nella tua shell: devonno residere in directory secure di tua proprieta.
  • come variability BASH4LLM_EXTRAS_DIR E BASH4LLM_TMPDIR Consider configuration details.
  • Lo script non esgue my output del modello.
  • I limited TOCTOU to parsing JSON/SSE and limited documentation.

datagalley complete Security.


Bash4LLM⁺ Description Path to Seguenti Pacetti (or equivalent):

  • Bash
  • coreutils
  • findutils
  • util-linux
  • Idiot
  • curl
  • jq

tip

⏩ Go fast (Installazione rapida)

All it takes is one command to your terminal Bash4LLM⁺: :

# 1. Clona il repository (solo l'ultimo commit per massima velocità)
git clone --depth 1 --branch main https://github.com/kamaludu/bash4llm.git repo-bash4llm  

# 2. Crea una cartella di lavoro ed estrai l'eseguibile
mkdir -p bash4llm
cp repo-bash4llm/bin/bash4llm bash4llm/
chmod +x bash4llm/bash4llm

# 3. Entra nella cartella e aggiorna i modelli 
cd bash4llm 
./bash4llm --refresh-models

Get script to get the API for your default provider (grok):
Enter API key for provider groq (env GROQ_API_KEY):

After entering the API key, you can use it to retrieve it during the session:

export GROQ_API_KEY="gsk_xxxxxxxxxxxxxxxxx"

Counseling: install additional options: :

# 4. Installazione degli Extras
./bash4llm --install-extras ../repo-bash4llm/extras/

usa bash4lm

In Istruzioni Dattagliate: to install

In Brave:

chmod +x bash4llm
export GROQ_API_KEY="gsk_xxxxxxxxxxxxxxxxx"
./bash4llm --help

Additional Options:

./bash4llm --install-extras

Question:

  • --source
  • --force
  • --dry-run
  • Installation Selection:
    ./bash4llm --install-extras provider1 templateA

Quick Instructions:

./bash4llm "scrivi una breve poesia in italiano"

Prompt Multilinea:

./bash4llm <<'EOF'
scrivi una breve poesia
in italiano
EOF

File Input:

Pipe:

echo "spiegami la relatività" | ./bash4llm

Model Special:

./bash4llm -m llama-3.3-70b-versatile "scrivi un saggio breve"

Walkthrough:

./bash4llm --dry-run "ciao"

Install Provider (to install):

./bash4llm --provider gemini "traduci questo"

COMANDI, FLAG AND DISTRIBUTION DISTRIBUTION

flag arguments affetto
--refresh-models, --refresh-model No Update from model list (Rechid API key).
--list-models No Stampa lista modelli (interactivo format).
--list-models-raw No Stampa lista modelli in formato raw (una riga per modello).
--list-providers No Stampa Lista Provider.
--list-providers-raw No Stampa provider in raw format.
--set-default Yes Apply the default model as per your provider’s availability.
-m , --model Yes The ideal model for this job.
--provider Yes Imposta provider by CLI.
--provider No Senza argomento → apre selezione interativa.

Input (file, JSON, template, batch)

flag arguments affetto
-f Yes add file a FILE_INPUTS.
--json-input Yes Imposta input JSON (same format as OpenAI).
--template Yes application template da BASH4LLM_TEMPLATES_DIR.
--batch Yes Essay Richest Batch (Una riga=un prompt).

flag arguments affetto
--session Yes Qualification session for ID details.
--session-window [n] Option Imposta finestra session (non fornito by default 10).
--init-session C Initializa in securza una session vuota (file NDJSON e metadata) e la registrare nell’indice global delle sessioni, senza eftetuare chiamet api. Richiede l’uso congiunto di --session .

Parameter Model/Production

flag arguments affetto
--system Yes Imposta system prompt.
--ture Yes Imposta Parametro Temperature (DA 0.0 A 2.0, aka Canonico).
--temperature Yes nicknamed --ture.
--max Yes Imposta Max Token.

flag arguments affetto
--save No Forza Salvettagio output.
--nosave No Disability Salvetagio.
--out Yes percorso file/directory output.
--threshold Yes In automatic measurement per byte (default: 1000).
--json No Output JSON Raw Integro.
--pretty No Output JSON format.
--text No Output testual standard estrato (comportamento predefinito).
--raw No Output testual grazzo escludendo separazioni finale.

flag arguments affetto
--dry-run No Nesuna chiamata api reale (comportamento simulato).
--quiet No It is not necessary to get the output in the title of TTY.
--stream No Streaming asynchrono ativo.
--no-stream No Disattiva Streaming Asynchrono.
--chat No Model Chat Interactive REPL.
--bootstrap-only No Use a single legal lock/lock and terminus.

Configuration and Diagnostics

flag arguments affetto
--show-config No Most of the configuration is fully functional.
--diagnostics No Essay diagnostic complete system system.
--version No Stampa edition dello script and termina.
-h, --help No Most of the help helps with formatting the file.

flag arguments affetto
--install-extras Option Install Extra; You can get the directory directory.
--install-extras= Yes Establish specific directory collections.

flag affetto
-- Termina parsing options.
-* Answer: Sconociuta → Error.
* Argumento Positionale → Aggiunto A ARGS.


  • $BASH4LLM_CONFIG_DIR/config
    →Parameter Local (Model, ture, Max_tokens, Format, Threshold)

  • $BASH4LLM_CONFIG_DIR/model.$PROVIDER
    → Modelo predefined per provider

  • $MODELS_FILE
    → Whitelist Model Aggiornata Da --refresh-models

Precedenza Selezione Modelo

  1. -m/--model
  2. model.$PROVIDER
  3. Auto Select Provider (auto_select_model_)
  4. Prima Voice Della Whitelist (models.txt)
  5. Configure global inheritance config (MODEL=...)

  • I did not listen to him. /tmp A livelo di sistema operativo condiviso.
  • temporary separation file in directory $RUN_TMPDIR con permancy 700 (umask 077).
  • file salviati con permesse 600.
  • Thief --out Bash4LLM⁺ makes it possible to create directories.

Bash4LLM⁺ Espion Metadata Operative Destination A GUI/Strumenty Asterny Tramite File JSON Atomis In:

$BASH4LLM_CONFIG_DIR/ui_state

Inclusive:

  • sessions/.json → statoSession(active, message_count, last_ts)
  • sessions/index.json → Alenko Seshni
  • last_api.json → Final Result API (http_status, req_id, Edgecase_detected, etc.)
  • last_history.json → Final Salvatagio History
  • provider_capabilities.json → Capacita Provider Ativo (streaming, refresh_model)

LA GUI (additional options) single Question file as per placeholder CGI.


Bash4LLM⁺ Non Maintained Memorias Da Solo.
la memoria assiste Solo Se Attivi Una Session tramite --session.

Before creating a file NDJSON constants:

$BASH4LLM_HISTORY_DIR/sessions/.ndjson

Metadata of sessions in Bash4LLM⁺:

$BASH4LLM_CONFIG_DIR/ui_state/sessions/.json

This metadata font for GUI/Strumenti Esterni is Canonica.


🟩it was fixed --session

./bash4llm --session chat1 "Ciao"
./bash4llm --session chat1 "Riassumi ciò che ho detto"

🟩it was fixed --session-window

./bash4llm --session chat1 --session-window 10 "continua"

Per Ave Memoria Contest goddess semper insert --session .


  • Nessun eval.
  • Nesuna escuzione dell’output del modelo.
  • Provider = Kodis: Mantini extras/providers Securo.
  • Environment changes = configuration information.
  • TOCTOU MITIGATE.

Kodichi variable Importance
0 Successor
10 BASH4LLM_ERR_NO_API_KEY api key mancante
11 BASH4LLM_ERR_BAD_MODEL Model not valid or whitelisted
12 BASH4LLM_ERR_CURL_FAILED error ret/curl
14 BASH4LLM_ERR_NO_PROMPT nessun prompt fornito
15 BASH4LLM_ERR_TMP array generico filesystem/temporary
16 BASH4LLM_ERR_API Error in HTTP/API last year


variable Necessary Description
GROQ_API_KEY you are using api API key provider Grok.
BASH4LLM_CONFIG_DIR recommended Directory configuration.
BASH4LLM_MODELS_DIR recommended Directory model.
BASH4LLM_TMPDIR Yes Directory temporary.
BASH4LLM_HISTORY_DIR recommended Directory sessions and chronology.
MODEL No Modelo Ativo.
PROVIDER No Attention Providers.
ALLOWED_MODELS No Whitelist Modeli Amesse.


Bash4LLM⁺ distributes the GPL v3 license.
altar license.


Author: Christian Evangelisti
Email: opensource@cevangel.anonaddy.me
Repository: https://github.com/kamaludu/bash4llm



<a href

Leave a Comment