File size: 3,806 Bytes
1244914
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/usr/bin/env bash
# Script to run all 'forge list' commands with --porcelain flag
# This helps visualize which list types contain $ID columns

set -e

FORGE_BIN="${1:-./target/debug/forge}"

if [ ! -f "$FORGE_BIN" ]; then
    echo "Error: forge binary not found at $FORGE_BIN"
    echo "Usage: $0 [path-to-forge-binary]"
    exit 1
fi

# Color codes for better visibility
BLUE='\033[0;34m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color

print_section() {
    echo ""
    echo -e "${BLUE}═══════════════════════════════════════════════════════════════════${NC}"
    echo -e "${GREEN}$1${NC}"
    echo -e "${BLUE}═══════════════════════════════════════════════════════════════════${NC}"
}

print_command() {
    echo -e "${YELLOW}Command: $1${NC}"
    echo ""
}

print_runtime() {
    local start="$1"
    local end=$(date +%s%N)
    local runtime_ms=$(( (end - start) / 1000000 ))
    
    if [ $runtime_ms -lt 1000 ]; then
        echo -e "${YELLOW}Runtime: ${runtime_ms}ms${NC}"
    else
        local runtime_s=$(echo "scale=2; $runtime_ms / 1000" | bc 2>/dev/null || echo "$((runtime_ms / 1000))")
        echo -e "${YELLOW}Runtime: ${runtime_s}s${NC}"
    fi
    echo ""
}

# Agent list
print_section "AGENTS"
print_command "$FORGE_BIN list agent --porcelain"
start=$(date +%s%N)
$FORGE_BIN list agent --porcelain 2>&1 | head -20 || echo "No agents found"
print_runtime "$start"

# Provider list
print_section "PROVIDERS"
print_command "$FORGE_BIN list provider --porcelain"
start=$(date +%s%N)
$FORGE_BIN list provider --porcelain 2>&1 | head -20 || echo "No providers found"
print_runtime "$start"

# # Model list
# print_section "MODELS"
# print_command "$FORGE_BIN list model --porcelain"
# $FORGE_BIN list model --porcelain 2>&1 | head -20 || echo "No models found"

# Config list
print_section "CONFIG"
print_command "$FORGE_BIN list config --porcelain"
start=$(date +%s%N)
$FORGE_BIN list config --porcelain 2>&1 | head -20 || echo "No config found"
print_runtime "$start"

# MCP servers list
print_section "MCP SERVERS"
print_command "$FORGE_BIN list mcp --porcelain"
start=$(date +%s%N)
$FORGE_BIN list mcp --porcelain 2>&1 | head -20 || echo "No MCP servers found"
print_runtime "$start"

# Conversation list
print_section "CONVERSATIONS"
print_command "$FORGE_BIN list conversation --porcelain"
start=$(date +%s%N)
$FORGE_BIN list conversation --porcelain 2>&1 | head -20 || echo "No conversations found"
print_runtime "$start"

# Custom commands list
print_section "CUSTOM COMMANDS"
print_command "$FORGE_BIN list cmd --porcelain"
start=$(date +%s%N)
$FORGE_BIN list cmd --porcelain 2>&1 | head -20 || echo "No custom commands found"
print_runtime "$start"

# Skills list
print_section "SKILLS"
print_command "$FORGE_BIN list skill --porcelain"
start=$(date +%s%N)
$FORGE_BIN list skill --porcelain 2>&1 | head -20 || echo "No skills found"
print_runtime "$start"

# Summary
print_section "SUMMARY"
echo "List types WITH \$ID column:"
echo "  βœ“ models      - Second column (\$ID) contains display name"
echo "  βœ“ mcp         - First column (\$ID) contains server name"
echo "  βœ“ cmd         - First column (\$ID) contains command name"
echo "  βœ“ skill       - First column (\$ID) contains skill title"
echo ""
echo "List types WITHOUT \$ID column:"
echo "  βœ— agent       - Uses 'ID' (without $) instead"
echo "  βœ— provider    - Column 0 dropped, no \$ID"
echo "  βœ— config      - Uses \$FIELD/\$VALUE format (long format)"
echo "  βœ— conversation - Direct UUID without \$ID label"
echo ""