-init-
This commit is contained in:
@@ -33,7 +33,7 @@ Update version numbers in these files:
|
|||||||
The install script at `docs/install.sh` enables one-line installation:
|
The install script at `docs/install.sh` enables one-line installation:
|
||||||
|
|
||||||
```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
|
||||||
```
|
```
|
||||||
|
|
||||||
### Setup:
|
### Setup:
|
||||||
@@ -250,7 +250,7 @@ After publishing, users can install from:
|
|||||||
|
|
||||||
**Quick Install:**
|
**Quick Install:**
|
||||||
```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
|
||||||
```
|
```
|
||||||
|
|
||||||
**Homebrew:**
|
**Homebrew:**
|
||||||
@@ -271,7 +271,7 @@ docker pull ghcr.io/appmodel/finish:latest
|
|||||||
|
|
||||||
**Direct Download:**
|
**Direct Download:**
|
||||||
```
|
```
|
||||||
https://git.appmodel.nl/Tour/finish/releases/latest
|
https://git.appmodel.nl/tour/finish/releases/latest
|
||||||
```
|
```
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|||||||
16
README.md
16
README.md
@@ -7,13 +7,13 @@ Command-line completion powered by local LLMs. Press `Tab` twice and get intelli
|
|||||||
### One-Line Install (Recommended)
|
### One-Line Install (Recommended)
|
||||||
|
|
||||||
```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
|
||||||
```
|
```
|
||||||
|
|
||||||
### Manual Installation
|
### Manual Installation
|
||||||
|
|
||||||
```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
|
||||||
./finish.sh install
|
./finish.sh install
|
||||||
source ~/.bashrc
|
source ~/.bashrc
|
||||||
@@ -59,7 +59,7 @@ finish config
|
|||||||
Change the endpoint or model:
|
Change the endpoint or model:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
finish config set endpoint http://192.168.1.100:1234/v1/chat/completions
|
finish config set endpoint http://plato.lan:1234/v1/chat/completions
|
||||||
finish config set model your-model-name
|
finish config set model your-model-name
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ finish command --dry-run "your command"
|
|||||||
The fastest way to get started:
|
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
|
||||||
finish model
|
finish model
|
||||||
```
|
```
|
||||||
@@ -118,7 +118,7 @@ source ~/.bashrc
|
|||||||
|
|
||||||
#### APT (Debian/Ubuntu)
|
#### APT (Debian/Ubuntu)
|
||||||
|
|
||||||
Download the `.deb` package from [releases](https://git.appmodel.nl/Tour/finish/releases):
|
Download the `.deb` package from [releases](https://git.appmodel.nl/tour/finish/releases):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo dpkg -i finish_*.deb
|
sudo dpkg -i finish_*.deb
|
||||||
@@ -153,7 +153,7 @@ finish model # Configure your LLM endpoint
|
|||||||
### From Source
|
### From Source
|
||||||
|
|
||||||
```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
|
||||||
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
|
||||||
@@ -210,7 +210,7 @@ Add custom providers by editing `finish.sh` and adding entries to `_finish_model
|
|||||||
Clone and link for development:
|
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/finish.sh $HOME/.local/bin/finish
|
ln -s $PWD/finish.sh $HOME/.local/bin/finish
|
||||||
finish install
|
finish install
|
||||||
@@ -284,7 +284,7 @@ After creating a release, update the Homebrew formula:
|
|||||||
|
|
||||||
1. Calculate SHA256 of the release tarball:
|
1. Calculate SHA256 of the release tarball:
|
||||||
```bash
|
```bash
|
||||||
curl -sL https://git.appmodel.nl/Tour/finish/archive/v0.5.0.tar.gz | sha256sum
|
curl -sL https://git.appmodel.nl/tour/finish/archive/v0.5.0.tar.gz | sha256sum
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Update `homebrew/finish.rb` with the new SHA256 and version
|
2. Update `homebrew/finish.rb` with the new SHA256 and version
|
||||||
|
|||||||
4
debian/control
vendored
4
debian/control
vendored
@@ -4,8 +4,8 @@ Priority: optional
|
|||||||
Maintainer: finish.sh Contributors <noreply@finish.sh>
|
Maintainer: finish.sh Contributors <noreply@finish.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
|
||||||
Vcs-Git: https://git.appmodel.nl/Tour/finish.git
|
Vcs-Git: https://git.appmodel.nl/tour/finish.git
|
||||||
|
|
||||||
Package: finish
|
Package: finish
|
||||||
Architecture: all
|
Architecture: all
|
||||||
|
|||||||
4
debian/copyright
vendored
4
debian/copyright
vendored
@@ -1,7 +1,7 @@
|
|||||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||||
Upstream-Name: finish
|
Upstream-Name: finish
|
||||||
Upstream-Contact: https://git.appmodel.nl/Tour/finish/finish
|
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 finish.sh Contributors
|
Copyright: 2024-2025 finish.sh Contributors
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# finish.sh installer
|
# finish.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
|
||||||
|
|
||||||
ACSH_VERSION="v0.5.0"
|
ACSH_VERSION="v0.5.0"
|
||||||
BRANCH_OR_VERSION=${1:-main}
|
BRANCH_OR_VERSION=${1:-main}
|
||||||
REPO_URL="https://git.appmodel.nl/Tour/finish/raw/branch"
|
REPO_URL="https://git.appmodel.nl/tour/finish/raw/branch"
|
||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
RED='\033[0;31m'
|
RED='\033[0;31m'
|
||||||
@@ -121,6 +121,11 @@ main() {
|
|||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Determine installation location
|
# Determine installation location
|
||||||
|
# Prefer local user install at ~/.local/bin, create it if missing
|
||||||
|
if [ ! -d "$HOME/.local/bin" ]; then
|
||||||
|
mkdir -p "$HOME/.local/bin"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -d "$HOME/.local/bin" ]; then
|
if [ -d "$HOME/.local/bin" ]; then
|
||||||
INSTALL_LOCATION="$HOME/.local/bin/finish"
|
INSTALL_LOCATION="$HOME/.local/bin/finish"
|
||||||
# Add to PATH if not already there
|
# Add to PATH if not already there
|
||||||
@@ -134,8 +139,8 @@ main() {
|
|||||||
elif [ -w "/usr/local/bin" ]; then
|
elif [ -w "/usr/local/bin" ]; then
|
||||||
INSTALL_LOCATION="/usr/local/bin/finish"
|
INSTALL_LOCATION="/usr/local/bin/finish"
|
||||||
else
|
else
|
||||||
echo_error "Cannot write to /usr/local/bin and $HOME/.local/bin doesn't exist"
|
echo_error "Cannot determine installation location"
|
||||||
echo "Please create $HOME/.local/bin or run with sudo"
|
echo "Please ensure either $HOME/.local/bin exists and is writable, or run with sudo for /usr/local/bin"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -154,6 +159,13 @@ main() {
|
|||||||
echo_green "✓ Installed to $INSTALL_LOCATION"
|
echo_green "✓ Installed to $INSTALL_LOCATION"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
# Ensure current shell PATH includes the install dir for immediate use
|
||||||
|
INSTALL_DIR="$(dirname "$INSTALL_LOCATION")"
|
||||||
|
case ":$PATH:" in
|
||||||
|
*":$INSTALL_DIR:"*) ;;
|
||||||
|
*) export PATH="$INSTALL_DIR:$PATH" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
# Check bash-completion
|
# Check bash-completion
|
||||||
if [ "$SHELL_TYPE" = "bash" ]; then
|
if [ "$SHELL_TYPE" = "bash" ]; then
|
||||||
if ! command -v _init_completion > /dev/null 2>&1; then
|
if ! command -v _init_completion > /dev/null 2>&1; then
|
||||||
@@ -188,7 +200,7 @@ main() {
|
|||||||
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 ""
|
||||||
echo "Documentation: https://git.appmodel.nl/Tour/finish"
|
echo "Documentation: https://git.appmodel.nl/tour/finish"
|
||||||
else
|
else
|
||||||
echo_error "Installation failed. Please check the output above."
|
echo_error "Installation failed. Please check the output above."
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
12
finish.iml
Normal file
12
finish.iml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="WEB_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.git" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/tests" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
@@ -529,7 +529,7 @@ show_help() {
|
|||||||
echo " clear Clear cache and log files"
|
echo " clear Clear cache and log files"
|
||||||
echo " --help Show this help message"
|
echo " --help Show this help message"
|
||||||
echo
|
echo
|
||||||
echo "Submit issues at: https://git.appmodel.nl/Tour/finish/issues"
|
echo "Submit issues at: https://git.appmodel.nl/tour/finish/issues"
|
||||||
}
|
}
|
||||||
|
|
||||||
is_subshell() {
|
is_subshell() {
|
||||||
@@ -707,7 +707,7 @@ acsh_load_config() {
|
|||||||
install_command() {
|
install_command() {
|
||||||
local bashrc_file="$HOME/.bashrc" finish_setup="source finish enable" finish_cli_setup="complete -F _finishsh_cli finish"
|
local bashrc_file="$HOME/.bashrc" finish_setup="source finish enable" finish_cli_setup="complete -F _finishsh_cli finish"
|
||||||
if ! command -v finish &>/dev/null; then
|
if ! command -v finish &>/dev/null; then
|
||||||
echo_error "finish.sh not in PATH. Follow install instructions at https://git.appmodel.nl/Tour/finish"
|
echo_error "finish.sh not in PATH. Follow install instructions at https://git.appmodel.nl/tour/finish"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if [[ ! -d "$HOME/.finish" ]]; then
|
if [[ ! -d "$HOME/.finish" ]]; then
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class finishSh < Formula
|
class finishSh < Formula
|
||||||
desc "LLM-powered command-line finishtion"
|
desc "LLM-powered command-line finishtion"
|
||||||
homepage "https://git.appmodel.nl/Tour/finish"
|
homepage "https://git.appmodel.nl/tour/finish"
|
||||||
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"
|
||||||
version "0.5.0"
|
version "0.5.0"
|
||||||
@@ -36,7 +36,7 @@ class finishSh < Formula
|
|||||||
Ollama: https://ollama.ai
|
Ollama: https://ollama.ai
|
||||||
|
|
||||||
For more information, visit:
|
For more information, visit:
|
||||||
https:/git.appmodel.nl/Tour/finish
|
https:/git.appmodel.nl/tour/finish
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,43 +0,0 @@
|
|||||||
#!/usr/bin/env bats
|
|
||||||
|
|
||||||
setup() {
|
|
||||||
# Install finish.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
|
|
||||||
|
|
||||||
# Source bashrc to make sure finish is available in the current session
|
|
||||||
source ~/.bashrc
|
|
||||||
|
|
||||||
# Configure for local LM-Studio
|
|
||||||
finish config set provider lmstudio
|
|
||||||
finish config set endpoint http://plato.lan:1234/v1/chat/completions
|
|
||||||
finish config set model darkidol-llama-3.1-8b-instruct-1.3-uncensored_gguf:2
|
|
||||||
}
|
|
||||||
|
|
||||||
teardown() {
|
|
||||||
# Remove finish.sh installation
|
|
||||||
finish remove -y
|
|
||||||
}
|
|
||||||
|
|
||||||
@test "which finish returns something" {
|
|
||||||
run which finish
|
|
||||||
[ "$status" -eq 0 ]
|
|
||||||
[ -n "$output" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
@test "finish returns a string containing finish.sh (case insensitive)" {
|
|
||||||
run finish
|
|
||||||
[ "$status" -eq 0 ]
|
|
||||||
[[ "$output" =~ [Aa]utocomplete\.sh ]]
|
|
||||||
}
|
|
||||||
|
|
||||||
@test "finish config should have lmstudio provider" {
|
|
||||||
run finish config
|
|
||||||
[ "$status" -eq 0 ]
|
|
||||||
[[ "$output" =~ lmstudio ]]
|
|
||||||
}
|
|
||||||
|
|
||||||
@test "finish command 'ls # show largest files' should return something" {
|
|
||||||
run finish command "ls # show largest files"
|
|
||||||
[ "$status" -eq 0 ]
|
|
||||||
[ -n "$output" ]
|
|
||||||
}
|
|
||||||
59
tests/test_finish.sh
Executable file
59
tests/test_finish.sh
Executable file
@@ -0,0 +1,59 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# ----- tiny test framework -----
|
||||||
|
pass() { printf "✔ %s\n" "$1"; }
|
||||||
|
fail() { printf "✘ %s\n" "$1"; exit 1; }
|
||||||
|
|
||||||
|
assert_ok() {
|
||||||
|
if [[ $1 -ne 0 ]]; then fail "$2"; fi
|
||||||
|
}
|
||||||
|
|
||||||
|
assert_nonempty() {
|
||||||
|
if [[ -z "$1" ]]; then fail "$2"; fi
|
||||||
|
}
|
||||||
|
|
||||||
|
assert_contains() {
|
||||||
|
if [[ ! "$1" =~ $2 ]]; then fail "$3"; fi
|
||||||
|
}
|
||||||
|
# --------------------------------
|
||||||
|
|
||||||
|
echo "=== SETUP ==="
|
||||||
|
bash ./docs/install.sh main
|
||||||
|
source ~/.bashrc
|
||||||
|
|
||||||
|
finish config set provider lmstudio
|
||||||
|
finish config set endpoint http://plato.lan:1234/v1/chat/completions
|
||||||
|
finish config set model darkidol-llama-3.1-8b-instruct-1.3-uncensored_gguf:2
|
||||||
|
|
||||||
|
# -------------------------------- TESTS --------------------------------
|
||||||
|
|
||||||
|
# 1) which finish should return something
|
||||||
|
out=$(which finish 2>&1) ; code=$?
|
||||||
|
assert_ok $code "which finish should exit 0"
|
||||||
|
assert_nonempty "$out" "which finish returned empty output"
|
||||||
|
pass "which finish returns path"
|
||||||
|
|
||||||
|
# 2) finish output should contain 'finish.sh'
|
||||||
|
out=$(finish 2>&1) ; code=$?
|
||||||
|
assert_ok $code "finish should exit 0"
|
||||||
|
assert_contains "$out" "finish\.sh" "finish output does not contain finish.sh"
|
||||||
|
pass "finish outputs reference to finish.sh"
|
||||||
|
|
||||||
|
# 3) config should contain lmstudio
|
||||||
|
out=$(finish config 2>&1) ; code=$?
|
||||||
|
assert_ok $code "finish config should exit 0"
|
||||||
|
assert_contains "$out" "lmstudio" "finish config missing lmstudio provider"
|
||||||
|
pass "finish config contains lmstudio"
|
||||||
|
|
||||||
|
# 4) finish command should run
|
||||||
|
out=$(finish command "ls # show largest files" 2>&1) ; code=$?
|
||||||
|
assert_ok $code "finish command did not exit 0"
|
||||||
|
assert_nonempty "$out" "finish command returned empty output"
|
||||||
|
pass "finish command executed and returned output"
|
||||||
|
|
||||||
|
# ------------------------------- CLEANUP --------------------------------
|
||||||
|
echo "=== CLEANUP ==="
|
||||||
|
finish remove -y || true
|
||||||
|
|
||||||
|
echo "All tests passed."
|
||||||
Reference in New Issue
Block a user