MCPcopy Index your code
hub / github.com/AvitalTamir/cyphernetes

github.com/AvitalTamir/cyphernetes @v0.18.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.18.2 ↗ · + Follow
2,140 symbols 5,741 edges 96 files 161 documented · 8%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Go Report Card Go Reference License Artifact Hub

logo_sticker_style_small

Cyphernetes Web UI

Cyphernetes turns this: 😣

# Delete all pods that are not running

kubectl get pods --all-namespaces --field-selector 'status.phase!=Running' \
-o 'custom-columns=NAMESPACE:.metadata.namespace,NAME:.metadata.name' \
--no-headers | xargs -L1 -I {} bash -c 'set -- {}; kubectl delete pod $2 -n $1'

Into this: 🤩

// Do the same thing!

MATCH (p:Pod)
WHERE p.status.phase != "Running"
DELETE p;

📚 Documentation

For comprehensive documentation, visit our official documentation site at https://cyphernet.es/docs.

How?

Cyphernetes is a Cypher-inspired query language for Kubernetes. A mixture of ASCII-art, SQL and JSONPath, it lets the user express Kubernetes graph operations in a fun and creative way. Cyphernetes works out-of-the-box with your CRDs, supports multi-cluster queries, and more.

There are multiple ways to run Cyphernetes queries: 1. Using the web client by running cyphernetes web from your terminal, then visiting http://localhost:8080 2. Using the interactive shell by running cyphernetes shell in your terminal 3. Running a single query from the command line by running cyphernetes query "your query" - great for scripting and CI/CD pipelines 4. Creating a Cyphernetes DynamicOperator using the cyphernetes-operator to define powerful Kubernetes workflows on-the-fly 5. Using the Cyphernetes API in your own Go programs.

Examples

// Get the desired and running replicas for all deployments
MATCH (d:Deployment)
RETURN d.spec.replicas AS desiredReplicas, 
       d.status.availableReplicas AS runningReplicas;

{
  "d": [
    {
      "desiredReplicas": 2,
      "name": "coredns",
      "runningReplicas": 2
    }
  ]
}

Query executed in 9.081292ms

Cyphernetes' superpower is understanding the relationships between Kubernetes resource kinds. This feature is expressed using the arrows (->) you see in the example queries. Relationships let us express connected operations in a natural way, and without having to worry about the underlying Kubernetes API:

// This is similar to `kubectl expose`
MATCH (d:Deployment {name: "nginx"})
CREATE (d)->(s:Service);

Created services/nginx

Query executed in 30.692208ms

Get Cyphernetes

Using Homebrew:

brew install cyphernetes

Using go:

go install github.com/avitaltamir/cyphernetes/cmd/cyphernetes@latest

Alternatively, grab a binary from the Releases page.

Development

The Cyphernetes monorepo is a multi-package project that includes the core Cyphernetes Go package, a CLI, a web client, and an operator.

.
├── cmd # The CLI (this is where the cyphernetes binary lives)
│   └── cyphernetes
│       └── ...
├── docs # The cyphernet.es website
│   └── ...
├── operator # The operator
│   └── ...
├── pkg
│   └── core # The core Cyphernetes package (parser and engine behind the language features)
│   └── provider # An interface for different backend implementations
│       └── apiserver # A client for the Kubernetes API server
├── web # The web client
│   └── src
│       └── ...

Prerequisites

  • Go (Latest)
  • Make (for running make commands)
  • NodeJS (Latest, for building the web client)
  • pnpm (9+, for building the web client)

Getting Started

To get started with development:

Clone the repository:

git clone https://github.com/avitaltamir/cyphernetes.git

Navigate to the project directory:

cd cyphernetes

Building the Core Project

Running make will build the operator manifests and web client static assets, then build the binary and run the tests.

make

Building the Web Client

make web-build

Building the Operator

make operator-build

Contributing

Contributions are welcome! Please feel free to submit pull requests, open issues, and provide feedback.

License

Cyphernetes is open-sourced under the Apache 2.0 license. See the LICENSE file for details.

Acknowledgments

Authors

Extension points exported contracts — how you extend this code

Clause (Interface)
Clause is an interface implemented by all clause types [5 implementers]
pkg/core/types.go
Provider (Interface)
Provider defines the interface for different backend implementations [4 implementers]
pkg/provider/interface.go
QueryExecutorInterface (Interface)
(no doc) [2 implementers]
operator/internal/controller/dynamicoperator_controller.go
Listener (Interface)
(no doc)
cmd/cyphernetes/shell.go
AccumulatedResult (Interface)
(no doc)
web/src/App.tsx
GroupVersion (Interface)
(no doc)
pkg/provider/apiserver/provider.go
QueryStatus (Interface)
(no doc)
web/src/App.tsx
AggregateResult (Interface)
(no doc)
web/src/App.tsx

Core symbols most depended-on inside this repo

By
called by 224
cmd/cyphernetes/web/assets/index-aeb8f056.js
debugLog
called by 104
pkg/core/parser.go
n
called by 98
cmd/cyphernetes/web/assets/index-aeb8f056.js
advance
called by 97
pkg/core/parser.go
q
called by 93
cmd/cyphernetes/web/assets/index-aeb8f056.js
a
called by 87
cmd/cyphernetes/web/assets/index-aeb8f056.js
o
called by 85
cmd/cyphernetes/web/assets/index-aeb8f056.js
Error
called by 78
pkg/core/query.go

Shape

Function 1,772
Method 264
Struct 63
Class 20
Interface 17
TypeAlias 4

Languages

TypeScript77%
Go23%

Modules by API surface

cmd/cyphernetes/web/assets/index-aeb8f056.js1,587 symbols
pkg/core/parser.go37 symbols
pkg/provider/apiserver/provider.go31 symbols
pkg/core/types.go28 symbols
operator/internal/controller/dynamicoperator_controller.go26 symbols
cmd/cyphernetes/shell.go25 symbols
cmd/cyphernetes/main_test.go20 symbols
web/src/components/QueryInput.tsx18 symbols
pkg/core/relationship.go15 symbols
docs/src/pages/index.tsx14 symbols
operator/internal/controller/dynamicoperator_controller_test.go13 symbols
cmd/cyphernetes/api.go13 symbols

For agents

$ claude mcp add cyphernetes \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page