Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
add setup_cli.sh (oops) (#941)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryjliu authored Feb 10, 2024
1 parent ec27ff1 commit 92cbd57
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions llama_hub/llama_packs/rag_cli_local/setup_cli.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# rename this to whatever you want
CLI_NAME="lcli_local"

# Define the path for the new command script
# RENAME lcli
COMMAND_SCRIPT="/usr/local/bin/$CLI_NAME"

# Check if the script is run as root
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi

# Get the full path to base.py dynamically
SCRIPT_DIR=$(pwd)
FULL_PATH_TO_BASE_PY="$SCRIPT_DIR/base.py"

# Create the wrapper script
echo '#!/bin/bash' > "$COMMAND_SCRIPT"
echo "python $FULL_PATH_TO_BASE_PY \"\$@\"" >> "$COMMAND_SCRIPT"

# Make the wrapper script executable
chmod +x "$COMMAND_SCRIPT"

echo "$CLI_NAME command is now available."

0 comments on commit 92cbd57

Please sign in to comment.