# System map — spf13/cobra

> Canonical page: https://codevetter.com/unpack/cobra/system-map

# System map — spf13/cobra

Scanned commit adbc8813901bba65827259daa8e22ff94ec1f30e (2026-07-10). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

The runtime is a library embedded in a consuming application's executable. Command owns the tree, flags, callbacks, context, and streams; separate generators consume that model. Persistent artifacts are explicitly generated files, while execution state lives in memory. Repository automation supplies testing, linting, license checking, dependency updates, and PR labeling.
- The public application entrypoints are Command.Execute, ExecuteC, ExecuteContext, and ExecuteContextC; the user guide places the application's main function outside the library. — [command.go#L1062-1084](https://github.com/spf13/cobra/blob/adbc8813901bba65827259daa8e22ff94ec1f30e/command.go#L1062-L1084) [site/content/user_guide.md#L3-24](https://github.com/spf13/cobra/blob/adbc8813901bba65827259daa8e22ff94ec1f30e/site/content/user_guide.md#L3-L24)
- Command combines command metadata, argument validation, lifecycle callbacks, pflag sets, parent/child links, context, and configurable IO streams. — [command.go#L54-151](https://github.com/spf13/cobra/blob/adbc8813901bba65827259daa8e22ff94ec1f30e/command.go#L54-L151) [command.go#L156-229](https://github.com/spf13/cobra/blob/adbc8813901bba65827259daa8e22ff94ec1f30e/command.go#L156-L229)
- go.mod declares github.com/spf13/cobra with Go 1.15 and dependencies on pflag, mousetrap, go-md2man/v2, and YAML v3. — [go.mod#L1-10](https://github.com/spf13/cobra/blob/adbc8813901bba65827259daa8e22ff94ec1f30e/go.mod#L1-L10)
- The doc package renders the Command model through writer APIs and directory-based tree generators; Markdown uses os.Create, man uses md2man.Render, and YAML uses yaml.Marshal. — [doc/md_docs.go#L133-157](https://github.com/spf13/cobra/blob/adbc8813901bba65827259daa8e22ff94ec1f30e/doc/md_docs.go#L133-L157) [doc/man_docs.go#L100-112](https://github.com/spf13/cobra/blob/adbc8813901bba65827259daa8e22ff94ec1f30e/doc/man_docs.go#L100-L112) [doc/yaml_docs.go#L137-146](https://github.com/spf13/cobra/blob/adbc8813901bba65827259daa8e22ff94ec1f30e/doc/yaml_docs.go#L137-L146)
- Platform build tags select an unset pre-execution hook on non-Windows and an Explorer-launch detection hook using mousetrap on Windows. — [command_notwin.go#L15-20](https://github.com/spf13/cobra/blob/adbc8813901bba65827259daa8e22ff94ec1f30e/command_notwin.go#L15-L20) [command_win.go#L15-40](https://github.com/spf13/cobra/blob/adbc8813901bba65827259daa8e22ff94ec1f30e/command_win.go#L15-L40)
- Makefile exposes formatting, lint, go test, and richgo test targets; both test targets depend on install_deps, which runs go get -v ./.... — [Makefile#L12-32](https://github.com/spf13/cobra/blob/adbc8813901bba65827259daa8e22ff94ec1f30e/Makefile#L12-L32)
- Test CI defines license and lint jobs, Ubuntu/macOS matrices for Go 1.17–1.24, and a Windows MSYS2 job; Unix and Windows jobs invoke make richtest. — [.github/workflows/test.yml#L17-53](https://github.com/spf13/cobra/blob/adbc8813901bba65827259daa8e22ff94ec1f30e/.github/workflows/test.yml#L17-L53) [.github/workflows/test.yml#L56-93](https://github.com/spf13/cobra/blob/adbc8813901bba65827259daa8e22ff94ec1f30e/.github/workflows/test.yml#L56-L93) [.github/workflows/test.yml#L96-130](https://github.com/spf13/cobra/blob/adbc8813901bba65827259daa8e22ff94ec1f30e/.github/workflows/test.yml#L96-L130)
- PR labeling runs actions/labeler on pull_request_target with PR-write permission, while Dependabot schedules weekly Go-module and GitHub Actions updates. — [.github/workflows/labeler.yml#L1-17](https://github.com/spf13/cobra/blob/adbc8813901bba65827259daa8e22ff94ec1f30e/.github/workflows/labeler.yml#L1-L17) [.github/labeler.yml#L1-24](https://github.com/spf13/cobra/blob/adbc8813901bba65827259daa8e22ff94ec1f30e/.github/labeler.yml#L1-L24) [.github/dependabot.yml#L1-12](https://github.com/spf13/cobra/blob/adbc8813901bba65827259daa8e22ff94ec1f30e/.github/dependabot.yml#L1-L12)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
