You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP β†’
Socket
Book a DemoInstallSign in
Socket

gitdb-cli

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitdb-cli

Production-ready GitHub-backed NoSQL Database with CLI, Shell, and REST API

2.0.0
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
Β 
Created
Source

GitDB - Production-Ready GitHub-Backed NoSQL Database

A production-ready CLI tool and API server for managing a NoSQL database using GitHub repositories as storage. Features both command-line interface and REST API with interactive shell.

πŸš€ Quick Start (Production)

1. Build for Production

npm run build:prod

2. Create Installers (All Platforms)

npm run build:installers

3. Install GitDB

Windows

# Professional MSI Installer (Recommended)
GitDB-2.0.0-x64.msi    # 64-bit Windows
GitDB-2.0.0-x86.msi    # 32-bit Windows

# Or use NSIS installer
GitDB-Setup-v2.0.0.exe

# Or use batch installer
install-gitdb-windows.bat

macOS

# Make executable and run
chmod +x install-gitdb-macos.sh
./install-gitdb-macos.sh

Linux

# Make executable and run
chmod +x install-gitdb-linux.sh
./install-gitdb-linux.sh

4. Start Using GitDB

Start API Server

# Windows
gitdb-server.exe

# Linux/macOS
gitdb-server

Use Interactive Shell

# Windows
gitdb-shell.exe

# Linux/macOS
gitdb-shell

Use CLI

# Windows
gitdb-cli.exe --help

# Linux/macOS
gitdb-cli --help

πŸ“¦ Available Installers

Windows

  • GitDB-2.0.0-x64.msi - Professional MSI installer (64-bit) [RECOMMENDED]
  • GitDB-2.0.0-x86.msi - Professional MSI installer (32-bit)
  • GitDB-Setup-v2.0.0.exe - NSIS installer with PATH integration
  • GitDB-Windows-v2.0.0.zip - Portable package
  • install-gitdb-windows.bat - Batch installer

macOS

  • GitDB-macOS-v2.0.0.zip - Portable package with installer script
  • install-gitdb-macos.sh - Shell installer

Linux

  • GitDB-Linux-v2.0.0.zip - Portable package with installer script
  • install-gitdb-linux.sh - Shell installer

Universal

  • GitDB-Universal-v2.0.0.zip - Cross-platform package
  • GitDB-Portable-v2.0.0.zip - Complete portable package

🐚 Interactive Shell

Start the interactive shell for database operations:

gitdb-shell

Shell Commands

πŸ”— Connection:
  connect <token> <owner> <repo>  Connect to database
  disconnect                     Disconnect from database
  status                         Show connection status

πŸ“ Collections:
  collections                    List all collections
  create-collection <name>       Create a new collection
  delete-collection <name>       Delete a collection
  use <collection>               Set current collection

πŸ“„ Documents:
  docs                           List documents in current collection
  insert <json>                  Insert a new document
  find <id>                      Find document by ID
  update <id> <json>             Update document by ID
  delete <id>                    Delete document by ID

πŸ› οΈ  Utility:
  clear                          Clear screen
  help                           Show this help
  exit, quit                     Exit shell

Example Shell Session

πŸš€ GitDB Shell - GitHub-backed NoSQL Database
gitdb> connect your_token your_username your_repo
βœ… Connected to database: your_username/your_repo
gitdb> create-collection users
βœ… Collection 'users' created successfully
gitdb> use users
πŸ“ Using collection: users
gitdb> insert {"name":"Alice","email":"alice@example.com"}
βœ… Document created with ID: abc123def456
gitdb> find abc123def456
{
  "_id": "abc123def456",
  "name": "Alice",
  "email": "alice@example.com",
  "createdAt": "2024-01-01T12:00:00.000Z"
}
gitdb> update abc123def456 {"email":"alice@new.com"}
βœ… Document updated successfully
gitdb> docs
πŸ“„ Documents in 'users':
  - abc123def456
gitdb> exit
πŸ‘‹ Goodbye!

πŸ–₯️ Command Line Interface

Use the CLI for scripting and automation:

gitdb-cli --help

CLI Commands

# Connect to database
gitdb-cli connect -t <token> -o <owner> -r <repo>

# List collections
gitdb-cli collections

# Create collection
gitdb-cli create-collection <name>

# Delete collection
gitdb-cli delete-collection <name>

# List documents in collection
gitdb-cli documents <collection>

# Create document
gitdb-cli create-doc <collection> '{"name":"John","email":"john@example.com"}'

# Read document
gitdb-cli read-doc <collection> <id>

# Update document
gitdb-cli update-doc <collection> <id> '{"email":"john@new.com"}'

# Delete document
gitdb-cli delete-doc <collection> <id>

# Find documents by query
gitdb-cli find <collection> '{"name":"John"}'

# Show status
gitdb-cli status

🌐 REST API

The API server provides RESTful endpoints for database operations.

Start API Server

gitdb-server

The server will start on port 7896 by default.

Base URL

http://localhost:7896/api/v1

Authentication

First, connect to a database:

POST /api/v1/collections/connect
Content-Type: application/json

{
  "token": "your_github_token",
  "owner": "your_username",
  "repo": "your_repo"
}

Collection Endpoints

List Collections

GET /api/v1/collections

Create Collection

POST /api/v1/collections
Content-Type: application/json

{
  "name": "users"
}

Delete Collection

DELETE /api/v1/collections/users

Get Collection Info

GET /api/v1/collections/users

Document Endpoints

List Documents

GET /api/v1/collections/users/documents

Create Document

POST /api/v1/collections/users/documents
Content-Type: application/json

{
  "name": "Alice",
  "email": "alice@example.com"
}

Get Document

GET /api/v1/collections/users/documents/abc123def456

Update Document

PUT /api/v1/collections/users/documents/abc123def456
Content-Type: application/json

{
  "email": "alice@new.com"
}

Delete Document

DELETE /api/v1/collections/users/documents/abc123def456

Find Documents

POST /api/v1/collections/users/documents/find
Content-Type: application/json

{
  "name": "Alice"
}

πŸ”Œ Backend Integration Examples

Node.js (JavaScript/TypeScript)

Using Axios

const axios = require('axios');

class GitDBClient {
  constructor(baseURL = 'http://localhost:7896/api/v1') {
    this.baseURL = baseURL;
  }

  async connect(token, owner, repo) {
    const response = await axios.post(`${this.baseURL}/collections/connect`, {
      token, owner, repo
    });
    return response.data;
  }

  async createCollection(name) {
    const response = await axios.post(`${this.baseURL}/collections`, { name });
    return response.data;
  }

  async insertDocument(collection, data) {
    const response = await axios.post(`${this.baseURL}/collections/${collection}/documents`, data);
    return response.data;
  }

  async getDocument(collection, id) {
    const response = await axios.get(`${this.baseURL}/collections/${collection}/documents/${id}`);
    return response.data;
  }

  async updateDocument(collection, id, data) {
    const response = await axios.put(`${this.baseURL}/collections/${collection}/documents/${id}`, data);
    return response.data;
  }

  async deleteDocument(collection, id) {
    const response = await axios.delete(`${this.baseURL}/collections/${collection}/documents/${id}`);
    return response.data;
  }
}

// Usage
const gitdb = new GitDBClient();
await gitdb.connect('your_token', 'your_username', 'your_repo');
await gitdb.createCollection('users');
await gitdb.insertDocument('users', { name: 'Alice', email: 'alice@example.com' });

Python

Using Requests

import requests
import json

class GitDBClient:
    def __init__(self, base_url="http://localhost:7896/api/v1"):
        self.base_url = base_url
        self.session = requests.Session()
        self.session.headers.update({'Content-Type': 'application/json'})

    def connect(self, token, owner, repo):
        response = self.session.post(f"{self.base_url}/collections/connect", 
                                   json={'token': token, 'owner': owner, 'repo': repo})
        return response.json()

    def create_collection(self, name):
        response = self.session.post(f"{self.base_url}/collections", json={'name': name})
        return response.json()

    def insert_document(self, collection, data):
        response = self.session.post(f"{self.base_url}/collections/{collection}/documents", 
                                   json=data)
        return response.json()

    def get_document(self, collection, doc_id):
        response = self.session.get(f"{self.base_url}/collections/{collection}/documents/{doc_id}")
        return response.json()

    def update_document(self, collection, doc_id, data):
        response = self.session.put(f"{self.base_url}/collections/{collection}/documents/{doc_id}", 
                                  json=data)
        return response.json()

    def delete_document(self, collection, doc_id):
        response = self.session.delete(f"{self.base_url}/collections/{collection}/documents/{doc_id}")
        return response.json()

# Usage
gitdb = GitDBClient()
gitdb.connect('your_token', 'your_username', 'your_repo')
gitdb.create_collection('users')
gitdb.insert_document('users', {'name': 'Alice', 'email': 'alice@example.com'})

πŸ—οΈ Development

Project Structure

src/
β”œβ”€β”€ api/           # REST API routes
β”œβ”€β”€ core/          # Database manager and CRUD operations
β”œβ”€β”€ github/        # GitHub API integration
β”œβ”€β”€ models/        # Data models
β”œβ”€β”€ utils/         # Utility functions
β”œβ”€β”€ config/        # Configuration files
β”œβ”€β”€ cli.ts         # Command-line interface
β”œβ”€β”€ shell.ts       # Interactive shell
└── server.ts      # API server

Available Scripts

  • npm run build - Build TypeScript to JavaScript
  • npm run build:prod - Complete production build
  • npm run build:installers - Build all installers
  • npm run dev - Start development server with hot reload
  • npm run start - Start production server
  • npm run shell - Start interactive shell
  • npm run cli - Run CLI commands
  • npm run clean - Clean build directory

πŸ”’ Security

  • GitHub tokens are only used for API calls and never stored permanently
  • All operations are logged for audit purposes
  • Connection state is maintained in memory only
  • Production configuration includes rate limiting and security headers

πŸ“ License

MIT

πŸ†• Version 2.0.0 - Production Release

What's New

  • βœ… Production-ready build system
  • βœ… Cross-platform installers (Windows, macOS, Linux)
  • βœ… Standalone executables
  • βœ… Optimized TypeScript configuration
  • βœ… Comprehensive installer scripts
  • βœ… Portable packages
  • βœ… Simplified installation process

Installation Packages

  • Windows: NSIS installer, batch installer, portable ZIP
  • macOS: Shell installer, portable ZIP
  • Linux: Shell installer, portable ZIP
  • Universal: Cross-platform package with all installers

Keywords

nosql

FAQs

Package last updated on 07 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts