-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathclaude-flow
More file actions
executable file
·34 lines (27 loc) · 1.01 KB
/
claude-flow
File metadata and controls
executable file
·34 lines (27 loc) · 1.01 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
#!/usr/bin/env bash
# Claude-Flow local wrapper
# This script ensures claude-flow runs from your project directory
# Save the current directory
PROJECT_DIR="${PWD}"
# Set environment to ensure correct working directory
export PWD="${PROJECT_DIR}"
export CLAUDE_WORKING_DIR="${PROJECT_DIR}"
# Try to find claude-flow binary
# Check common locations for npm/npx installations
# 1. Local node_modules (npm install claude-flow)
if [ -f "${PROJECT_DIR}/node_modules/.bin/claude-flow" ]; then
cd "${PROJECT_DIR}"
exec "${PROJECT_DIR}/node_modules/.bin/claude-flow" "$@"
# 2. Parent directory node_modules (monorepo setup)
elif [ -f "${PROJECT_DIR}/../node_modules/.bin/claude-flow" ]; then
cd "${PROJECT_DIR}"
exec "${PROJECT_DIR}/../node_modules/.bin/claude-flow" "$@"
# 3. Global installation (npm install -g claude-flow)
elif command -v claude-flow &> /dev/null; then
cd "${PROJECT_DIR}"
exec claude-flow "$@"
# 4. Fallback to npx (will download if needed)
else
cd "${PROJECT_DIR}"
exec npx claude-flow@latest "$@"
fi