{"id":50674009,"url":"https://github.com/parakeet-nest/parakeet4shell","last_synced_at":"2026-06-08T14:04:02.533Z","repository":{"id":239403339,"uuid":"799078436","full_name":"parakeet-nest/parakeet4shell","owner":"parakeet-nest","description":"🦜🪺 🐚 Parakeet4Shell is a set of scripts, made to simplify the development of small Bash generative AI applications with Ollama 🦙.","archived":false,"fork":false,"pushed_at":"2024-08-11T13:21:41.000Z","size":29,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-08-11T14:38:24.229Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parakeet-nest.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-11T05:58:59.000Z","updated_at":"2024-08-11T13:21:44.000Z","dependencies_parsed_at":"2024-06-01T09:45:10.733Z","dependency_job_id":null,"html_url":"https://github.com/parakeet-nest/parakeet4shell","commit_stats":null,"previous_names":["parakeet-nest/parakeet4shell"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/parakeet-nest/parakeet4shell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parakeet-nest%2Fparakeet4shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parakeet-nest%2Fparakeet4shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parakeet-nest%2Fparakeet4shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parakeet-nest%2Fparakeet4shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parakeet-nest","download_url":"https://codeload.github.com/parakeet-nest/parakeet4shell/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parakeet-nest%2Fparakeet4shell/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34065358,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-08T14:04:01.747Z","updated_at":"2026-06-08T14:04:02.525Z","avatar_url":"https://github.com/parakeet-nest.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Parakeet4Shell\n\n🦜🪺🐚 **Parakeet4Shell** is a set of scripts, made to simplify the development of small **Bash** generative AI applications with **Ollama** 🦙.\n\n## Requirements\n\n- Linux (right now, it's just tested on Ubuntu but it should work on MacOS - 🚧 wip)\n- jq (https://stedolan.github.io/jq/) - optional but useful\n- curl (https://curl.se/)\n- awk\n- bc\n\n## How to use\n\nAdd this at the beginning of your script:\n\n```bash\n. \"./lib/parakeet.sh\"\n```\n\n\u003e Let's have a look to the `example` folder.\n\n### Chat completion without streaming\n\n```bash\n#!/bin/bash\n. \"./lib/parakeet.sh\"\n\nOLLAMA_URL=${OLLAMA_URL:-http://localhost:11434}\n\nMODEL=\"tinyllama\"\n\nread -r -d '' SYSTEM_CONTENT \u003c\u003c- EOM\nYou are an expert of the StarTrek universe. \nYour name is Seven of Nine.\nSpeak like a Borg.\nEOM\n\nread -r -d '' USER_CONTENT \u003c\u003c- EOM\nWho is Jean-Luc Picard?\nEOM\n\nSYSTEM_CONTENT=$(Sanitize \"${SYSTEM_CONTENT}\")\nUSER_CONTENT=$(Sanitize \"${USER_CONTENT}\")\n\nread -r -d '' DATA \u003c\u003c- EOM\n{\n  \"model\":\"${MODEL}\",\n  \"options\": {\n    \"temperature\": 0.5,\n    \"repeat_last_n\": 2\n  },\n  \"messages\": [\n    {\"role\":\"system\", \"content\": \"${SYSTEM_CONTENT}\"},\n    {\"role\":\"user\", \"content\": \"${USER_CONTENT}\"}\n  ],\n  \"stream\": false,\n  \"raw\": false\n}\nEOM\n\njsonResult=$(Chat \"${OLLAMA_URL}\" \"${DATA}\")\n\nmessageContent=$(echo \"${jsonResult}\" | jq '.message.content')\n\necho \"${messageContent}\" \n```\n\n### Chat completion with streaming\n\n```bash\n#!/bin/bash\n. \"./lib/parakeet.sh\"\n\nOLLAMA_URL=${OLLAMA_URL:-http://localhost:11434}\n\nMODEL=\"tinyllama\"\n\n# System instructions\nread -r -d '' SYSTEM_CONTENT \u003c\u003c- EOM\nYou are an expert of the StarTrek universe. \nYour name is Seven of Nine.\nSpeak like a Borg.\nEOM\n\n# User message\nread -r -d '' USER_CONTENT \u003c\u003c- EOM\nWho is Jean-Luc Picard?\nEOM\n\nSYSTEM_CONTENT=$(Sanitize \"${SYSTEM_CONTENT}\")\nUSER_CONTENT=$(Sanitize \"${USER_CONTENT}\")\n\n# Payload to send to Ollama\nread -r -d '' DATA \u003c\u003c- EOM\n{\n  \"model\":\"${MODEL}\",\n  \"options\": {\n    \"temperature\": 0.5,\n    \"repeat_last_n\": 2\n  },\n  \"messages\": [\n    {\"role\":\"system\", \"content\": \"${SYSTEM_CONTENT}\"},\n    {\"role\":\"user\", \"content\": \"${USER_CONTENT}\"}\n  ],\n  \"stream\": true\n}\nEOM\n\n# This function will be called for each chunk of the response\nfunction onChunk() {\n  chunk=$1\n  data=$(echo ${chunk} | jq -r '.message.content')\n  echo -n \"${data}\"\n}\n\nChatStream \"${OLLAMA_URL}\" \"${DATA}\" onChunk\n```\n\n## Acknowledgments:\n\n- Thanks to [Sylvain](https://github.com/swallez) for the discussion on curl callbacks.\n- Thanks to [Gemini](https://gemini.google.com/app) for all the discussions on Bash.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparakeet-nest%2Fparakeet4shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparakeet-nest%2Fparakeet4shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparakeet-nest%2Fparakeet4shell/lists"}