Git Product home page Git Product logo

redfish's Introduction

redfish

redfish lets you use Redis, Valkey (an open-source fork of Redis), KeyDB, and other compatible databases from the fish shell.

redfish is a wrapper around redis-cli and compatible clients. It acts as a partial general-purpose Redis/Valkey/KeyDB/etc. client library. The use of a *-cli binary imposes limitations on what data redfish can store. Line feeds are not allowed in values. It can load and store simple values and also fish lists as database lists.

Contents

Requirements

  • fish 3.4 or later. Earlier versions will not work.
  • redis-cli(1), valkey-cli(1), keydb-cli(1), or another compatible client.
  • A Redis, Valkey, KeyDB, or another server compatible with the client (the default local server by default).

Usage

usage: redfish command [ARG ...]
       redfish del [-v|--verbose] KEY [KEY ...]
       redfish exists KEY
       redfish get [-r|--raw] KEY
       redfish get-list VAR KEY
       redfish incr KEY [INCREMENT]
       redfish keys PATTERN
       redfish set KEY VALUE
       redfish set-list KEY [VALUE ...]

See example.fish for an example of how you can use redfish.

Optionally, set the variable __redfish_client_command in your shell to use a different client than redis-cli or to pass arguments to the client.

Installation

Using Fisher

To install redfish with Fisher, run the command:

fisher install dbohdan/redfish

Manual

  1. Clone the repository or download and extract a source archive.
  2. Run install.fish.

Motivation

I wrote redfish as another way to have associative arrays or dictionaries in fish. Using redfish requires you to keep its limitations in mind. Shelling out to *-cli makes data access slow. A fun aspect of using a networked data store is that it essentially gives you universal variables, only available over the network and not just to fish. If you don't need this aspect, another dictionary implementation is probably better.

Problems with complex scripting in fish

When writing redfish and example.fish, I discovered that several aspects of the language design invited bugs and made development distinctly less fun for me. My experience has lead me to believe that you shouldn't write complex scripts in fish. Make no mistake: I still very much like fish as an interactive shell. I have written about my problems with the language.

License

MIT.

redfish's People

Contributors

dbohdan avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.