-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdemo-cli.sh
More file actions
executable file
·65 lines (56 loc) · 2.15 KB
/
Copy pathdemo-cli.sh
File metadata and controls
executable file
·65 lines (56 loc) · 2.15 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
#!/bin/bash
echo "🚀 LinkedIn PDF Parser CLI Demo"
echo "==============================="
echo
# Test CLI help
echo "📋 1. Showing help:"
node bin/cli.js --help
echo
# Test with Profile.pdf in compact mode
echo "📄 2. Parsing Profile.pdf (compact mode):"
echo "node bin/cli.js \"/Users/arkady/Downloads/Profile.pdf\" --compact"
echo
echo "Output (first 300 characters):"
node bin/cli.js "/Users/arkady/Downloads/Profile.pdf" --compact | head -c 300
echo "..."
echo
# Test with Profile (1).pdf showing just structure
echo "📄 3. Parsing Profile (1).pdf (structured output):"
echo "node bin/cli.js \"/Users/arkady/Downloads/Profile (1).pdf\""
echo
echo "Key fields extracted:"
RESULT=$(node bin/cli.js "/Users/arkady/Downloads/Profile (1).pdf" --compact)
echo "Name: $(echo $RESULT | grep -o '"name":"[^"]*"' | cut -d'"' -f4)"
echo "Email: $(echo $RESULT | grep -o '"email":"[^"]*"' | cut -d'"' -f4)"
echo "Location: $(echo $RESULT | grep -o '"location":"[^"]*"' | cut -d'"' -f4)"
echo "Skills count: $(echo $RESULT | grep -o '"top_skills":\[[^\]]*\]' | grep -o ',' | wc -l | xargs expr 1 +)"
echo "Experience count: $(echo $RESULT | grep -o '"experience":\[[^\]]*\]' | grep -o '"title":' | wc -l)"
echo
# Test error handling
echo "🚨 4. Error handling examples:"
echo
echo " a) Non-existent file:"
echo " node bin/cli.js non-existent.pdf"
node bin/cli.js non-existent.pdf 2>&1 || true
echo
echo " b) Non-PDF file:"
echo " node bin/cli.js package.json"
node bin/cli.js package.json 2>&1 || true
echo
# Usage examples
echo "💡 5. Real-world usage examples:"
echo " # Save to file:"
echo " linkedin-pdf-parser resume.pdf > profile-data.json"
echo
echo " # Extract specific data (with jq):"
echo " linkedin-pdf-parser resume.pdf | jq '.profile.name'"
echo " linkedin-pdf-parser resume.pdf | jq '.profile.contact.email'"
echo " linkedin-pdf-parser resume.pdf | jq '.profile.experience[].company'"
echo
echo " # Process multiple files:"
echo " for pdf in *.pdf; do"
echo " linkedin-pdf-parser \"\$pdf\" --compact > \"\${pdf%.pdf}.json\""
echo " done"
echo
echo "✅ CLI Demo completed successfully!"
echo "📖 See CLI_USAGE.md for complete documentation"