Skip to content

Commit ac36996

Browse files
mattsilvclaude
andcommitted
Make codesight command run analyze by default without arguments
- Simplify codesight command usage without requiring 'analyze' - Update help documentation to reflect new default behavior - Update CLAUDE.md to document this shortcut command option - Streamline initialization flow when running without arguments 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent bcc9e28 commit ac36996

File tree

3 files changed

+5
-37
lines changed

3 files changed

+5
-37
lines changed

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Current version: 0.1.5
55

66
## Commands
7+
- `./codesight.sh` - Analyze codebase in current directory (shortcut for analyze)
78
- `./codesight.sh init` - Initialize in current directory
89
- `./codesight.sh analyze [directory]` - Analyze codebase (default: current dir)
910
- `./codesight.sh visualize [type]` - Visualize codebase statistics

codesight.sh

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -369,44 +369,9 @@ fi # Close the if false
369369
# Main function
370370
function main() {
371371
if [[ $# -eq 0 ]]; then
372-
# No command provided - run default action
373-
echo "🚀 Running CodeSight..."
374-
375-
# Check if already initialized
376-
if [[ ! -d "$CURRENT_DIR/.codesight" ]]; then
377-
echo "📂 Directory not initialized. Setting up CodeSight..."
378-
init_project
379-
380-
if [[ $? -ne 0 ]]; then
381-
echo "❌ Initialization failed. Please check errors above."
382-
exit 1
383-
fi
384-
385-
echo "✅ Initialization complete."
386-
fi
387-
388-
# Run analyze with default settings
389-
echo "🔍 Analyzing codebase..."
390-
local output_file="$CURRENT_DIR/codesight.txt"
372+
# No command provided - default to analyze on current directory
373+
echo "🔍 Running CodeSight analyze on current directory..."
391374
analyze_codebase
392-
393-
# Ensure the user knows what happened
394-
echo ""
395-
echo "✨ CodeSight process complete!"
396-
echo "📄 Output file: $output_file"
397-
398-
# Confirm clipboard status
399-
if command -v pbcopy &>/dev/null; then
400-
echo "📋 Results copied to clipboard (macOS)"
401-
elif command -v xclip &>/dev/null; then
402-
echo "📋 Results copied to clipboard (Linux)"
403-
elif command -v clip.exe &>/dev/null; then
404-
echo "📋 Results copied to clipboard (Windows)"
405-
else
406-
echo "⚠️ Could not copy to clipboard - no clipboard tool found"
407-
echo " Please manually copy the contents of the output file."
408-
fi
409-
410375
exit 0
411376
fi
412377

commands/help.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ function show_help() {
1111
echo " info Display information about the configuration"
1212
echo " help Show this help message"
1313
echo ""
14+
echo "Note: Running './codesight.sh' with no command will default to 'analyze'"
15+
echo ""
1416
echo "Options for analyze:"
1517
echo " --output FILE Specify output file (default: .codesight/codebase_overview.txt)"
1618
echo " --extensions \"EXT...\" Space-separated list of file extensions (e.g. \".py .js .md\")"

0 commit comments

Comments
 (0)