Skip to content

Third-Party Dependencies Reference

This document catalogs every direct third-party dependency used by the sap-devs CLI, explaining what it does, why it was chosen, and where it is used. Indirect (transitive) dependencies are excluded unless they warrant special mention.

All dependencies are listed in go.mod. Go standard library and golang.org/x/* extended-standard packages are listed in a separate section at the end.


CLI Framework

cobra — github.com/spf13/cobra v1.10.2

WhatCLI command framework with subcommand routing, flag parsing, help generation, and shell completion
WhyIndustry-standard Go CLI library; handles the entire command tree, flag binding, argument validation, and auto-generated help/usage text
WhereEvery file in cmd/ — each command is a *cobra.Command registered on the root
Sub-packagesRoot only

pflag — github.com/spf13/pflag v1.0.10

WhatPOSIX-compliant flag parsing (drop-in replacement for Go's flag package)
WhyRequired by cobra for flag binding; one direct import in tests for flag set manipulation
WhereTransitively via cobra in all commands; directly in cmd/config_token_test.go
Sub-packagesRoot only

Terminal UI (TUI)

The TUI stack is built on the Charm ecosystem. Five Charm packages are used directly, plus two versions of lipgloss (see note below).

bubbletea — github.com/charmbracelet/bubbletea v1.3.10

WhatElm-architecture terminal UI framework (Model → Update → View loop)
WhyPowers all interactive terminal experiences: progress displays, the content editor, the tutorial step-through TUI
Whereinternal/ui/progress.go (sync marker progress), internal/editor/editor.go (content editor model), internal/editor/diff.go (diff view model), internal/editor/list.go (list view model), cmd/tutorial_tui.go (interactive tutorial runner)
Sub-packagesRoot only (aliased as tea)

huh — charm.land/huh/v2 v2.0.3

WhatHigh-level form/prompt library built on bubbletea v2
WhyProvides themed, accessible form inputs (text fields, selects, confirms, multi-selects) without hand-building bubbletea models for each form
Wherecmd/config_edit.go (config editing form), cmd/content_edit.go (content editing form), internal/editor/form.go (schema-driven form generation), internal/editor/editor.go (editor form interactions), internal/editor/bulk.go (bulk editing forms), internal/theme/fiori.go (Fiori theme definition)
Sub-packagesRoot only

glamour — github.com/charmbracelet/glamour v1.0.0

WhatTerminal markdown renderer with syntax highlighting and word wrapping
WhyRenders markdown content (tutorials, tips, learning paths) as styled terminal output instead of raw text
Wherecmd/tutorials.go, cmd/tutorial_tui.go, cmd/tip.go, cmd/learning.go, cmd/learn_path.go
API usedglamour.NewTermRenderer(glamour.WithAutoStyle(), glamour.WithWordWrap(80)) and glamour.Render(md, "dark")
Sub-packagesRoot only

lipgloss v1 — github.com/charmbracelet/lipgloss v1.1.1

WhatTerminal text styling and layout (colors, borders, padding, alignment)
WhyUsed for all styled terminal output in the editor's list/diff views and theme style exports
Whereinternal/theme/fiori.go (aliased as lipglossv1 — style factory functions for selected rows, headers, layer badges, diff colors), internal/editor/diff.go, internal/editor/list.go
Sub-packagesRoot only

lipgloss v2 — charm.land/lipgloss/v2 v2.0.1

WhatNext-generation lipgloss with the charm.land module path, required by huh v2
Whyhuh v2 builds on the v2 style API; the SAP Fiori theme defines its color palette using v2 types
Whereinternal/theme/fiori.go (color constants: FioriBackground, FioriBlue, etc.; border styles in ThemeFiori())
Sub-packagesRoot only

Why two lipgloss versions? The huh v2 form library (charm.land/huh/v2) depends on lipgloss v2 (charm.land/lipgloss/v2) for its theming system. Meanwhile, the editor's list and diff views were built with lipgloss v1 (github.com/charmbracelet/lipgloss), which bubbletea v1 depends on. Both coexist without conflict because Go treats different module paths as separate packages. In internal/theme/fiori.go, v2 is the default import and v1 is aliased as lipglossv1.


HTML & Markup Processing

html-to-markdown — github.com/JohannesKaufmann/html-to-markdown/v2 v2.5.0

WhatConverts HTML documents to clean Markdown text
WhyTwo use cases: (1) converting fetched SAP Community blog post HTML into readable markdown for the news read command, (2) converting HTML fetched by sync markers into markdown for content injection
Whereinternal/community/community.go (ExtractMarkdown and FetchPostContent), internal/sync/convert.go (convertContent for "markdown" format)
API usedhtmltomarkdown.ConvertString(html)
Sub-packagesRoot only (aliased as htmltomarkdown)
TransitivesPulls in github.com/JohannesKaufmann/dom for DOM traversal

cascadia — github.com/andybalholm/cascadia v1.3.3

WhatCSS selector engine for Go's html.Node tree
WhySync markers can specify a CSS selector to scope HTML extraction to a specific DOM element before conversion (e.g., selector=".main-content"), avoiding navigation/footer noise
Whereinternal/sync/convert.gocascadia.Compile(selector) and cascadia.Query(doc, sel)
Sub-packagesRoot only

yaml.v3 — gopkg.in/yaml.v3 v3.0.1

WhatYAML marshaling/unmarshaling with support for comments, anchors, and ordered maps
WhyAll configuration and content files (pack.yaml, resources.yaml, tools.yaml, mcp.yaml, profiles, config, changelogs) use YAML format
Whereinternal/config/config.go, internal/content/pack.go, internal/content/profile.go, internal/adapter/adapter.go, internal/editor/editor.go, internal/editor/merge.go, internal/scratch/scratch.go, internal/sync/changelog.go, internal/tutorials/parser.go, cmd/content_list.go, cmd/sync.go
Sub-packagesRoot only

MCP (Model Context Protocol)

mcp-go — github.com/mark3labs/mcp-go v0.48.0

WhatGo SDK for the Model Context Protocol — provides server creation, tool registration, and stdio transport
WhyImplements sap-devs mcp serve, which exposes SAP developer knowledge (tips, resources, errors, samples, news, learning) as live MCP tools that AI agents can call on demand
Wherecmd/mcp_serve.go (server startup), internal/mcpserver/server.go (server configuration and tool registration), internal/mcpserver/tools_content.go, internal/mcpserver/tools_resources.go, internal/mcpserver/tools_samples.go, internal/mcpserver/tools_news.go, internal/mcpserver/tools_errors.go, internal/mcpserver/tools_learn.go
Sub-packagesgithub.com/mark3labs/mcp-go/mcp (protocol types, tool definitions), github.com/mark3labs/mcp-go/server (server instance, handler registration, stdio transport)

System Integration

go-keyring — github.com/zalando/go-keyring v0.2.8

WhatCross-platform OS keychain abstraction (macOS Keychain, Windows Credential Manager, Linux Secret Service via D-Bus)
WhySecurely stores GitHub tokens and service-specific API keys without writing plaintext to disk; falls back to a credentials file (mode 0600) when the keychain is unavailable (e.g., headless CI)
Whereinternal/credentials/credentials.gogoKeyring.Get(), goKeyring.Set(), goKeyring.Delete(), goKeyring.ErrNotFound
Sub-packagesRoot only (aliased as goKeyring)
Platform depsLinux: godbus/dbus/v5 for Secret Service. Windows: danieljoos/wincred for Credential Manager.

clipboard — golang.design/x/clipboard v0.7.1

WhatCross-platform clipboard read/write (X11, Wayland, macOS, Windows)
WhyThe clipboard-export adapter type copies rendered SAP developer context to the system clipboard for pasting into AI tools that don't support file injection
Whereinternal/adapter/clipboard.goclipboard.Init(), clipboard.Write(clipboard.FmtText, data)
Sub-packagesRoot only
Platform depsLinux: requires libx11-dev at build time and an X11/Wayland display at runtime. Falls back to printing to stdout when unavailable.

browser — github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c

WhatOpens URLs in the user's default browser (Linux: xdg-open, macOS: open, Windows: rundll32)
WhyEvery browsable command (resources, tutorials, samples, news, events, discovery, learning, influencers, videos) has an open subcommand or --open flag
Wherecmd/resources.go, cmd/tutorials.go, cmd/samples.go, cmd/news.go, cmd/events.go, cmd/discovery.go, cmd/discovery_services.go, cmd/discovery_guidance.go, cmd/learning.go, cmd/learn_path.go, cmd/influencers.go, cmd/videos.go
Sub-packagesRoot only

Testing

testify — github.com/stretchr/testify v1.11.1

WhatTest assertion library providing assert (soft failures) and require (hard failures)
WhyStandard Go testing assertions — cleaner than hand-rolling if got != want { t.Fatalf(...) } for every check
WhereAll *_test.go files across cmd/ and internal/ packages (50+ test files)
Sub-packagesgithub.com/stretchr/testify/assert, github.com/stretchr/testify/require

Go Extended Standard Library (golang.org/x/*)

These are official Go team packages that supplement the standard library. They follow Go's compatibility promise but are versioned separately.

x/net — golang.org/x/net v0.47.0

WhatExtended networking packages including an HTML5-compliant tokenizer/parser
Sub-package usedgolang.org/x/net/html
WhyThe HTML parser is lenient (never fails on malformed HTML), making it suitable for parsing arbitrary web pages fetched by sync markers
Whereinternal/sync/convert.gohtml.Parse(), html.Render(), html.Node tree traversal
AlsoTransitively used by html-to-markdown, glamour, and bluemonday

x/sync — golang.org/x/sync v0.20.0

WhatConcurrency primitives beyond the standard library
Sub-package usedgolang.org/x/sync/errgroup
WhyBounded-concurrency parallel work with error propagation — used for concurrent tutorial sync (5 repos in parallel) and concurrent frontmatter fetch (10 in parallel)
Wherecmd/sync.go — two errgroup.WithContext() groups with SetLimit(5) and SetLimit(10)

x/term — golang.org/x/term v0.37.0

WhatTerminal handling utilities
WhyReadPassword() reads a line of input without echoing it to the terminal — used for interactive token input so credentials are not visible on screen
Wherecmd/config.go, cmd/init.go, cmd/inject.go — all token prompt flows

Notable Transitive Dependencies

These are not directly imported but are worth knowing about because they carry platform-specific requirements or are critical to functionality.

PackagePulled in byPurpose
github.com/alecthomas/chroma/v2glamourSyntax highlighting in terminal markdown rendering
github.com/microcosm-cc/bluemondayglamourHTML sanitization before markdown rendering
github.com/yuin/goldmarkglamourMarkdown parser (CommonMark-compliant)
github.com/danieljoos/wincredgo-keyringWindows Credential Manager backend
github.com/godbus/dbus/v5go-keyringLinux D-Bus client for Secret Service keychain
github.com/atotto/clipboardbubbleteaInternal clipboard for bubbletea's paste handling
github.com/google/uuidmcp-goUUID generation for MCP protocol messages
golang.org/x/exp/shiny, golang.org/x/image, golang.org/x/mobileclipboard (golang.design)Platform windowing/display backends for clipboard access

Summary by Category

CategoryPackagesPurpose
CLI frameworkcobra, pflagCommand routing, flag parsing, help generation
Terminal UIbubbletea, huh, glamour, lipgloss v1, lipgloss v2Interactive forms, progress displays, markdown rendering, text styling
Markup processinghtml-to-markdown, cascadia, yaml.v3, x/net (html)HTML→Markdown conversion, CSS selector scoping, YAML config/content, HTML parsing
MCP protocolmcp-goMCP server for AI agent tool access
System integrationgo-keyring, clipboard, browser, x/termOS keychain, clipboard, browser launch, password input
Concurrencyx/sync (errgroup)Bounded parallel work with error propagation
TestingtestifyAssertions in unit/integration tests

Dependency Count

TypeCount
Direct dependencies18
Indirect (transitive)36
Total54