Expand description
Idempotent free-tier provisioning — the engine behind redisctl cloud workflow quick-database and the cloud_quick_database MCP tool.
provision is pure: given a redis_cloud::CloudClient and QuickDatabaseParams it
creates (or reuses) a free Essentials subscription + database and writes the connection
string to a dotenv file (via super::env_delivery). It has no front-end concerns — no
clap, no exit codes, no spinner — so both the CLI and the MCP server call it directly.
The connection string is written only to the credentials file, never returned in a form
that a caller is expected to print. Failures are typed (QuickDatabaseError) so front
ends can map them to their own contracts (CLI exit codes / MCP tool errors).
Recognizability / safety: the subscription is always named redisctl-<name>. That prefix
is how a re-run finds and reuses its own resource, and it guarantees we never touch a
subscription a human created under a bare name (D6).
Structs§
- Database
Summary - Quick
Database Params - Inputs to
provision. Plain data — front-ends build it from their own arg parsing. - Quick
Database Report - PRD §5.2 report — the agent contract. Serialized verbatim by both front-ends.
Enums§
- Quick
Database Error - Branchable failures for the quick-database flow. Front-ends map these to their own
contracts (see the CLI’s
StructuredError/ the MCP tool error).
Functions§
- existing_
database_ report - Write an EXISTING Essentials database’s credentials to the file, without provisioning.
Identified by subscription + database id;
paramssupplies the output path / variable / wait settings (itsnameis only a report fallback, overridden by the database’s name). - provision
- Create or reuse a free database for
params.nameand deliver its credentials to a file.