-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.sh
More file actions
executable file
·99 lines (86 loc) · 2.36 KB
/
demo.sh
File metadata and controls
executable file
·99 lines (86 loc) · 2.36 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/bash
# Demo script for Copybuffer
# This script demonstrates the basic features of Copybuffer
echo "======================================"
echo " Copybuffer Demo Script"
echo "======================================"
echo ""
# Check if copybuffer is built
if [ ! -f "dist/cli.js" ]; then
echo "Building Copybuffer..."
npm run build
echo ""
fi
echo "1. Checking configuration..."
node dist/cli.js config
echo ""
echo "2. Simulating some clipboard entries..."
# Since we can't actually copy to clipboard in this environment,
# we'll manually create some test entries
cat > /tmp/test-clipboard-import.json << 'EOF'
[
{
"id": "demo-001",
"content": "Hello from Copybuffer! This is a test entry.",
"timestamp": 1698601200000,
"type": "text"
},
{
"id": "demo-002",
"content": "https://github.com/dev31sanghvi/Copybuffer",
"timestamp": 1698601260000,
"type": "text"
},
{
"id": "demo-003",
"content": "const greeting = 'Hello World';",
"timestamp": 1698601320000,
"type": "text",
"tags": ["code", "javascript"]
},
{
"id": "demo-004",
"content": "npm install copybuffer",
"timestamp": 1698601380000,
"type": "text",
"tags": ["command"]
},
{
"id": "demo-005",
"content": "Smart clipboard manager for developers",
"timestamp": 1698601440000,
"type": "text"
}
]
EOF
echo "3. Importing demo clipboard entries..."
node dist/cli.js import /tmp/test-clipboard-import.json
echo ""
echo "4. Listing clipboard history..."
node dist/cli.js list
echo ""
echo "5. Searching for 'github'..."
node dist/cli.js search "github"
echo ""
echo "6. Searching for 'npm'..."
node dist/cli.js search "npm"
echo ""
echo "7. Exporting clipboard history..."
node dist/cli.js export /tmp/copybuffer-export.json
echo "Exported to: /tmp/copybuffer-export.json"
echo ""
echo "8. Showing exported file..."
cat /tmp/copybuffer-export.json | head -20
echo "..."
echo ""
echo "======================================"
echo " Demo Complete!"
echo "======================================"
echo ""
echo "Try these commands yourself:"
echo " copybuffer list - List clipboard history"
echo " copybuffer search 'text' - Search clipboard"
echo " copybuffer start - Start monitoring"
echo " copybuffer --help - Show all commands"
echo ""
echo "For more examples, see EXAMPLES.md"