typo fix
Some checks failed
Docker Build and Push / build-and-push (push) Has been cancelled
Tests / test (bash) (push) Has been cancelled
Tests / test (zsh) (push) Has been cancelled
Tests / lint (push) Has been cancelled
Tests / docker (push) Has been cancelled

This commit is contained in:
2025-12-02 09:16:22 +01:00
parent 08b76124e2
commit d17fcf3049
16 changed files with 110 additions and 110 deletions

View File

@@ -23,7 +23,7 @@ jobs:
sudo apt-get install -y bash zsh curl jq bc bash-completion bats sudo apt-get install -y bash zsh curl jq bc bash-completion bats
- name: Make script executable - name: Make script executable
run: chmod +x finishte.sh run: chmod +x inish .sh
- name: Run BATS tests - name: Run BATS tests
run: | run: |
@@ -37,8 +37,8 @@ jobs:
run: | run: |
export HOME=$PWD/test-home export HOME=$PWD/test-home
mkdir -p $HOME/.local/bin mkdir -p $HOME/.local/bin
cp finishte.sh $HOME/.local/bin/finishte cp inish .sh $HOME/.local/bin/inish
chmod +x $HOME/.local/bin/finishte chmod +x $HOME/.local/bin/inish
$HOME/.local/bin/finish --help $HOME/.local/bin/finish --help
lint: lint:
@@ -52,7 +52,7 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y shellcheck run: sudo apt-get update && sudo apt-get install -y shellcheck
- name: Run shellcheck - name: Run shellcheck
run: shellcheck finishte.sh docs/install.sh || true run: shellcheck inish .sh docs/install.sh || true
docker: docker:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@@ -1,4 +1,4 @@
# finishte.sh Docker Image # inish .sh Docker Image
FROM ubuntu:22.04 FROM ubuntu:22.04
LABEL maintainer="finish contributors" LABEL maintainer="finish contributors"

View File

@@ -1,10 +1,10 @@
# Publishing Guide for finishte.sh # Publishing Guide for inish .sh
This guide explains how to publish and distribute finishte.sh through various channels. This guide explains how to publish and distribute inish .sh through various channels.
## Overview ## Overview
finishte.sh can be distributed through multiple channels: inish .sh can be distributed through multiple channels:
1. **Direct installation script** - One-line curl install 1. **Direct installation script** - One-line curl install
2. **Debian/Ubuntu packages** - APT repository 2. **Debian/Ubuntu packages** - APT repository
3. **Homebrew** - macOS package manager 3. **Homebrew** - macOS package manager
@@ -22,7 +22,7 @@ Before publishing, ensure:
## Version Management ## Version Management
Update version numbers in these files: Update version numbers in these files:
1. `finishte.sh` - Line 34: `export ACSH_VERSION=0.5.0` 1. `inish .sh` - Line 34: `export ACSH_VERSION=0.5.0`
2. `debian/changelog` - Add new entry 2. `debian/changelog` - Add new entry
3. `homebrew/finish.rb` - Line 6: `version "0.5.0"` 3. `homebrew/finish.rb` - Line 6: `version "0.5.0"`
4. `docs/install.sh` - Line 7: `ACSH_VERSION="v0.5.0"` 4. `docs/install.sh` - Line 7: `ACSH_VERSION="v0.5.0"`
@@ -102,12 +102,12 @@ sudo apt-get install finish
2. Create `apt-repo/conf/distributions`: 2. Create `apt-repo/conf/distributions`:
``` ```
Origin: finishte.sh Origin: inish .sh
Label: finish Label: finish
Codename: stable Codename: stable
Architectures: all Architectures: all
Components: main Components: main
Description: APT repository for finishte.sh Description: APT repository for inish .sh
``` ```
3. Add packages: 3. Add packages:
@@ -221,7 +221,7 @@ The `.github/workflows/release.yml` workflow automatically:
2. Create release on GitHub: 2. Create release on GitHub:
- Go to Releases → Draft a new release - Go to Releases → Draft a new release
- Tag: `v0.5.0` - Tag: `v0.5.0`
- Title: `finishte.sh v0.5.0` - Title: `inish .sh v0.5.0`
- Upload: tarball and .deb file - Upload: tarball and .deb file
- Write release notes - Write release notes

View File

@@ -1,4 +1,4 @@
# finishte.sh # inish .sh
Command-line completion powered by local LLMs. Press `Tab` twice and get intelligent suggestions based on your terminal context. Command-line completion powered by local LLMs. Press `Tab` twice and get intelligent suggestions based on your terminal context.
@@ -25,7 +25,7 @@ See [Installation](#installation) below for package managers, Docker, and more o
## What It Does ## What It Does
finishte.sh enhances your terminal with context-aware command suggestions. It analyzes: inish .sh enhances your terminal with context-aware command suggestions. It analyzes:
- Current directory and recent files - Current directory and recent files
- Command history - Command history
@@ -129,7 +129,7 @@ source ~/.bashrc
### Docker ### Docker
Run finishte.sh in a container: Run inish .sh in a container:
```bash ```bash
# Build the image # Build the image
@@ -173,16 +173,16 @@ source ~/.bashrc
## Directory Structure ## Directory Structure
``` ```
~/.finishte/ ~/.inish /
├── config # Configuration file ├── config # Configuration file
├── finishte.log # Usage log ├── inish .log # Usage log
└── cache/ # Cached completions └── cache/ # Cached completions
``` ```
## Commands ## Commands
```bash ```bash
finish install # Set up finishte finish install # Set up inish
finish remove # Uninstall finish remove # Uninstall
finish config # Show/edit configuration finish config # Show/edit configuration
finish model # Select model finish model # Select model
@@ -201,7 +201,7 @@ Currently supports:
- **LM-Studio** (default) - Local models via OpenAI-compatible API - **LM-Studio** (default) - Local models via OpenAI-compatible API
- **Ollama** - Local models via Ollama API - **Ollama** - Local models via Ollama API
Add custom providers by editing `finishte.sh` and adding entries to `_finishte_modellist`. Add custom providers by editing `inish .sh` and adding entries to `_inish _modellist`.
## Development ## Development
@@ -212,7 +212,7 @@ Clone and link for development:
```bash ```bash
git clone https://git.appmodel.nl/Tour/finish.git finish git clone https://git.appmodel.nl/Tour/finish.git finish
cd finish cd finish
ln -s $PWD/finishte.sh $HOME/.local/bin/finish ln -s $PWD/inish .sh $HOME/.local/bin/finish
finish install finish install
``` ```
@@ -262,7 +262,7 @@ docker-compose build
### Creating a Release ### Creating a Release
1. Update version in `finishte.sh` (ACSH_VERSION) 1. Update version in `inish .sh` (ACSH_VERSION)
2. Update version in `debian/changelog` 2. Update version in `debian/changelog`
3. Update version in `homebrew/finish.rb` 3. Update version in `homebrew/finish.rb`
4. Create and push a git tag: 4. Create and push a git tag:

View File

@@ -1,6 +1,6 @@
# Publication Setup Summary # Publication Setup Summary
This document summarizes the publication setup completed for finishte.sh. This document summarizes the publication setup completed for inish .sh.
## Files Created ## Files Created
@@ -82,7 +82,7 @@ docker run -it ghcr.io/closedloop-technologies/finish:latest
```bash ```bash
git clone https://git.appmodel.nl/Tour/finish.git git clone https://git.appmodel.nl/Tour/finish.git
cd finish cd finish
./finishte.sh install ./inish .sh install
``` ```
## Next Steps ## Next Steps
@@ -102,7 +102,7 @@ cd finish
### For First Release ### For First Release
1. **Update version numbers** in: 1. **Update version numbers** in:
- `finishte.sh` (line 34) - `inish .sh` (line 34)
- `debian/changelog` - `debian/changelog`
- `homebrew/finish.rb` - `homebrew/finish.rb`
- `docs/install.sh` - `docs/install.sh`

View File

@@ -2,7 +2,7 @@
## Installation ## Installation
Install and set up finishte: Install and set up inish :
```bash ```bash
finish install finish install
@@ -105,7 +105,7 @@ Remove finish completely:
finish remove finish remove
``` ```
## Using finishte ## Using inish
Once enabled, just type a command and press `Tab` twice to get suggestions: Once enabled, just type a command and press `Tab` twice to get suggestions:
@@ -125,7 +125,7 @@ Natural language also works:
## Configuration File ## Configuration File
The config file is located at `~/.finishte/config` and contains: The config file is located at `~/.inish /config` and contains:
- `provider`: Model provider (lmstudio, ollama) - `provider`: Model provider (lmstudio, ollama)
- `model`: Model name - `model`: Model name

2
debian/changelog vendored
View File

@@ -7,4 +7,4 @@ finish (0.5.0-1) stable; urgency=medium
* Intelligent caching system * Intelligent caching system
* Privacy-focused local operation * Privacy-focused local operation
-- finishte.sh Contributors <noreply@finishte.sh> Mon, 02 Dec 2024 12:00:00 +0000 -- inish .sh Contributors <noreply@inish .sh> Mon, 02 Dec 2024 12:00:00 +0000

4
debian/control vendored
View File

@@ -1,7 +1,7 @@
Source: finish Source: finish
Section: utils Section: utils
Priority: optional Priority: optional
Maintainer: finishte.sh Contributors <noreply@finishte.sh> Maintainer: inish .sh Contributors <noreply@inish .sh>
Build-Depends: debhelper (>= 10) Build-Depends: debhelper (>= 10)
Standards-Version: 4.5.0 Standards-Version: 4.5.0
Homepage: https://git.appmodel.nl/Tour/finish/finish Homepage: https://git.appmodel.nl/Tour/finish/finish
@@ -12,7 +12,7 @@ Architecture: all
Depends: bash (>= 4.0) | zsh (>= 5.0), curl, jq, bc, bash-completion Depends: bash (>= 4.0) | zsh (>= 5.0), curl, jq, bc, bash-completion
Recommends: lm-studio | ollama Recommends: lm-studio | ollama
Description: LLM-powered command-line finishtion Description: LLM-powered command-line finishtion
finishte.sh enhances your terminal with context-aware command suggestions inish .sh enhances your terminal with context-aware command suggestions
using local large language models. Features include: using local large language models. Features include:
. .
* Local-first operation with LM-Studio or Ollama * Local-first operation with LM-Studio or Ollama

2
debian/copyright vendored
View File

@@ -4,7 +4,7 @@ Upstream-Contact: https://git.appmodel.nl/Tour/finish/finish
Source: https://git.appmodel.nl/Tour/finish Source: https://git.appmodel.nl/Tour/finish
Files: * Files: *
Copyright: 2024-2025 finishte.sh Contributors Copyright: 2024-2025 inish .sh Contributors
License: BSD-2-Clause License: BSD-2-Clause
License: BSD-2-Clause License: BSD-2-Clause

2
debian/postinst vendored
View File

@@ -3,7 +3,7 @@ set -e
case "$1" in case "$1" in
configure) configure)
echo "finishte.sh has been installed successfully!" echo "inish .sh has been installed successfully!"
echo "" echo ""
echo "To complete setup, run:" echo "To complete setup, run:"
echo " finish install" echo " finish install"

2
debian/rules vendored
View File

@@ -8,7 +8,7 @@
dh $@ dh $@
override_dh_auto_install: override_dh_auto_install:
install -D -m 0755 finishte.sh $(CURDIR)/debian/finish/usr/bin/finishte install -D -m 0755 inish .sh $(CURDIR)/debian/finish/usr/bin/inish
install -D -m 0644 LICENSE $(CURDIR)/debian/finish/usr/share/doc/finish/copyright install -D -m 0644 LICENSE $(CURDIR)/debian/finish/usr/share/doc/finish/copyright
install -D -m 0644 README.md $(CURDIR)/debian/finish/usr/share/doc/finish/README.md install -D -m 0644 README.md $(CURDIR)/debian/finish/usr/share/doc/finish/README.md

View File

@@ -1 +1 @@
finishte inish

View File

@@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
# finishte.sh installer # inish .sh installer
# Usage: curl -sSL https://git.appmodel.nl/Tour/finish/raw/branch/main/docs/install.sh | bash # Usage: curl -sSL https://git.appmodel.nl/Tour/finish/raw/branch/main/docs/install.sh | bash
set -e set -e
@@ -88,7 +88,7 @@ download_file() {
# Main installation # Main installation
main() { main() {
echo_green "==========================================" echo_green "=========================================="
echo_green " finishte.sh Installation" echo_green " inish .sh Installation"
echo_green " Version: $ACSH_VERSION" echo_green " Version: $ACSH_VERSION"
echo_green "==========================================" echo_green "=========================================="
echo "" echo ""
@@ -97,11 +97,11 @@ main() {
SHELL_TYPE=$(detect_shell) SHELL_TYPE=$(detect_shell)
case "$SHELL_TYPE" in case "$SHELL_TYPE" in
zsh) zsh)
SCRIPT_NAME="finishte.zsh" SCRIPT_NAME="inish .zsh"
RC_FILE="$HOME/.zshrc" RC_FILE="$HOME/.zshrc"
;; ;;
bash) bash)
SCRIPT_NAME="finishte.sh" SCRIPT_NAME="inish .sh"
RC_FILE="$HOME/.bashrc" RC_FILE="$HOME/.bashrc"
;; ;;
*) *)
@@ -122,7 +122,7 @@ main() {
# Determine installation location # Determine installation location
if [ -d "$HOME/.local/bin" ]; then if [ -d "$HOME/.local/bin" ]; then
INSTALL_LOCATION="$HOME/.local/bin/finishte" INSTALL_LOCATION="$HOME/.local/bin/inish "
# Add to PATH if not already there # Add to PATH if not already there
if ! echo "$PATH" | grep -q "$HOME/.local/bin"; then if ! echo "$PATH" | grep -q "$HOME/.local/bin"; then
echo_warning "$HOME/.local/bin is not in PATH" echo_warning "$HOME/.local/bin is not in PATH"
@@ -132,7 +132,7 @@ main() {
fi fi
fi fi
elif [ -w "/usr/local/bin" ]; then elif [ -w "/usr/local/bin" ]; then
INSTALL_LOCATION="/usr/local/bin/finishte" INSTALL_LOCATION="/usr/local/bin/inish "
else else
echo_error "Cannot write to /usr/local/bin and $HOME/.local/bin doesn't exist" echo_error "Cannot write to /usr/local/bin and $HOME/.local/bin doesn't exist"
echo "Please create $HOME/.local/bin or run with sudo" echo "Please create $HOME/.local/bin or run with sudo"
@@ -143,7 +143,7 @@ main() {
mkdir -p "$(dirname "$INSTALL_LOCATION")" mkdir -p "$(dirname "$INSTALL_LOCATION")"
# Download script # Download script
echo "Downloading finishte.sh..." echo "Downloading inish .sh..."
URL="$REPO_URL/$BRANCH_OR_VERSION/$SCRIPT_NAME" URL="$REPO_URL/$BRANCH_OR_VERSION/$SCRIPT_NAME"
if ! download_file "$URL" "$INSTALL_LOCATION"; then if ! download_file "$URL" "$INSTALL_LOCATION"; then
echo_error "Failed to download from $URL" echo_error "Failed to download from $URL"

114
finish.sh
View File

@@ -23,12 +23,12 @@ echo_green() {
export ACSH_VERSION=0.5.0 export ACSH_VERSION=0.5.0
unset _finishte_modellist unset _inish _modellist
declare -A _finishte_modellist declare -A _inish _modellist
# LM-Studio models # LM-Studio models
_finishte_modellist['lmstudio: darkidol-llama-3.1-8b-instruct-1.3-uncensored_gguf:2']='{ "completion_cost":0.0000000, "prompt_cost":0.0000000, "endpoint": "http://localhost:1234/v1/chat/completions", "model": "darkidol-llama-3.1-8b-instruct-1.3-uncensored_gguf:2", "provider": "lmstudio" }' _inish _modellist['lmstudio: darkidol-llama-3.1-8b-instruct-1.3-uncensored_gguf:2']='{ "completion_cost":0.0000000, "prompt_cost":0.0000000, "endpoint": "http://localhost:1234/v1/chat/completions", "model": "darkidol-llama-3.1-8b-instruct-1.3-uncensored_gguf:2", "provider": "lmstudio" }'
# Ollama model # Ollama model
_finishte_modellist['ollama: codellama']='{ "completion_cost":0.0000000, "prompt_cost":0.0000000, "endpoint": "http://localhost:11434/api/chat", "model": "codellama", "provider": "ollama" }' _inish _modellist['ollama: codellama']='{ "completion_cost":0.0000000, "prompt_cost":0.0000000, "endpoint": "http://localhost:11434/api/chat", "model": "codellama", "provider": "ollama" }'
############################################################################### ###############################################################################
# System Information Functions # # System Information Functions #
@@ -343,7 +343,7 @@ list_cache() {
find "$cache_dir" -maxdepth 1 -type f -name "acsh-*" -printf '%T+ %p\n' | sort find "$cache_dir" -maxdepth 1 -type f -name "acsh-*" -printf '%T+ %p\n' | sort
} }
_finishtesh() { _inish sh() {
_init_completion || return _init_completion || return
_default_completion _default_completion
if [[ ${#COMPREPLY[@]} -eq 0 && $COMP_TYPE -eq 63 ]]; then if [[ ${#COMPREPLY[@]} -eq 0 && $COMP_TYPE -eq 63 ]]; then
@@ -528,7 +528,7 @@ set_config() {
} }
config_command() { config_command() {
local command config_file="$HOME/.finishte/config" local command config_file="$HOME/.inish /config"
command="${*:2}" command="${*:2}"
if [ -z "$command" ]; then if [ -z "$command" ]; then
show_config show_config
@@ -551,10 +551,10 @@ config_command() {
} }
build_config() { build_config() {
local config_file="$HOME/.finishte/config" default_config local config_file="$HOME/.inish /config" default_config
if [ ! -f "$config_file" ]; then if [ ! -f "$config_file" ]; then
echo "Creating default configuration file at ~/.finishte/config" echo "Creating default configuration file at ~/.inish /config"
default_config="# ~/.finishte/config default_config="# ~/.inish /config
# Model configuration # Model configuration
provider: lmstudio provider: lmstudio
@@ -569,17 +569,17 @@ max_history_commands: 20
max_recent_files: 20 max_recent_files: 20
# Cache settings # Cache settings
cache_dir: $HOME/.finishte/cache cache_dir: $HOME/.inish /cache
cache_size: 10 cache_size: 10
# Logging settings # Logging settings
log_file: $HOME/.finishte/finishte.log" log_file: $HOME/.inish /inish .log"
echo "$default_config" > "$config_file" echo "$default_config" > "$config_file"
fi fi
} }
acsh_load_config() { acsh_load_config() {
local config_file="$HOME/.finishte/config" key value local config_file="$HOME/.inish /config" key value
if [ -f "$config_file" ]; then if [ -f "$config_file" ]; then
while IFS=':' read -r key value; do while IFS=':' read -r key value; do
if [[ $key =~ ^# ]] || [[ -z $key ]]; then if [[ $key =~ ^# ]] || [[ -z $key ]]; then
@@ -610,72 +610,72 @@ acsh_load_config() {
} }
install_command() { install_command() {
local bashrc_file="$HOME/.bashrc" finishte_setup="source finish enable" finishte_cli_setup="complete -F _finishtesh_cli finishte" local bashrc_file="$HOME/.bashrc" inish _setup="source finish enable" inish _cli_setup="complete -F _inish sh_cli inish "
if ! command -v finish &>/dev/null; then if ! command -v finish &>/dev/null; then
echo_error "finishte.sh not in PATH. Follow install instructions at https://git.appmodel.nl/Tour/finish" echo_error "inish .sh not in PATH. Follow install instructions at https://git.appmodel.nl/Tour/finish"
return return
fi fi
if [[ ! -d "$HOME/.finishte" ]]; then if [[ ! -d "$HOME/.inish " ]]; then
echo "Creating ~/.finish directory" echo "Creating ~/.finish directory"
mkdir -p "$HOME/.finishte" mkdir -p "$HOME/.inish "
fi fi
local cache_dir=${ACSH_CACHE_DIR:-"$HOME/.finishte/cache"} local cache_dir=${ACSH_CACHE_DIR:-"$HOME/.inish /cache"}
if [[ ! -d "$cache_dir" ]]; then if [[ ! -d "$cache_dir" ]]; then
mkdir -p "$cache_dir" mkdir -p "$cache_dir"
fi fi
build_config build_config
acsh_load_config acsh_load_config
if ! grep -qF "$finishte_setup" "$bashrc_file"; then if ! grep -qF "$inish _setup" "$bashrc_file"; then
echo -e "# finishte.sh" >> "$bashrc_file" echo -e "# inish .sh" >> "$bashrc_file"
echo -e "$finishte_setup\n" >> "$bashrc_file" echo -e "$inish _setup\n" >> "$bashrc_file"
echo "Added finishte.sh setup to $bashrc_file" echo "Added inish .sh setup to $bashrc_file"
else else
echo "finishte.sh setup already exists in $bashrc_file" echo "inish .sh setup already exists in $bashrc_file"
fi fi
if ! grep -qF "$finishte_cli_setup" "$bashrc_file"; then if ! grep -qF "$inish _cli_setup" "$bashrc_file"; then
echo -e "# finishte.sh CLI" >> "$bashrc_file" echo -e "# inish .sh CLI" >> "$bashrc_file"
echo -e "$finishte_cli_setup\n" >> "$bashrc_file" echo -e "$inish _cli_setup\n" >> "$bashrc_file"
echo "Added finish CLI completion to $bashrc_file" echo "Added finish CLI completion to $bashrc_file"
fi fi
echo echo
echo_green "finishte.sh - Version $ACSH_VERSION installation complete." echo_green "inish .sh - Version $ACSH_VERSION installation complete."
echo -e "Run: source $bashrc_file to enable finishte." echo -e "Run: source $bashrc_file to enable inish ."
echo -e "Then run: finish model to select a language model." echo -e "Then run: finish model to select a language model."
} }
remove_command() { remove_command() {
local config_file="$HOME/.finishte/config" cache_dir=${ACSH_CACHE_DIR:-"$HOME/.finishte/cache"} log_file=${ACSH_LOG_FILE:-"$HOME/.finishte/finishte.log"} bashrc_file="$HOME/.bashrc" local config_file="$HOME/.inish /config" cache_dir=${ACSH_CACHE_DIR:-"$HOME/.inish /cache"} log_file=${ACSH_LOG_FILE:-"$HOME/.inish /inish .log"} bashrc_file="$HOME/.bashrc"
echo_green "Removing finishte.sh installation..." echo_green "Removing inish .sh installation..."
[ -f "$config_file" ] && { rm "$config_file"; echo "Removed: $config_file"; } [ -f "$config_file" ] && { rm "$config_file"; echo "Removed: $config_file"; }
[ -d "$cache_dir" ] && { rm -rf "$cache_dir"; echo "Removed: $cache_dir"; } [ -d "$cache_dir" ] && { rm -rf "$cache_dir"; echo "Removed: $cache_dir"; }
[ -f "$log_file" ] && { rm "$log_file"; echo "Removed: $log_file"; } [ -f "$log_file" ] && { rm "$log_file"; echo "Removed: $log_file"; }
if [ -d "$HOME/.finishte" ]; then if [ -d "$HOME/.inish " ]; then
if [ -z "$(ls -A "$HOME/.finishte")" ]; then if [ -z "$(ls -A "$HOME/.inish ")" ]; then
rmdir "$HOME/.finishte" rmdir "$HOME/.inish "
echo "Removed: $HOME/.finishte" echo "Removed: $HOME/.inish "
else else
echo "Skipped removing $HOME/.finish (not empty)" echo "Skipped removing $HOME/.finish (not empty)"
fi fi
fi fi
if [ -f "$bashrc_file" ]; then if [ -f "$bashrc_file" ]; then
if grep -qF "source finish enable" "$bashrc_file"; then if grep -qF "source finish enable" "$bashrc_file"; then
sed -i '/# finishte.sh/d' "$bashrc_file" sed -i '/# inish .sh/d' "$bashrc_file"
sed -i '/finishte/d' "$bashrc_file" sed -i '/inish /d' "$bashrc_file"
echo "Removed finishte.sh setup from $bashrc_file" echo "Removed inish .sh setup from $bashrc_file"
fi fi
fi fi
local finishte_script local inish _script
finishte_script=$(command -v finishte) inish _script=$(command -v inish )
if [ -n "$finishte_script" ]; then if [ -n "$inish _script" ]; then
echo "finish script is at: $finishte_script" echo "finish script is at: $inish _script"
if [ "$1" == "-y" ]; then if [ "$1" == "-y" ]; then
rm "$finishte_script" rm "$inish _script"
echo "Removed: $finishte_script" echo "Removed: $inish _script"
else else
read -r -p "Remove the finish script? (y/n): " confirm read -r -p "Remove the finish script? (y/n): " confirm
if [[ $confirm == "y" ]]; then if [[ $confirm == "y" ]]; then
rm "$finishte_script" rm "$inish _script"
echo "Removed: $finishte_script" echo "Removed: $inish _script"
fi fi
fi fi
fi fi
@@ -684,11 +684,11 @@ remove_command() {
check_if_enabled() { check_if_enabled() {
local is_enabled local is_enabled
is_enabled=$(complete -p | grep _finishtesh | grep -cv _finishtesh_cli) is_enabled=$(complete -p | grep _inish sh | grep -cv _inish sh_cli)
(( is_enabled > 0 )) && return 0 || return 1 (( is_enabled > 0 )) && return 0 || return 1
} }
_finishtesh_cli() { _inish sh_cli() {
if [[ -n "${COMP_WORDS[*]}" ]]; then if [[ -n "${COMP_WORDS[*]}" ]]; then
command="${COMP_WORDS[0]}" command="${COMP_WORDS[0]}"
if [[ -n "$COMP_CWORD" && "$COMP_CWORD" -lt "${#COMP_WORDS[@]}" ]]; then if [[ -n "$COMP_CWORD" && "$COMP_CWORD" -lt "${#COMP_WORDS[@]}" ]]; then
@@ -720,11 +720,11 @@ model
enable_command() { enable_command() {
if check_if_enabled; then if check_if_enabled; then
echo_green "Reloading finishte.sh..." echo_green "Reloading inish .sh..."
disable_command disable_command
fi fi
acsh_load_config acsh_load_config
complete -D -E -F _finishtesh -o nospace complete -D -E -F _inish sh -o nospace
} }
disable_command() { disable_command() {
@@ -747,7 +747,7 @@ command_command() {
} }
clear_command() { clear_command() {
local cache_dir=${ACSH_CACHE_DIR:-"$HOME/.finishte/cache"} log_file=${ACSH_LOG_FILE:-"$HOME/.finishte/finishte.log"} local cache_dir=${ACSH_CACHE_DIR:-"$HOME/.inish /cache"} log_file=${ACSH_LOG_FILE:-"$HOME/.inish /inish .log"}
echo "This will clear the cache and log file." echo "This will clear the cache and log file."
echo -e "Cache directory: \e[31m$cache_dir\e[0m" echo -e "Cache directory: \e[31m$cache_dir\e[0m"
echo -e "Log file: \e[31m$log_file\e[0m" echo -e "Log file: \e[31m$log_file\e[0m"
@@ -774,10 +774,10 @@ clear_command() {
} }
usage_command() { usage_command() {
local log_file=${ACSH_LOG_FILE:-"$HOME/.finishte/finishte.log"} cache_dir=${ACSH_CACHE_DIR:-"$HOME/.finishte/cache"} local log_file=${ACSH_LOG_FILE:-"$HOME/.inish /inish .log"} cache_dir=${ACSH_CACHE_DIR:-"$HOME/.inish /cache"}
local cache_size number_of_lines api_cost avg_api_cost local cache_size number_of_lines api_cost avg_api_cost
cache_size=$(list_cache | wc -l) cache_size=$(list_cache | wc -l)
echo_green "finishte.sh - Usage Information" echo_green "inish .sh - Usage Information"
echo echo
echo -n "Log file: "; echo -e "\e[90m$log_file\e[0m" echo -n "Log file: "; echo -e "\e[90m$log_file\e[0m"
if [ ! -f "$log_file" ]; then if [ ! -f "$log_file" ]; then
@@ -865,22 +865,22 @@ model_command() {
clear clear
local selected_model options=() local selected_model options=()
if [[ $# -ne 3 ]]; then if [[ $# -ne 3 ]]; then
mapfile -t sorted_keys < <(for key in "${!_finishte_modellist[@]}"; do echo "$key"; done | sort) mapfile -t sorted_keys < <(for key in "${!_inish _modellist[@]}"; do echo "$key"; done | sort)
for key in "${sorted_keys[@]}"; do for key in "${sorted_keys[@]}"; do
options+=("$key") options+=("$key")
done done
echo -e "\e[1;32mfinishte.sh - Model Configuration\e[0m" echo -e "\e[1;32minish .sh - Model Configuration\e[0m"
menu_selector "${options[@]}" menu_selector "${options[@]}"
selected_option=$? selected_option=$?
if [[ $selected_option -eq 1 ]]; then if [[ $selected_option -eq 1 ]]; then
return return
fi fi
selected_model="${options[selected_option]}" selected_model="${options[selected_option]}"
selected_value="${_finishte_modellist[$selected_model]}" selected_value="${_inish _modellist[$selected_model]}"
else else
provider="$2" provider="$2"
model_name="$3" model_name="$3"
selected_value="${_finishte_modellist["$provider: $model_name"]}" selected_value="${_inish _modellist["$provider: $model_name"]}"
if [[ -z "$selected_value" ]]; then if [[ -z "$selected_value" ]]; then
echo "ERROR: Invalid provider or model name." echo "ERROR: Invalid provider or model name."
return 1 return 1
@@ -952,9 +952,9 @@ case "$1" in
;; ;;
*) *)
if [[ -n "$1" ]]; then if [[ -n "$1" ]]; then
echo_error "Unknown command $1 - run 'finish --help' for usage or visit https://finishte.sh" echo_error "Unknown command $1 - run 'finish --help' for usage or visit https://inish .sh"
else else
echo_green "finishte.sh - LLM Powered Bash Completion - Version $ACSH_VERSION - https://finishte.sh" echo_green "inish .sh - LLM Powered Bash Completion - Version $ACSH_VERSION - https://inish .sh"
fi fi
;; ;;
esac esac

View File

@@ -1,6 +1,6 @@
class finishteSh < Formula class inish Sh < Formula
desc "LLM-powered command-line finishtion" desc "LLM-powered command-line finishtion"
homepage "https://git.appmodel.nl/Tour/finishte" homepage "https://git.appmodel.nl/Tour/inish "
url "https://git.appmodel.nl/Tour/finish/archive/v0.5.0.tar.gz" url "https://git.appmodel.nl/Tour/finish/archive/v0.5.0.tar.gz"
sha256 "" # Update with actual SHA256 of the release tarball sha256 "" # Update with actual SHA256 of the release tarball
license "BSD-2-Clause" license "BSD-2-Clause"
@@ -11,7 +11,7 @@ class finishteSh < Formula
depends_on "bash-completion@2" => :optional depends_on "bash-completion@2" => :optional
def install def install
bin.install "finishte.sh" => "finishte" bin.install "inish .sh" => "inish "
doc.install "README.md" doc.install "README.md"
doc.install "LICENSE" doc.install "LICENSE"
end end
@@ -30,18 +30,18 @@ class finishteSh < Formula
3. Select a language model: 3. Select a language model:
finish model finish model
You'll need LM-Studio or Ollama running locally to use finishte.sh. You'll need LM-Studio or Ollama running locally to use inish .sh.
LM-Studio: https://lmstudio.ai LM-Studio: https://lmstudio.ai
Ollama: https://ollama.ai Ollama: https://ollama.ai
For more information, visit: For more information, visit:
https:/git.appmodel.nl/Tour/finishte https:/git.appmodel.nl/Tour/inish
EOS EOS
end end
test do test do
system "#{bin}/finishte", "--help" system "#{bin}/inish ", "--help"
assert_match "finishte.sh", shell_output("#{bin}/finish --help") assert_match "inish .sh", shell_output("#{bin}/finish --help")
end end
end end

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bats #!/usr/bin/env bats
setup() { setup() {
# Install finishte.sh and run testing against the main branch # Install inish .sh and run testing against the main branch
wget -qO- https://git.appmodel.nl/Tour/finish/raw/branch/main/docs/install.sh | bash -s -- main wget -qO- https://git.appmodel.nl/Tour/finish/raw/branch/main/docs/install.sh | bash -s -- main
# Source bashrc to make sure finish is available in the current session # Source bashrc to make sure finish is available in the current session
@@ -14,18 +14,18 @@ setup() {
} }
teardown() { teardown() {
# Remove finishte.sh installation # Remove inish .sh installation
finish remove -y finish remove -y
} }
@test "which finish returns something" { @test "which finish returns something" {
run which finishte run which inish
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[ -n "$output" ] [ -n "$output" ]
} }
@test "finish returns a string containing finishte.sh (case insensitive)" { @test "finish returns a string containing inish .sh (case insensitive)" {
run finishte run inish
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[[ "$output" =~ [Aa]utocomplete\.sh ]] [[ "$output" =~ [Aa]utocomplete\.sh ]]
} }