{"id":13837620,"url":"https://github.com/matdombrock/sllm","last_synced_at":"2025-04-11T05:31:07.736Z","repository":{"id":84933007,"uuid":"606393469","full_name":"matdombrock/sllm","owner":"matdombrock","description":"A command line interface for the OpenAI LLMs.","archived":false,"fork":false,"pushed_at":"2023-12-29T07:13:47.000Z","size":483,"stargazers_count":37,"open_issues_count":3,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-14T10:02:06.279Z","etag":null,"topics":["assistant","chatbot","chatgpt","cli","gpt3","openai"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/sllm","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matdombrock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-02-25T11:02:22.000Z","updated_at":"2024-05-30T06:29:07.584Z","dependencies_parsed_at":"2023-11-17T02:24:50.682Z","dependency_job_id":"5195cd95-a436-47ff-8a79-84f785678279","html_url":"https://github.com/matdombrock/sllm","commit_stats":{"total_commits":57,"total_committers":2,"mean_commits":28.5,"dds":"0.052631578947368474","last_synced_commit":"ccfff85259e92bd3e119d40e07a8bebaef34991b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matdombrock%2Fsllm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matdombrock%2Fsllm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matdombrock%2Fsllm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matdombrock%2Fsllm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matdombrock","download_url":"https://codeload.github.com/matdombrock/sllm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248347388,"owners_count":21088636,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["assistant","chatbot","chatgpt","cli","gpt3","openai"],"created_at":"2024-08-04T15:01:17.332Z","updated_at":"2025-04-11T05:31:07.424Z","avatar_url":"https://github.com/matdombrock.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# SLLM - Command Line ChatGPT-like Assistant\nA command line interface for the OpenAI Large Language Models that emulates some features of ChatGPT. \n\n**UPDATE: GPT4 Support is Here!**\n\n*Note: This project has recently been updated to default to the GPT3.5-Turbo Model. You can access other models (**including GPT4**) with the `--model` option.*\n\n![screenshot](.docs/sllm-ss.png)\n\nIn addition to providing a simple interface for talking with GPT, this tool also offers a few extra features built on top of the GPT APIs. \n\n### Extra Features:\n- Act as a chat bot (emulates chatGPT)\n- Read local files\n- Automatically prepend subject domains \u0026 context (Bash, JS, Physics etc.)\n- Expert Mode (act as an expert on some subject)\n- Explain it like I'm 5 (explain the answer simply)\n\n### Why Not Use ChatGPT?\nYou can do whatever you want :)\n\nI made this for the following reasons:\n\n- Access LLMs without leaving the command line\n- Access LLMs without logging in to OpenAI (use a token instead)\n- Directly read and write local files\n- I don't always have easy access to a GUI\n\n\u003e $ sllm what would be the advantage of talking to a LLM via the command line?\n\u003e \n\u003e The advantage of talking to a LLM via the command line is that it allows for a more efficient and direct way of communicating. It also allows for more precise and specific commands to be used, which can help to quickly get the desired results.\n\n---\n\n### Example Usage:\n\n\u003e $ sllm what can be used to check the status of a running systemd service? -e bash scripting\n\u003e \n\u003e The command to check the status of a running systemd service is \"systemctl status \u003cservice_name\u003e\".\n\u003e \n\u003e \n\u003e $ sllm how can I get the full log instead? -d bash -H 1\n\u003e \n\u003e To get the full log of a running systemd service, you can use the command \"journalctl -u \u003cservice_name\u003e\".\n\n\n## Install\n\n```\nnpm install -g sllm\n```\n\n## Setup\n\nGet an OpenAI [API KEY](https://platform.openai.com/account/api-keys).\n\n```\nexport OPENAI_API_KEY=\u003cyour_api_key\u003e\n```\n\n## Quick Start\n\n```\n$ sllm how many people live in china? \n\nAccording to the latest estimates, there are approximately 1.4 billion people living in China.\n```\n\n## Chat Mode\nTo enable a \"chat mode\" similar to chatGPT, run the following command:\n\n```\nsllm .settings -H 3\n```\n\nThis will remind the LLM about the last 3 prompts it was given. \n\n## Overview\n```\n$ sllm --help\nUsage: sllm [options] [command]\n\n\n         ____    \n    ___ / / /_ _ \n   (_-\u003c/ / /  ' \\\n  /___/_/_/_/_/_/\n\nCLI for OpenAI Large Language Models. v2.0.6\nCreated by Mathieu Dombrock 2023. GPL3 License.\n\n\nOptions:\n  -V, --version                  output the version number\n  -h, --help                     display help for command\n\nCommands:\n  .help                          show sllm help\n  .prompt [options] \u003cprompt...\u003e  send a prompt (default command)\n  .settings [options]            set a persistent command option\n  .settings-view                 view the current settings that were changed via the `settings` command\n  .settings-purge                purge the current settings that were changed via the `settings` command\n  .history-view [options]        view the conversation history\n  .history-purge [options]       view the conversation history\n  .history-undo [options]        undo the conversation history\n  .purge                         delete all history and settings\n  .count [options]               estimate the tokens used by a prompt or file\n  .repeat                        repeat the last response\n  .models                        list the available models\n\nNote: All commands are prefixed with \".\" to avoid conflicting with prompts!\n```\n\n## Available Models\n\n```\n$ sllm models\n\nAvailable Models:\n-------\ntext-davinci-002\n-------\ntext-davinci-003\nalias: gpt3\n-------\ngpt-3.5-turbo\nalias: gpt3t\n-------\ngpt-4\nalias: gpt4\nbeta: might require special access!\n-------\ngpt-4-32k\nalias: gpt4b\nbeta: might require special access!\n-------\ncode-davinci-002\nbeta: might require special access!\n///////\nYou can specify a model with the -m option\nMore info: https://platform.openai.com/docs/models/\n```\n\n## Prompt\n\n```\n$ sllm .prompt --help\nUsage: sllm .prompt [options] \u003cprompt...\u003e\n\nsend a prompt (default command)\n\nArguments:\n  prompt                      the prompt text\n\nOptions:\n  -v, --verbose               verbose output\n  -x, --max-tokens \u003cnumber\u003e   maximum tokens to use in response (default: \"256\")\n  -X, --unlimited             do not limit tokens used in response\n  -t, --temperature \u003cnumber\u003e  temperature to use (default: \"0.2\")\n  -c, --context \u003cstring...\u003e   context to prepend\n  -d, --domain \u003cstring...\u003e    subject domain to prepend\n  -e, --expert \u003cstring...\u003e    act as an expert on this domain\n  -C, --code \u003clanguage\u003e       respond only with executable code (default: \"JavaScript\")\n  -5, --like-im-five          explain it like I'm 5 years old\n  -H, --history \u003cnumber\u003e      prepend history (chatGPT mode)\n  -f, --file \u003cpath\u003e           prepend the given file contents\n  -T, --trim                  automatically trim the given file contents\n  -m, --model \u003cmodel-name\u003e    specify the model name (default: \"gpt-3.5-turbo\")\n  --mock                      dont actually send the prompt to the API\n  -h, --help                  display help for command\n```\n\n## Working With Files\n\nYou can prepend a reference to a file with the `-f` or `--file` option.\n\nHowever, be aware that files can not exceed 4k tokens. To the best of my knowledge, there is no way to get the GPT3 API to process more than 4096 tokens at once which means that this is a hard limitation and it would not be possible to get a meaningful analysis of a file that exceeds 4k tokens. \n\n**NOTE: At the time of writing, sending a file that contains 4k tokens would cost about $0.08 (USD). See [OpenAI Pricing](https://openai.com/pricing) for more info.**\n\n### Trimming Files to Save Tokens\nIf your files are too large or you simply want to save a few tokens, you can try adding the `--trim` flag when loading a file. This command will attempt to remove all white spaces, tabs and new lines from the file. This might confuse the LLM so it's typically better to avoid this option unless needed. \n\nDepending on the type of file you want to analyze, you might also try minifying the file before running it through sllm. \n\n### File Examples:\n```\n$ sllm write a summary of this file -f sllm.js\n\n  This file is a Node.js script that provides a command line interface (CLI) for interacting with OpenAI's GPT-3 API.\n\n$ sllm what dependencies does this have -f ./package.json\n\n This package.json file has two dependencies: gpt-3-encoder and openai.\n\n$ sllm what version of npm is this file built for? -f ./package.json\n\n  This package.json file is built for npm version 6.14.4 or higher.\n\n$ cat example.js\n\n  const e = require('./llm.js');\n  console.log(e);\n\n$ sllm is this file NodeJS or Browser JS? -f example.js\n\n  This file is Node.js.\n\n$ sllm why do you say that? -H 1\n\n  This file contains code that is specific to Node.js, such as the require statement, which is not supported in browser JavaScript.\n\n$ sllm what is this file about? -f mute.cpp\n  This file is about demonstrating the differences between mutating a value by reference, by pointer, and not mutating it at all. It contains three functions, noMute, muteR, and muteP, which respectively do not mutate the value, mutate the value by reference, and mutate the value by pointer. There is also a print function to output the results of the functions.\n\n$ sllm what is this file about? -f cfg.txt\n  This file is about creating a GIF animation of Conway's Game of Life using the .sorg settings. The animation will have a file name of \"life\", a frame delay of 1, 512 frames to render, 0 generations to run before render, a canvas width of 64, a canvas height of 64, a pixel/image scale of 8, a gif color pallet of lime, and a rule set of dtsd. Additionally, the .sorg settings include a file to load of \"noise\", a center of 0, an x offset of 1, and a y offset of 1.\n```\n\n## Counting Tokens\n\nIf you want to estimate how many tokens a prompt or file will consume, you can use the `sllm count` command.\n\n```\n$ sllm .count --help\n\nUsage: sllm .count [options]\n\nestimate the tokens used by a prompt or file\n\nOptions:\n  -p, --prompt \u003cstring...\u003e  the prompt string to check\n  -f, --file \u003cpath\u003e         the file path to check\n  -h, --help                display help for command\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatdombrock%2Fsllm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatdombrock%2Fsllm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatdombrock%2Fsllm/lists"}