Overview

Ragie CLI is a command-line interface for importing various data formats into Ragie. This guide provides installation instructions, usage examples, and configuration details.

Installation

macOS (Recommended)

Install Ragie CLI using Homebrew:

brew tap ragieai/tap
brew install ragie

Linux (APT Package Manager)

Install Ragie CLI using apt:

curl -1sLf \
  'https://dl.cloudsmith.io/public/ragieai/ragie-repo/setup.deb.sh' \
  | sudo -E bash
sudo apt install ragie

Manual Installation

  1. Ensure you have Go 1.16 or later installed.
  2. Clone the repository:
    git clone https://github.com/ragieai/ragie-cli.git
    
  3. Build the binary:
  4. cd ragie-cli
    go install
    

Getting Started

Configure API Key

Before using Ragie CLI, set your API key as an environment variable:

export RAGIE_API_KEY=your_api_key_here

Verify Installation

Ensure Ragie CLI is installed correctly by running:

ragie --help

This command should display available options and usage information.

Importing Data

To import data, use the following command format:

ragie import <source> <path-to-file-or-directory> [options]

Example:

ragie import youtube data/youtube.json --dry-run

This will simulate importing YouTube data without making actual changes.

Usage

Importing Data From Other Sources

Import WordPress Data

ragie import wordpress path/to/wordpress.xml [--dry-run] [--delay 2.0] [--partition your-partition]

Import ReadmeIO Data

ragie import readmeio path/to/readme.zip [--dry-run] [--delay 2.0] [--partition your-partition]

Import Files from Directory

ragie import files path/to/directory [--dry-run] [--delay 2.0] [--partition your-partition]

The files importer recursively scans the specified directory and imports all non-empty files with metadata such as:

  • source_type: "files"
  • path: Relative path from the directory
  • extension: File extension
  • size: File size in bytes
  • mod_time: Last modification time

Import Files from ZIP Archive

ragie import zip path/to/archive.zip [--dry-run] [--delay 2.0] [--partition your-partition]

The ZIP importer processes all files within a ZIP archive without extraction, preserving metadata such as:

  • source_type: "zip"
  • path: Path within the ZIP archive
  • size: Uncompressed file size
  • compressed_size: Compressed file size
  • mod_time: Last modification time
  • zip_source: Source ZIP filename

Clearing Documents

ragie clear [--dry-run] [--partition your-partition]

Global Flags

  • --dry-run: Preview changes without execution
  • --delay: Delay between imports in seconds (default: 2.0)
  • --partition: Specify a custom data partition (e.g., "production", "staging", "test")