Visualize and explore complex data structures — right from your terminal. Cosmo is a fast, interactive graph visualizer that makes graphs and trees easy to understand, beautifully arranged, and fully explorable without ever leaving your command line.


Why Build Cosmo?

When working with complex data structures — trees, dependency maps, object graphs — it’s too easy to get lost. Most visualizers need a GUI, a canvas, or complex positioning logic. But what if all that could just appear in your terminal?

That’s what Cosmo does. You feed it nodes and edges — and it automatically computes a clear, readable layout.

No coordinates. No configuration. Just render and explore.

Pan or search across your data. Every interaction is optimized for terminal fluidity — it feels like a minimal, responsive GUI built on ASCII art.


Render Graphs Programmatically

Cosmo works seamlessly as part of your workflow. Pass your data structures directly from code and see them come to life:

import { cosmo } from "cosmo-flow";

const nodes = [
  { id: "1", value: "Root" },
  { id: "2", value: "Child" },
  { id: "3", value: "Leaf" },
];
const edges = [
  { id: "1-2", source: "1", target: "2" },
  { id: "2-3", source: "2", target: "3" },
];

cosmo({ nodes, edges });

No need to predefine coordinates or specify layout rules — Cosmo handles positioning automatically, ensuring a clean, balanced visual every time.


Graphs from Files

Cosmo can also visualize graphs from JSON or YAML files with zero setup. Just run:

$ cosmo --file path/to/graph.json

Alternatively, Cosmo has a built-in file explorer lets you browse and search your filesystem for graph files — so you can open and switch files without leaving the terminal.

Explore, Search, Navigate

Once running, navigation is effortless:

With built-in color themes like aura, dracula, atom, and catppuccin, you can adapt the visualization to your preferred terminal look.


Behind the Scenes

Cosmo uses a modern rendering layer built on react-curse, enabling smooth interactivity in a purely terminal environment. This makes it fast enough to handle large data sets while maintaining clarity and aesthetics.


Upcoming features include:


Why You’ll Love It

If you’ve ever wanted to see your data structures instead of imagining them, Cosmo gives you that instant clarity — directly in your terminal session. It’s simple, elegant, and fits naturally into any developer workflow.

Explore the full project on GitHub:https://github.com/turutupa/cosmo