@raisindb/cli
v0.1.16
Published
Interactive CLI for RaisinDB with Ink-based terminal UI
Maintainers
Readme
@raisindb/cli
Interactive command-line interface for RaisinDB with a beautiful Ink-based terminal UI.
Features
- Interactive shell with command history and autocomplete
- SQL mode with syntax highlighting and multiline support
- Browser-based authentication with OAuth flow
- Package management (create and upload .rap packages)
- Beautiful gradient banner and intuitive UI
- Configuration file support (.raisinrc)
Installation
npm install -g @raisindb/cli
# or
pnpm add -g @raisindb/cliUsage
Interactive Shell (Default)
Start the interactive shell:
raisindb
# or
raisindb shellConnect to a specific server:
raisindb shell --server http://localhost:8080Connect and use a specific database:
raisindb shell --server http://localhost:8080 --database mydbPackage Commands (Offline)
Create a .rap package from a folder:
raisindb package create ./my-package
raisindb package create ./my-package --output my-package.rapUpload a package to the server:
raisindb package upload my-package.rap
raisindb package upload my-package.rap --server http://localhost:8080Shell Commands
Connection & Authentication
/connect <url>- Connect to a RaisinDB server/login- Authenticate via browser (OAuth flow)/logout- Clear stored authentication
Database Operations
use <database>- Switch to a different database/databases- List available databases
SQL Mode
/sql- Enter SQL mode for running queries/exit-sql- Exit SQL mode (also available in SQL mode)
In SQL mode:
- Type queries normally and press Enter for single-line queries
- Omit semicolon to start multiline mode
- Press
Ctrl+Enterto execute multiline queries - Press
ESCto cancel multiline input
Package Management
/packages- List installed packages/install <name>- Install a package by name (installs mixins before node types)/upload [file]- Upload a package file
Other Commands
/help- Show help screen with all commands/clear- Clear the terminal screen/quitor/exit- Exit the CLI
Configuration File
The CLI looks for .raisinrc in the current directory tree, falling back to ~/.raisinrc.
Example .raisinrc:
server: http://localhost:8080
token: your-auth-token
default_repo: mydbConfiguration is automatically updated when you use /connect, /login, or use commands.
Development
Build the package:
pnpm buildRun in development mode:
pnpm devRun the built CLI:
pnpm startArchitecture
The CLI is built with:
- Ink - React for terminal UIs
- Commander - CLI argument parsing
- ink-text-input - Interactive text input
- ink-gradient & ink-big-text - Beautiful banner
- sql-highlight - SQL syntax highlighting
- yaml - Configuration file parsing
- open - Browser launching for OAuth
License
MIT
