kubespy
Copilot instructions3.1k starsChanged 2 months agoApache-2.0View on GitHub
kubespy is a Go-based command-line tool for observing Kubernetes resources in real time. It watches and reports information about Kubernetes resources continuously, derived from work done to make Kubernetes deployments predictable in Pulumi's CLI. Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
We split this copilot-instructions.md into the rules it gives an agent
12 rules. About 0 are common, 4 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 5
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does …
- Distinctive: line 10
ALWAYS: run dependency management first:
- Very specific: line 41
ALWAYS: test basic functionality after making changes by running ./kubespy --help and ./kubespy version
- Very specific: line 46
ALWAYS: run make build and make test_all before committing changes
- Very specific: line 48
DO NOT: run make lint as it will fail due to configuration issues
- Very specific: line 117
ALWAYS: run make ensure if dependencies changed
- Very specific: line 118
ALWAYS: run make build -- ensure it completes without errors in ~1-2 minutes
- Very specific: line 119
ALWAYS: run make test_all -- ensure tests pass in ~15 seconds
- Very specific: line 120
ALWAYS: test ./kubespy --help and ./kubespy version to verify basic functionality
- Very specific: line 121
ALWAYS: test all modified subcommands with --help flag
- Distinctive: line 131
All CLI commands are implemented in cmd/ directory using Cobra framework
- Distinctive: line 134
NEVER CANCEL long-running builds or tests - they have appropriate timeouts built-in
≈ “Common” is an estimate: at least 1 in 5 of the 3,669 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
kubespy: Kubernetes Resource Observer
kubespy is a Go-based command-line tool for observing Kubernetes resources in real time. It watches and reports information about Kubernetes resources continuously, derived from work done to make Kubernetes deployments predictable in Pulumi's CLI.
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
Working Effectively
Bootstrap and Build
- ALWAYS run dependency management first:
make ensure-- downloads dependencies (first time ~25 seconds, subsequent runs <1 second). NEVER CANCEL. Set timeout to 5+ minutes for first run.
- Build the application:
make build-- builds the kubespy binary (first time ~1 minute 20 seconds, subsequent builds ~5-6 seconds). NEVER CANCEL. Set timeout to 3+ minutes.
- Install the application:
make install-- installs to $GOPATH/bin, takes ~5 seconds.
Testing
- Run tests:
make test_all-- runs all tests (takes ~13 seconds first time, <1 second subsequent runs). NEVER CANCEL. Set timeout to 2+ minutes.- NOTE: This project has no actual test files (0% coverage), tests complete quickly but don't validate functionality.
Linting
- Linting is broken in this repository due to deprecated linters in .golangci.yml
make lint-- FAILS due to deprecated linters (deadcode, golint, interfacer, structcheck, varcheck) and Go version compatibility issues- DO NOT attempt to fix the linting configuration unless specifically asked to address linting issues
- The CI pipeline (.github/workflows/ci.yml) does NOT run linting, only build and test
Running kubespy
- ALWAYS build the application first with
make build - Basic commands:
./kubespy --help-- shows available commands./kubespy version-- shows version (returns "dev" for local builds)./kubespy status --help-- help for status watching./kubespy trace --help-- help for resource tracing./kubespy changes --help-- help for change monitoring./kubespy record --help-- help for event recording
Validation
Manual Testing Requirements
- ALWAYS test basic functionality after making changes by running
./kubespy --helpand./kubespy version - Without Kubernetes cluster: kubespy will show error "invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable" - this is expected and correct behavior
- Test all subcommands with --help flag to ensure they display properly
CI Validation
- ALWAYS run
make buildandmake test_allbefore committing changes - The CI (.github/workflows/ci.yml) runs
make buildandmake test_allusing Go 1.24.x on ubuntu-latest - DO NOT run
make lintas it will fail due to configuration issues
Common Tasks
Repository Structure
/home/runner/work/kubespy/kubespy/
├── README.md # Main project documentation
├── CONTRIBUTING.md # Development guidelines
├── Makefile # Build automation
├── go.mod # Go module definition
├── kubespy.go # Main entry point
├── cmd/ # CLI command implementations
│ ├── root.go # Root command and parsing
│ ├── status.go # Status watching command
│ ├── trace.go # Resource tracing command
│ ├── changes.go # Change monitoring command
│ ├── record.go # Event recording command
│ └── version.go # Version command
├── examples/ # Example usage scenarios
│ ├── trivial-pulumi-example/ # Basic Pod example
│ └── trivial-service-trace-example/ # Service tracing example
├── k8sconfig/ # Kubernetes configuration handling
├── k8sobject/ # Kubernetes object utilities
├── pods/ # Pod-specific functionality
├── print/ # Output formatting
├── version/ # Version information
└── watch/ # Resource watching logicKey Commands and Expected Times
# Dependency management (first time: 25 seconds, subsequent: <1 second)
make ensure
# Build process (first time: 1 minute 20 seconds, subsequent: 5-6 seconds) - NEVER CANCEL
make build
# Test suite (first time: 13 seconds, subsequent: <1 second) - NEVER CANCEL
make test_all
# Install binary (5 seconds)
make install
# Run application
./kubespy --help # Immediate
./kubespy version # Immediate, returns "dev"Known Issues and Workarounds
- Linting fails: The .golangci.yml uses deprecated linters. Do not run
make lintunless fixing linting configuration. - No actual tests: The test suite runs but provides 0% coverage as there are no test files with actual test cases.
- Requires Kubernetes: kubespy requires a Kubernetes cluster connection to function. Without it, commands will fail with configuration errors (this is expected).
Go Version Requirements
- Go 1.24 or later required (as specified in go.mod)
- Current CI uses Go 1.24.x
Dependencies
- Uses Go modules for dependency management
- Key dependencies include:
- Kubernetes client-go for cluster interaction
- Cobra for CLI framework
- Various Kubernetes API libraries
- JSON diff libraries for output formatting
Validation Scenarios
After Making Code Changes
- ALWAYS run
make ensureif dependencies changed - ALWAYS run
make build-- ensure it completes without errors in ~1-2 minutes - ALWAYS run
make test_all-- ensure tests pass in ~15 seconds - ALWAYS test
./kubespy --helpand./kubespy versionto verify basic functionality - ALWAYS test all modified subcommands with --help flag
Integration Testing
- kubespy requires a Kubernetes cluster to test full functionality
- Example YAML files are available in examples/ directories for testing
- Basic validation can be done without cluster by checking help output and version
Important Notes
- This is a CLI tool, not a web application
- Primary entry point is kubespy.go which calls cmd.Execute()
- All CLI commands are implemented in cmd/ directory using Cobra framework
- The application watches Kubernetes resources in real-time when connected to a cluster
- Build artifacts include a single binary named "kubespy"
- NEVER CANCEL long-running builds or tests - they have appropriate timeouts built-in
Trending
Quiet this year.about the whole repository
Who's talking about pulumi/kubespy
- A Hacker News story“Show HN: Kubespy, a CLI tool for observing Kubernetes resources in real time”Hacker News · Sep 26, 2018 · 99 points
- A Hacker News story“Kubespy: tools for observing Kubernetes resources in real time”Hacker News · Sep 28, 2018 · 2 points
- techblog-szksh-cloud/techblog-szksh-cloud.github.io“Update dependency aquaproj/aqua-registry to v0.14.4 - autoclosed”GitHub · Nov 18, 2024
- knative-extensions/eventing-kafka-broker“async_prober::probe returns StatusReady instead of StatusUnknown on first invocation”GitHub · Jul 29, 2024
- NixOS/nixpkgs“kubespy: 0.6.2 -> 0.6.3”GitHub · Apr 10, 2024
The biggest 5 of 35 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 35
Talked about on GitHub and Hacker News (35 times).
On GitHub · 33
- Nov 18, 2024Update dependency aquaproj/aqua-registry to v0.14.4 - autoclosed — techblog-szksh-cloud/techblog-szksh-cloud.github.io0 reactions
- Jul 29, 2024async_prober::probe returns StatusReady instead of StatusUnknown on first invocation — knative-extensions/eventing-kafka-broker0 reactions · 1 comment
- Apr 10, 2024kubespy: 0.6.2 -> 0.6.3 — NixOS/nixpkgs0 reactions
- Apr 30, 2023kubespy: 0.6.1 -> 0.6.2 — NixOS/nixpkgs0 reactions
- Sep 7, 2022kubespy: 0.6.0 -> 0.6.1 — NixOS/nixpkgs0 reactions · 1 comment
28 more on GitHub
- Jan 9, 2022chore(deps): update dependency aquaproj/aqua-registry to v0.13.1 — aquaproj/aqua0 reactions
- Dec 28, 2021chore(deps): update dependency aquaproj/aqua-registry to v0.12.2 — suzuki-shunsuke/circleci-config-merge0 reactions
- Dec 12, 2021chore(deps): update dependency aquaproj/aqua-registry to v0.11.3 — aquaproj/aqua-renovate-config0 reactions
- Dec 12, 2021chore(deps): update dependency aquaproj/aqua-registry to v0.11.3 — suzuki-shunsuke/my-aqua-config0 reactions
- Dec 12, 2021chore(deps): update dependency aquaproj/aqua-registry to v0.11.3 — aquaproj/circleci-orb-aqua0 reactions
- Dec 12, 2021chore(deps): update dependency aquaproj/aqua-registry to v0.11.3 — suzuki-shunsuke/katacoda-scenarios0 reactions
- Dec 12, 2021chore(deps): update dependency aquaproj/aqua-registry to v0.11.3 — suzuki-shunsuke/go-timeout0 reactions
- Dec 12, 2021chore(deps): update dependency aquaproj/aqua-registry to v0.11.3 — aquaproj/aqua-registry0 reactions
- Dec 12, 2021Update dependency aquaproj/aqua-registry to v0.11.3 — int128/aqua-action0 reactions
- Dec 12, 2021chore(deps): update dependency aquaproj/aqua-registry to v0.11.3 — suzuki-shunsuke/go-findconfig0 reactions
- Dec 12, 2021chore(deps): update dependency aquaproj/aqua-registry to v0.11.3 — suzuki-shunsuke/cmdx0 reactions
- Dec 12, 2021chore(deps): update dependency aquaproj/aqua-registry to v0.11.3 — suzuki-shunsuke/go-dataeq0 reactions
- Dec 12, 2021chore(deps): update dependency aquaproj/aqua-registry to v0.11.3 — suzuki-shunsuke/github-action-golangci-lint0 reactions
- Dec 12, 2021chore(deps): update dependency aquaproj/aqua-registry to v0.11.3 — aquaproj/aqua0 reactions
- Dec 12, 2021chore(deps): update dependency aquaproj/aqua-registry to v0.11.3 — suzuki-shunsuke/github-action-shellcheck0 reactions
- Dec 12, 2021Update dependency aquaproj/aqua-registry to v0.11.3 — gamoutatsumi/dotfiles0 reactions
- Dec 12, 2021chore(deps): update dependency aquaproj/aqua-registry to v0.11.3 — suzuki-shunsuke/github-action-format0 reactions
- Dec 11, 2021feat: add `pulumi/kubespy` — aquaproj/aqua-registry0 reactions
- Dec 6, 2021Add kubespy — aquaproj/aqua-registry0 reactions
- Oct 12, 2021Kubernetes Tools — HarshadRanganathan/harshadranganathan.github.io0 reactions · 2 comments
- Jan 9, 2021Add GitLab example argo app — adamrushuk/devops-lab0 reactions
- Nov 16, 2020Add kubespy — nicholasdille/packages0 reactions
- Nov 15, 2020Add kubespy — nicholasdille/packages0 reactions
- Oct 18, 2020kubespy: 0.5.1 -> 0.6.0 — NixOS/nixpkgs0 reactions
- Sep 25, 2020Tricked Out k8s CLI Experience Part 2 — seanmalloy/dotfiles0 reactions
- Jul 3, 2020add kubespy — NixOS/nixpkgs0 reactions
- Oct 5, 2018pkg: kubespy — jokeyrhyme/dotfiles-rs0 reactions · 1 comment
- Oct 2, 2018Add https://github.com/pulumi/kubespy — ad-si/CliAppStore0 reactions
On Hacker News · 2
- Sep 26, 2018Show HN: Kubespy, a CLI tool for observing Kubernetes resources in real time99 points · 3 comments
- Sep 28, 2018Kubespy: tools for observing Kubernetes resources in real time2 points
Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.
Of the Copilot instructions files we read, the 2,297 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

