MCPcopy Create free account
hub / github.com/LegacyCodeHQ/clarity-cli / runSetup

Function runSetup

cmd/setup/setup_cmd.go:26–47  ·  view source on GitHub ↗
(_ *cobra.Command, _ []string)

Source from the content-addressed store, hash-verified

24}
25
26func runSetup(_ *cobra.Command, _ []string) error {
27 repoRoot, err := git.GetRepositoryRoot(".")
28 if err != nil {
29 return fmt.Errorf("not a git repository (use 'git init' to initialize)")
30 }
31
32 // Create/update AGENTS.md
33 created, updated, err := writeAgentsFile(filepath.Join(repoRoot, "AGENTS.md"))
34 if err != nil {
35 return err
36 }
37
38 if created {
39 fmt.Println("✓ Created AGENTS.md with clarity usage instructions")
40 } else if updated {
41 fmt.Println("✓ Updated AGENTS.md with clarity usage instructions")
42 } else {
43 fmt.Println("✓ AGENTS.md already contains clarity usage instructions")
44 }
45
46 return nil
47}
48
49func writeAgentsFile(filename string) (bool, bool, error) {
50 _, err := filepath.Abs(filename)

Callers

nothing calls this directly

Calls 2

GetRepositoryRootFunction · 0.92
writeAgentsFileFunction · 0.85

Tested by

no test coverage detected