-
Notifications
You must be signed in to change notification settings - Fork 7
fix: route slash commands through cli.sh so uv is on PATH #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| --- | ||
| description: Delete ALL reflexio interactions, profiles, and user playbooks (destructive) | ||
| allowed-tools: Bash(uv run:*) | ||
| allowed-tools: Bash(bash:*) | ||
| --- | ||
|
|
||
| Run this bash command and show its output verbatim: | ||
|
|
||
| !`uv run --project "$HOME/.reflexio/plugin-root" --quiet python -m claude_smart.cli clear-all --yes` | ||
| !`bash "$HOME/.reflexio/plugin-root/scripts/cli.sh" clear-all --yes` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| --- | ||
| description: Flag the last turn as a correction so reflexio learns from it | ||
| allowed-tools: Bash(uv run:*) | ||
| allowed-tools: Bash(bash:*) | ||
| argument-hint: [note] | ||
| --- | ||
|
|
||
| Flag the user's previous turn as a correction and force reflexio to run extraction on this session's interactions now. | ||
| Run the bash command below and show its output verbatim. | ||
|
|
||
| !`uv run --project "$HOME/.reflexio/plugin-root" --quiet python -m claude_smart.cli learn "$ARGUMENTS"` | ||
| !`bash "$HOME/.reflexio/plugin-root/scripts/cli.sh" learn "$ARGUMENTS"` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| --- | ||
| description: Restart the reflexio backend and dashboard to pick up new changes | ||
| allowed-tools: Bash(uv run:*) | ||
| allowed-tools: Bash(bash:*) | ||
| --- | ||
|
|
||
| Run this bash command and show its output verbatim: | ||
|
|
||
| !`uv run --project "$HOME/.reflexio/plugin-root" --quiet python -m claude_smart.cli restart` | ||
| !`bash "$HOME/.reflexio/plugin-root/scripts/cli.sh" restart` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| --- | ||
| description: Show the current project playbook and session user profiles | ||
| allowed-tools: Bash(uv run:*) | ||
| allowed-tools: Bash(bash:*) | ||
| --- | ||
|
|
||
| Run this bash command and show its output verbatim: | ||
|
|
||
| !`uv run --project "$HOME/.reflexio/plugin-root" --quiet python -m claude_smart.cli show` | ||
| !`bash "$HOME/.reflexio/plugin-root/scripts/cli.sh" show` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| #!/usr/bin/env bash | ||
| # Wrapper for slash commands that invoke the claude_smart CLI via uv. | ||
| # Claude Code runs `!` bash directives in slash command .md files in a | ||
| # non-interactive, non-login shell that does NOT source ~/.zshrc or | ||
| # ~/.bash_profile. As a result, binaries installed by smart-install.sh | ||
| # at ~/.local/bin (e.g. uv from the astral.sh installer) are invisible | ||
| # to those directives until the user manually re-sources their shell rc. | ||
| # This wrapper bootstraps PATH the same way hook_entry.sh does so the | ||
| # slash commands work on a fresh install. | ||
| set -eu | ||
|
|
||
| HERE="$(cd "$(dirname "$0")" && pwd)" | ||
| # shellcheck source=_lib.sh | ||
| . "$HERE/_lib.sh" | ||
| claude_smart_source_login_path | ||
| claude_smart_prepend_astral_bins | ||
|
|
||
| PLUGIN_ROOT="$(cd "$HERE/.." && pwd)" | ||
|
|
||
| # If the Setup hook recorded an install failure, surface that reason | ||
| # instead of falling through to a generic "uv not found" — mirrors the | ||
| # branch at hook_entry.sh so slash commands and hooks behave consistently | ||
| # on a broken install. | ||
| FAILURE_MARKER="$HOME/.claude-smart/install-failed" | ||
| if [ -f "$FAILURE_MARKER" ]; then | ||
| msg="$(cat "$FAILURE_MARKER" 2>/dev/null || echo "")" | ||
| [ -n "$msg" ] || msg="unknown error" | ||
| echo "claude-smart is not installed correctly: $msg" >&2 | ||
| echo "Re-run the plugin's Setup (restart Claude Code) or fix the underlying issue and delete $FAILURE_MARKER to retry." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if ! command -v uv >/dev/null 2>&1; then | ||
| echo "claude-smart: 'uv' not found on PATH." >&2 | ||
| echo "Install it from https://docs.astral.sh/uv/ or restart Claude Code so the Setup hook can install it." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| exec uv run --project "$PLUGIN_ROOT" --quiet python -m claude_smart.cli "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: ReflexioAI/claude-smart
Length of output: 939
🏁 Script executed:
sed -n '235,260p' plugin/src/claude_smart/reflexio_adapter.pyRepository: ReflexioAI/claude-smart
Length of output: 957
Update test mocks to provide
search_user_profiles()instead ofsearch_profiles().The adapter's
search_profiles()method now callsclient.search_user_profiles()internally, but test mocks intests/test_adapter.pystill only definesearch_profiles(). This causes anAttributeErrorwhen tests run, which the silent exception handler at lines 197–201 and 255–259 catches and converts to an empty list. Tests pass, but the integration with the actual client API is never validated. Update the mock definitions at lines 35, 128, 182, and 198 to exposesearch_user_profiles()instead, or add both methods for compatibility.Also applies to: 253–259
🤖 Prompt for AI Agents