Skip to content

REPL (interactive shell)

It is possible to run an interactive shell synced with the currect client code to test and debug it:

Terminal window
npx ts-node --project tsconfig.json

This shell allows executing typescript and javascript code line by line:

import { GlideClient, GlideClusterClient } from ".";
let client = await GlideClient.createClient({
addresses: [{ host: "localhost", port: 6379 }],
});
let clusterClient = await GlideClusterClient.createClient({
addresses: [{ host: "localhost", port: 7000 }],
});
await client.ping();

After applying changes in client code you need to restart the shell.

It has command history and bash-like search (Ctrl+R).

Shell hangs on exit (Ctrl+D) if you don’t close the clients. Use Ctrl+C to kill it and/or close clients before exit.