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:10:02 +01:00
parent 24d36cbad4
commit 08b76124e2
9 changed files with 79 additions and 79 deletions

View File

@@ -39,7 +39,7 @@ jobs:
mkdir -p $HOME/.local/bin mkdir -p $HOME/.local/bin
cp finishte.sh $HOME/.local/bin/finishte cp finishte.sh $HOME/.local/bin/finishte
chmod +x $HOME/.local/bin/finishte chmod +x $HOME/.local/bin/finishte
$HOME/.local/bin/finishte --help $HOME/.local/bin/finish --help
lint: lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -66,4 +66,4 @@ jobs:
- name: Test Docker image - name: Test Docker image
run: | run: |
docker run --rm finish:test -c "finishte --help" docker run --rm finish:test -c "finish --help"

View File

@@ -71,8 +71,8 @@ sudo dpkg -i ../finish_*.deb
sudo apt-get install -f # Fix dependencies sudo apt-get install -f # Fix dependencies
# Test installation # Test installation
finishte --help finish --help
finishte install finish install
``` ```
### Creating an APT Repository ### Creating an APT Repository

View File

@@ -53,20 +53,20 @@ Switch between different models and providers easily.
View current settings: View current settings:
```bash ```bash
finishte config finish config
``` ```
Change the endpoint or model: Change the endpoint or model:
```bash ```bash
finishte config set endpoint http://192.168.1.100:1234/v1/chat/completions finish config set endpoint http://192.168.1.100:1234/v1/chat/completions
finishte config set model your-model-name finish config set model your-model-name
``` ```
Select a model interactively: Select a model interactively:
```bash ```bash
finishte model finish model
``` ```
## Usage ## Usage
@@ -89,8 +89,8 @@ Natural language works too:
Test it without executing: Test it without executing:
```bash ```bash
finishte command "your command" finish command "your command"
finishte command --dry-run "your command" finish command --dry-run "your command"
``` ```
## Installation ## Installation
@@ -102,7 +102,7 @@ The fastest way to get started:
```bash ```bash
curl -sSL https://git.appmodel.nl/Tour/finish/raw/branch/main/docs/install.sh | bash curl -sSL https://git.appmodel.nl/Tour/finish/raw/branch/main/docs/install.sh | bash
source ~/.bashrc # or ~/.zshrc for zsh source ~/.bashrc # or ~/.zshrc for zsh
finishte model finish model
``` ```
### Package Managers ### Package Managers
@@ -112,7 +112,7 @@ finishte model
```bash ```bash
brew tap appmodel/finish brew tap appmodel/finish
brew install finish brew install finish
finishte install finish install
source ~/.bashrc source ~/.bashrc
``` ```
@@ -123,7 +123,7 @@ Download the `.deb` package from [releases](https://git.appmodel.nl/Tour/finish/
```bash ```bash
sudo dpkg -i finish_*.deb sudo dpkg -i finish_*.deb
sudo apt-get install -f # Install dependencies sudo apt-get install -f # Install dependencies
finishte install finish install
source ~/.bashrc source ~/.bashrc
``` ```
@@ -145,9 +145,9 @@ docker-compose exec finish bash
Inside the container: Inside the container:
```bash ```bash
finishte install finish install
source ~/.bashrc source ~/.bashrc
finishte model # Configure your LLM endpoint finish model # Configure your LLM endpoint
``` ```
### From Source ### From Source
@@ -157,7 +157,7 @@ git clone https://git.appmodel.nl/Tour/finish.git finish
cd finish cd finish
chmod +x finish.sh chmod +x finish.sh
sudo ln -s $PWD/finish.sh /usr/local/bin/finish sudo ln -s $PWD/finish.sh /usr/local/bin/finish
finishte install finish install
source ~/.bashrc source ~/.bashrc
``` ```
@@ -182,16 +182,16 @@ source ~/.bashrc
## Commands ## Commands
```bash ```bash
finishte install # Set up finishte finish install # Set up finishte
finishte remove # Uninstall finish remove # Uninstall
finishte config # Show/edit configuration finish config # Show/edit configuration
finishte model # Select model finish model # Select model
finishte enable # Enable completions finish enable # Enable completions
finishte disable # Disable completions finish disable # Disable completions
finishte clear # Clear cache and logs finish clear # Clear cache and logs
finishte usage # Show usage statistics finish usage # Show usage statistics
finishte system # Show system information finish system # Show system information
finishte --help # Show help finish --help # Show help
``` ```
## Providers ## Providers
@@ -213,7 +213,7 @@ Clone and link for development:
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/finishte.sh $HOME/.local/bin/finish
finishte install finish install
``` ```
### Running Tests ### Running Tests

View File

@@ -5,7 +5,7 @@
Install and set up finishte: Install and set up finishte:
```bash ```bash
finishte install finish install
source ~/.bashrc source ~/.bashrc
``` ```
@@ -14,21 +14,21 @@ source ~/.bashrc
View current settings: View current settings:
```bash ```bash
finishte config finish config
``` ```
Change settings: Change settings:
```bash ```bash
finishte config set temperature 0.5 finish config set temperature 0.5
finishte config set endpoint http://localhost:1234/v1/chat/completions finish config set endpoint http://localhost:1234/v1/chat/completions
finishte config set model your-model-name finish config set model your-model-name
``` ```
Reset to defaults: Reset to defaults:
```bash ```bash
finishte config reset finish config reset
``` ```
## Model Selection ## Model Selection
@@ -36,7 +36,7 @@ finishte config reset
Select a model interactively: Select a model interactively:
```bash ```bash
finishte model finish model
``` ```
Use arrow keys to navigate, Enter to select, or 'q' to quit. Use arrow keys to navigate, Enter to select, or 'q' to quit.
@@ -46,25 +46,25 @@ Use arrow keys to navigate, Enter to select, or 'q' to quit.
Show help: Show help:
```bash ```bash
finishte --help finish --help
``` ```
Test completions without caching: Test completions without caching:
```bash ```bash
finishte command "your command here" finish command "your command here"
``` ```
Preview the prompt sent to the model: Preview the prompt sent to the model:
```bash ```bash
finishte command --dry-run "your command here" finish command --dry-run "your command here"
``` ```
View system information: View system information:
```bash ```bash
finishte system finish system
``` ```
## Usage Statistics ## Usage Statistics
@@ -72,7 +72,7 @@ finishte system
Check your usage stats and costs: Check your usage stats and costs:
```bash ```bash
finishte usage finish usage
``` ```
## Cache Management ## Cache Management
@@ -80,7 +80,7 @@ finishte usage
Clear cached completions and logs: Clear cached completions and logs:
```bash ```bash
finishte clear finish clear
``` ```
## Enable/Disable ## Enable/Disable
@@ -88,21 +88,21 @@ finishte clear
Temporarily disable: Temporarily disable:
```bash ```bash
finishte disable finish disable
``` ```
Re-enable: Re-enable:
```bash ```bash
finishte enable finish enable
``` ```
## Uninstallation ## Uninstallation
Remove finishte completely: Remove finish completely:
```bash ```bash
finishte remove finish remove
``` ```
## Using finishte ## Using finishte

2
debian/postinst vendored
View File

@@ -6,7 +6,7 @@ case "$1" in
echo "finishte.sh has been installed successfully!" echo "finishte.sh has been installed successfully!"
echo "" echo ""
echo "To complete setup, run:" echo "To complete setup, run:"
echo " finishte install" echo " finish install"
echo "" echo ""
echo "Then reload your shell:" echo "Then reload your shell:"
echo " source ~/.bashrc # for bash" echo " source ~/.bashrc # for bash"

View File

@@ -171,8 +171,8 @@ main() {
fi fi
fi fi
# Run finishte install # Run finish install
echo "Running finishte installation..." echo "Running finish installation..."
if "$INSTALL_LOCATION" install; then if "$INSTALL_LOCATION" install; then
echo "" echo ""
echo_green "==========================================" echo_green "=========================================="
@@ -184,7 +184,7 @@ main() {
echo " source $RC_FILE" echo " source $RC_FILE"
echo "" echo ""
echo " 2. Select a language model:" echo " 2. Select a language model:"
echo " finishte model" echo " finish model"
echo "" echo ""
echo " 3. Start using by pressing Tab twice after any command" echo " 3. Start using by pressing Tab twice after any command"
echo "" echo ""

View File

@@ -520,7 +520,7 @@ set_config() {
return return
fi fi
if [ ! -f "$config_file" ]; then if [ ! -f "$config_file" ]; then
echo_error "Configuration file not found: $config_file. Run finishte install." echo_error "Configuration file not found: $config_file. Run finish install."
return return
fi fi
sed -i "s|^\($key:\).*|\1 $value|" "$config_file" sed -i "s|^\($key:\).*|\1 $value|" "$config_file"
@@ -538,7 +538,7 @@ config_command() {
local key="$3" value="$4" local key="$3" value="$4"
echo "Setting configuration key '$key' to '$value'" echo "Setting configuration key '$key' to '$value'"
set_config "$key" "$value" set_config "$key" "$value"
echo_green "Configuration updated. Run 'finishte config' to view changes." echo_green "Configuration updated. Run 'finish0 config' to view changes."
return return
fi fi
if [[ "$command" == "reset" ]]; then if [[ "$command" == "reset" ]]; then
@@ -547,7 +547,7 @@ config_command() {
build_config build_config
return return
fi fi
echo_error "SyntaxError: expected 'finishte config set <key> <value>' or 'finishte config reset'" echo_error "SyntaxError: expected 'finish config set <key> <value>' or 'finish config reset'"
} }
build_config() { build_config() {
@@ -610,13 +610,13 @@ acsh_load_config() {
} }
install_command() { install_command() {
local bashrc_file="$HOME/.bashrc" finishte_setup="source finishte enable" finishte_cli_setup="complete -F _finishtesh_cli finishte" local bashrc_file="$HOME/.bashrc" finishte_setup="source finish enable" finishte_cli_setup="complete -F _finishtesh_cli finishte"
if ! command -v finishte &>/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 "finishte.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/.finishte" ]]; then
echo "Creating ~/.finishte directory" echo "Creating ~/.finish directory"
mkdir -p "$HOME/.finishte" mkdir -p "$HOME/.finishte"
fi fi
local cache_dir=${ACSH_CACHE_DIR:-"$HOME/.finishte/cache"} local cache_dir=${ACSH_CACHE_DIR:-"$HOME/.finishte/cache"}
@@ -635,12 +635,12 @@ install_command() {
if ! grep -qF "$finishte_cli_setup" "$bashrc_file"; then if ! grep -qF "$finishte_cli_setup" "$bashrc_file"; then
echo -e "# finishte.sh CLI" >> "$bashrc_file" echo -e "# finishte.sh CLI" >> "$bashrc_file"
echo -e "$finishte_cli_setup\n" >> "$bashrc_file" echo -e "$finishte_cli_setup\n" >> "$bashrc_file"
echo "Added finishte 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 "finishte.sh - Version $ACSH_VERSION installation complete."
echo -e "Run: source $bashrc_file to enable finishte." echo -e "Run: source $bashrc_file to enable finishte."
echo -e "Then run: finishte model to select a language model." echo -e "Then run: finish model to select a language model."
} }
remove_command() { remove_command() {
@@ -654,11 +654,11 @@ remove_command() {
rmdir "$HOME/.finishte" rmdir "$HOME/.finishte"
echo "Removed: $HOME/.finishte" echo "Removed: $HOME/.finishte"
else else
echo "Skipped removing $HOME/.finishte (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 finishte enable" "$bashrc_file"; then if grep -qF "source finish enable" "$bashrc_file"; then
sed -i '/# finishte.sh/d' "$bashrc_file" sed -i '/# finishte.sh/d' "$bashrc_file"
sed -i '/finishte/d' "$bashrc_file" sed -i '/finishte/d' "$bashrc_file"
echo "Removed finishte.sh setup from $bashrc_file" echo "Removed finishte.sh setup from $bashrc_file"
@@ -667,12 +667,12 @@ remove_command() {
local finishte_script local finishte_script
finishte_script=$(command -v finishte) finishte_script=$(command -v finishte)
if [ -n "$finishte_script" ]; then if [ -n "$finishte_script" ]; then
echo "finishte script is at: $finishte_script" echo "finish script is at: $finishte_script"
if [ "$1" == "-y" ]; then if [ "$1" == "-y" ]; then
rm "$finishte_script" rm "$finishte_script"
echo "Removed: $finishte_script" echo "Removed: $finishte_script"
else else
read -r -p "Remove the finishte 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 "$finishte_script"
echo "Removed: $finishte_script" echo "Removed: $finishte_script"
@@ -795,7 +795,7 @@ usage_command() {
echo -e "\tTotal Cost:\t\e[31m\$$(printf "%.4f" "$api_cost")\e[0m" echo -e "\tTotal Cost:\t\e[31m\$$(printf "%.4f" "$api_cost")\e[0m"
echo echo
echo -n "Cache Size: $cache_size of ${ACSH_CACHE_SIZE:-10} in "; echo -e "\e[90m$cache_dir\e[0m" echo -n "Cache Size: $cache_size of ${ACSH_CACHE_SIZE:-10} in "; echo -e "\e[90m$cache_dir\e[0m"
echo "To clear log and cache, run: finishte clear" echo "To clear log and cache, run: finish clear"
} }
############################################################################### ###############################################################################
@@ -903,12 +903,12 @@ model_command() {
echo -e "Endpoint:\t\e[90m$ACSH_ENDPOINT\e[0m" echo -e "Endpoint:\t\e[90m$ACSH_ENDPOINT\e[0m"
if [[ ${ACSH_PROVIDER^^} == "OLLAMA" || ${ACSH_PROVIDER^^} == "LMSTUDIO" ]]; then if [[ ${ACSH_PROVIDER^^} == "OLLAMA" || ${ACSH_PROVIDER^^} == "LMSTUDIO" ]]; then
echo "To set a custom endpoint:" echo "To set a custom endpoint:"
echo -e "\t\e[34mfinishte config set endpoint <your-url>\e[0m" echo -e "\t\e[34mfinish config set endpoint <your-url>\e[0m"
echo "Other models can be set with:" echo "Other models can be set with:"
echo -e "\t\e[34mfinishte config set model <model-name>\e[0m" echo -e "\t\e[34mfinish config set model <model-name>\e[0m"
fi fi
echo "To change temperature:" echo "To change temperature:"
echo -e "\t\e[90mfinishte config set temperature <temperature>\e[0m" echo -e "\t\e[90mfinish config set temperature <temperature>\e[0m"
echo echo
} }
@@ -952,7 +952,7 @@ case "$1" in
;; ;;
*) *)
if [[ -n "$1" ]]; then if [[ -n "$1" ]]; then
echo_error "Unknown command $1 - run 'finishte --help' for usage or visit https://finishte.sh" echo_error "Unknown command $1 - run 'finish --help' for usage or visit https://finishte.sh"
else else
echo_green "finishte.sh - LLM Powered Bash Completion - Version $ACSH_VERSION - https://finishte.sh" echo_green "finishte.sh - LLM Powered Bash Completion - Version $ACSH_VERSION - https://finishte.sh"
fi fi

View File

@@ -21,14 +21,14 @@ class finishteSh < Formula
To complete the installation: To complete the installation:
1. Run the installer: 1. Run the installer:
finishte install finish install
2. Reload your shell: 2. Reload your shell:
source ~/.bashrc # for bash source ~/.bashrc # for bash
source ~/.zshrc # for zsh source ~/.zshrc # for zsh
3. Select a language model: 3. Select a language model:
finishte 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 finishte.sh.
@@ -42,6 +42,6 @@ class finishteSh < Formula
test do test do
system "#{bin}/finishte", "--help" system "#{bin}/finishte", "--help"
assert_match "finishte.sh", shell_output("#{bin}/finishte --help") assert_match "finishte.sh", shell_output("#{bin}/finish --help")
end end
end end

View File

@@ -4,40 +4,40 @@ setup() {
# Install finishte.sh and run testing against the main branch # Install finishte.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 finishte is available in the current session # Source bashrc to make sure finish is available in the current session
source ~/.bashrc source ~/.bashrc
# Configure for local LM-Studio # Configure for local LM-Studio
finishte config set provider lmstudio finish config set provider lmstudio
finishte config set endpoint http://localhost:1234/v1/chat/completions finish config set endpoint http://localhost:1234/v1/chat/completions
finishte config set model darkidol-llama-3.1-8b-instruct-1.3-uncensored_gguf:2 finish config set model darkidol-llama-3.1-8b-instruct-1.3-uncensored_gguf:2
} }
teardown() { teardown() {
# Remove finishte.sh installation # Remove finishte.sh installation
finishte remove -y finish remove -y
} }
@test "which finishte returns something" { @test "which finish returns something" {
run which finishte run which finishte
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[ -n "$output" ] [ -n "$output" ]
} }
@test "finishte returns a string containing finishte.sh (case insensitive)" { @test "finish returns a string containing finishte.sh (case insensitive)" {
run finishte run finishte
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[[ "$output" =~ [Aa]utocomplete\.sh ]] [[ "$output" =~ [Aa]utocomplete\.sh ]]
} }
@test "finishte config should have lmstudio provider" { @test "finish config should have lmstudio provider" {
run finishte config run finish config
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[[ "$output" =~ lmstudio ]] [[ "$output" =~ lmstudio ]]
} }
@test "finishte command 'ls # show largest files' should return something" { @test "finish command 'ls # show largest files' should return something" {
run finishte command "ls # show largest files" run finish command "ls # show largest files"
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[ -n "$output" ] [ -n "$output" ]
} }