MCPcopy Create free account
hub / github.com/Facets-cloud/flow / Run

Function Run

internal/app/app.go:16–87  ·  view source on GitHub ↗

Run is the entry point for the CLI. Returns an exit code.

(args []string)

Source from the content-addressed store, hash-verified

14
15// Run is the entry point for the CLI. Returns an exit code.
16func Run(args []string) int {
17 if len(args) == 0 {
18 printUsage()
19 return 0
20 }
21 cmd, rest := args[0], args[1:]
22
23 // Auto-upgrade the skill + SessionStart hook if the binary version
24 // has changed since the last install. Skipped for `init`, `skill`,
25 // and `--version` — those manage the skill themselves or need to
26 // run before any install state exists. See maybeAutoUpgradeSkill.
27 switch cmd {
28 case "init", "skill", "--version", "-v", "version", "-h", "--help", "help", "__auto-exec", "__owner-tick":
29 // no auto-upgrade
30 default:
31 maybeAutoUpgradeSkill()
32 }
33
34 switch cmd {
35 case "--version", "-v", "version":
36 fmt.Println(Version)
37 return 0
38 case "init":
39 return cmdInit(rest)
40 case "add":
41 return cmdAdd(rest)
42 case "do":
43 return cmdDo(rest)
44 case "__auto-exec":
45 // Hidden: the detached supervisor entry point for `flow do --auto`.
46 // Not listed in usage; invoked only by autoLauncher.
47 return cmdAutoExec(rest)
48 case "__owner-tick":
49 // Hidden: the detached owner-tick supervisor. Invoked only by
50 // ownerTickLauncher (via `flow owner tick-due`).
51 return cmdOwnerTick(rest)
52 case "run":
53 return cmdRun(rest)
54 case "done":
55 return cmdDone(rest)
56 case "show":
57 return cmdShow(rest)
58 case "list":
59 return cmdList(rest)
60 case "edit":
61 return cmdEdit(rest)
62 case "update":
63 return cmdUpdate(rest)
64 case "owner":
65 return cmdOwner(rest)
66 case "archive":
67 return cmdArchive(rest)
68 case "unarchive":
69 return cmdUnarchive(rest)
70 case "workdir":
71 return cmdWorkdir(rest)
72 case "skill":
73 return cmdSkill(rest)

Callers 1

mainFunction · 0.92

Calls 15

printUsageFunction · 0.85
maybeAutoUpgradeSkillFunction · 0.85
cmdInitFunction · 0.85
cmdAddFunction · 0.85
cmdDoFunction · 0.85
cmdAutoExecFunction · 0.85
cmdOwnerTickFunction · 0.85
cmdRunFunction · 0.85
cmdDoneFunction · 0.85
cmdShowFunction · 0.85
cmdListFunction · 0.85
cmdEditFunction · 0.85

Tested by

no test coverage detected