rede

command module
v0.0.0-...-58441c9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2026 License: MIT Imports: 7 Imported by: 0

README

rede

rede is a text-based graph database for humans and agents.

Overview

rede stores graphs as plain text files optimized for LLM context windows. It provides:

  • CLI - Command-line interface for database operations
  • TUI - Terminal user interface for browsing and editing
  • MCP Server - stdio-based server for LLM integration

Installation

cd ~/repositories/codeberg.org/curiosa/rede
go build -o ~/go/bin/rede .

Quick Start

# Launch TUI
rede

# Add statements
rede add "Alice knows Bob"
rede add "Alice lives in Lisbon"

# Query
rede query "Alice *"
rede query "* knows Bob"

# List entities
rede list entities

# Export
rede export

Database Location

Default: ~/.local/share/rede/

Use -db <path> for custom locations.

MCP Integration

Configure in ~/.config/opencode/opencode.json:

{
  "mcp": {
    "rede": {
      "type": "local",
      "command": ["/home/brandon/go/bin/rede", "-db", "/home/brandon/.local/share/rede", "mcp", "-stdio"],
      "enabled": true
    }
  }
}

File Format

See SPECIFICATION.md for the complete format specification.

Commands

rede add <statement>           Add a statement
rede remove <pattern>          Remove statements
rede query <pattern>           Query statements
rede list [type]               List entities/relationships/subgraphs
rede export [file]             Export all statements
rede import <file>             Import statements
rede union -db2 <path>         Union with another database
rede diff -db2 <path>          Difference (this db minus other)
rede intersect -db2 <path>     Intersection of databases
rede rename <old> <new>        Rename entity or relationship
rede project <fields>          Project to specified fields
rede restrict <pattern>        Filter by pattern
rede join -db2 <path>          Join databases
rede get-entity <name>         Get entity details
rede set-entity <name> <content>  Create/update entity file
rede create-entity <name>      Create empty entity file
rede get-relationship <name>   Get relationship details
rede set-relationship <name> <content>  Create/update relationship file
rede clean                     Remove test data
rede apply <file.changes>      Apply batch commands
rede mcp                       Start MCP server (HTTP/SSE)
rede mcp -stdio                Start MCP server (stdio)
rede mcp-restart               Restart MCP server
rede mcp-status                Check MCP server status
rede version                   Show version
rede help                      Show help

Statement Syntax

Subject relationship Object
Subject relationship Object [label]
Subject relationship Object @ scope
Subject relationship.              # reflexive
"Multi Word Entity" knows Bob
# Comment

Examples

# Create entity with metadata
rede create-entity Alice
rede set-entity Alice "Alice is a software engineer"

# Add relationships
rede add "Alice works at Acme"
rede add "Alice knows Bob"

# Query with wildcards
rede query "Alice *"          # All Alice statements
rede query "* knows Bob"      # Who knows Bob
rede query "* * Lisbon"       # Everything about Lisbon

# Relational operations
rede union -db2 ./otherdb
rede diff -db2 ./otherdb

# Batch operations with .changes file
rede apply migration.changes

.changes File Format

# Comments start with #
create-entity NewProject
add "Alice works at NewProject"
db /path/to/otherdb
add "Bob knows Alice"

Run commands sequentially with error reporting.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL