-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_cli.sh
More file actions
executable file
·81 lines (67 loc) · 2.55 KB
/
setup_cli.sh
File metadata and controls
executable file
·81 lines (67 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
# Setup script for RMAgent CLI with shell completion
# This script configures direct CLI access and tab completion
set -e
echo "Setting up RMAgent CLI..."
# Ensure package is installed in editable mode
echo "Installing rmagent in editable mode..."
uv pip install -e .
# Detect shell
SHELL_NAME=$(basename "$SHELL")
# Create completion directory if needed
if [ "$SHELL_NAME" = "zsh" ]; then
COMPLETION_DIR="$HOME/.zfunc"
mkdir -p "$COMPLETION_DIR"
echo "Generating zsh completion script..."
_RMAGENT_COMPLETE=zsh_source .venv/bin/rmagent > "$COMPLETION_DIR/_rmagent"
echo ""
echo "✓ Completion script saved to $COMPLETION_DIR/_rmagent"
echo ""
echo "Add the following to your ~/.zshrc:"
echo ""
echo " # RMAgent CLI setup"
echo " export PATH=\"$PWD/.venv/bin:\$PATH\""
echo " fpath=(~/.zfunc \$fpath)"
echo " autoload -Uz compinit && compinit"
echo ""
echo "Then run: source ~/.zshrc"
elif [ "$SHELL_NAME" = "bash" ]; then
COMPLETION_DIR="$HOME/.bash_completion.d"
mkdir -p "$COMPLETION_DIR"
echo "Generating bash completion script..."
_RMAGENT_COMPLETE=bash_source .venv/bin/rmagent > "$COMPLETION_DIR/rmagent"
echo ""
echo "✓ Completion script saved to $COMPLETION_DIR/rmagent"
echo ""
echo "Add the following to your ~/.bashrc:"
echo ""
echo " # RMAgent CLI setup"
echo " export PATH=\"$PWD/.venv/bin:\$PATH\""
echo " source ~/.bash_completion.d/rmagent"
echo ""
echo "Then run: source ~/.bashrc"
elif [ "$SHELL_NAME" = "fish" ]; then
COMPLETION_DIR="$HOME/.config/fish/completions"
mkdir -p "$COMPLETION_DIR"
echo "Generating fish completion script..."
_RMAGENT_COMPLETE=fish_source .venv/bin/rmagent > "$COMPLETION_DIR/rmagent.fish"
echo ""
echo "✓ Completion script saved to $COMPLETION_DIR/rmagent.fish"
echo ""
echo "Add the following to your ~/.config/fish/config.fish:"
echo ""
echo " # RMAgent CLI setup"
echo " set -gx PATH \"$PWD/.venv/bin\" \$PATH"
echo ""
echo "Fish will automatically load completions on next shell start"
fi
echo ""
echo "================================================================"
echo "Setup complete!"
echo ""
echo "After updating your shell configuration, you can use:"
echo " rmagent --help # Show help"
echo " rmagent person 1 # Query person"
echo " rmagent bio 1 # Generate biography"
echo " rmagent <TAB> # See all commands with tab completion"
echo "================================================================"