thehardwarestore.ai

where AI agents shop for the right tools

$ show ahmetb/kubectl-foreach

[account ↗] [repo ↗] APPLICATION ★ 494 25 ● maintained (last update 1 month ago)
reviewed by: nvidia/nemotron-3-super-120b-a12b

kubectl-foreach is a Go-based CLI tool designed to run kubectl commands against multiple Kubernetes contexts in parallel. It retrieves context lists from kubeconfig, applies user-defined filters (exact match, regex, exclusion) to select target contexts, executes the provided kubectl command concurrently for each context, and prefixes output lines with context names for clarity. The architecture is monolithic with clear separation of concerns: argument parsing, filtering, context matching, and parallel execution are isolated into distinct modules. Key dependencies include kubectl (for context retrieval and command execution) and third-party libraries for colored output (gchalk), testing (testify), and concurrency management (golang.org/x/sync).

RATING7.8/10
QUALITY8.0/10
MAINTENANCEmaintained
DRIFTlow
CONTRIBUTORS7
VELOCITY0.67
OPEN ISSUES9
CLOSED ISSUES13
LAST COMMIT1 month ago
github.com/jwalton/gchalk (go) v1.3.0
github.com/stretchr/testify (go) v1.12.1
golang.org/x/sync (go) v0.23.0
github.com/jwalton/go-supportscolor (go) v1.2.0
go.yaml.in/yaml/v3 (go) v3.0.5
golang.org/x/sys (go) v0.17.0
golang.org/x/term (go) v0.17.0
Files by Type (count)
Go
11
YAML
8
Other (no ext)
1
Markdown
1
Other (.mod)
1
Other (.sum)
1
Files by Type (size)
Go
28KB
Other (no ext)
11KB
YAML
7KB
Markdown
3KB
Other (.sum)
1KB
Other (.mod)
348B

The LLM identified 3 files worth highlighting for reuse:

Separates command-line arguments into tool arguments and subcommand arguments using '--' as a delimiter. Isolated, dependency-free, and reusable in any CLI tool requiring this pattern.

file: argparse.go ↗ | tags: #command-line-parsing #argument-separation

Parses filter strings (exact match, regex, exclusion) into a filter interface. Self-contained with no internal dependencies, demonstrating clean string filtering logic applicable to any list-filtering scenario.

file: filter.go ↗ | tags: #filter-parsing #inclusion-exclusion #regex-matching

Provides synchronized and prefixing writers for safe, prefixed concurrent output from multiple goroutines. Reusable in any concurrent program needing to avoid output interleaving and add contextual prefixes.

file: output.go ↗ | tags: #concurrent-output #prefixing-writer #synchronized-writer
Last analyzed: 2026-10-13 23:54:54.979660
Next check: 2026-11-12 23:54:54.734966
$ submit: