Table of Contents
About
This is an early WIP and does not cover even close to all of SurrealDB's features. I wanted a CLI so i just decided to make one. Suggestions and feedback is appreciated!
Current Features
- Run a custom query
- Create, delete and list locally saved queries.
- Automatically parses query parameters when saving a query and prompts you to enter them when you use your query. NOTE( This is rough at best. )
- Config file that can be changed from the cli.
- Query History and history based suggestions ( You can opt out. )
- List defined database tables as a formatted cli table.
Built With
Getting Started
Prerequisites
Any Nerd Font
deno
# MacOS/Linux curl -fsSL https://deno.land/x/install/install.sh | sh
Installation
Run this in your shell
deno install -n surrealcli --allow-write --allow-env --allow-net --allow-read https://github.com/StelmanJones/surrealcli/mod.ts
Initialize SurrealCLI.
IMPORTANT! If you set your password during init, it will be stored in plain text in a config file. You can use the SRCLI_PASS Env variable to override the password in the config.
surrealcli init
Usage
Usage: surrealcli [subcommand]
Version: 0.2.0
Deno: 1.31.2
Typescript: 4.9.4
V8: 11.0.226.19
Description:
An unofficial Command Line Interface for SurrealDB.
Made by StelmanJones.
Options:
-h, --help - Show this help.
-V, --version - Show the version number for this program.
--ns [namespace] - Set the namespace
--db [database] - Set the database
-v, --verbose - Show entire response objects instead of only results.
Commands:
config - Commands related to managing the configuration file.
init - Initialize SurrealCLI and create config file.
tables - View all tables in current database.
query [sub-command] - Commands related to running queries.
completions - Generate shell completions.
Environment variables:
SRCLI_PASS <password> - Overrides password in config file if set.
Examples:
Initialize SurrealCLI: surrealcli init
Examples
surrealcli init
surrealcli config show / set
surrealcli tables
surrealcli query
Issues
See the open issues for a full list of proposed features (and known issues).
Contributing
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue. Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request