-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathmain.go
More file actions
46 lines (38 loc) · 1.01 KB
/
main.go
File metadata and controls
46 lines (38 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
35
36
37
38
39
40
41
42
43
44
45
46
package main
import (
"context"
"devkit-cli/pkg/plugin"
"fmt"
"log"
"os"
"devkit-cli/pkg/commands"
"devkit-cli/pkg/common"
devcontext "devkit-cli/pkg/context"
"devkit-cli/pkg/hooks"
"github.com/urfave/cli/v2"
)
func main() {
ctx := devcontext.WithShutdown(context.Background())
app := &cli.App{
Name: "devkit",
Usage: "EigenLayer Development Kit",
Flags: common.GlobalFlags,
Commands: []*cli.Command{commands.AVSCommand},
UseShortOptionHandling: true,
}
plugins, err := plugin.LoadPlugins("~/.devkit/plugins")
if err != nil {
log.Fatalf("Error loading plugins: %v", err)
}
fmt.Printf("Plugins loaded: %+v\n", plugins)
for _, p := range plugins {
if p != nil {
app.Commands = append(app.Commands, p.GetCommands()...)
}
}
// Apply both middleware functions to all commands
hooks.ApplyMiddleware(app.Commands, hooks.WithEnvLoader, hooks.WithTelemetry)
if err := app.RunContext(ctx, os.Args); err != nil {
log.Fatal(err)
}
}