feat: update cli to work with up to date developer api#11
Open
alitariksahin wants to merge 18 commits intomainfrom
Open
feat: update cli to work with up to date developer api#11alitariksahin wants to merge 18 commits intomainfrom
alitariksahin wants to merge 18 commits intomainfrom
Conversation
Collaborator
|
let's also document usage with read only token, nothing extra, just mention as a suggested way to use with agents |
CahidArda
reviewed
Mar 30, 2026
Author
|
There was a problem hiding this comment.
Pull request overview
This PR migrates the Upstash CLI from the previous Deno/Cliffy implementation to a Node.js/TypeScript + commander CLI aligned with the current Upstash Developer API, with a strong focus on non-interactive JSON I/O for automation/agents.
Changes:
- Replaces the Deno-based CLI entrypoint, config/auth helpers, and HTTP client with a Node.js (
commander) CLI + shared request/auth/output helpers. - Adds new/updated command implementations for Redis, Team, Vector, Search, and QStash using
/v2/...Developer API endpoints. - Updates packaging/build setup (TypeScript
tsc, npm package metadata) and refreshes docs for the new CLI behavior.
Reviewed changes
Copilot reviewed 93 out of 97 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Adds TypeScript compiler configuration for Node (ESM, Node16 resolution, dist output). |
| src/version.ts | Removes build-time version constant from the old Deno build pipeline. |
| src/util/http.ts | Removes the old Deno/isomorphic-fetch HTTP client wrapper. |
| src/util/command.ts | Removes the Cliffy-based Command wrapper type. |
| src/util/auth.ts | Removes config-file-based Basic auth header generation. |
| src/types.ts | Introduces shared API payload types and allowed-value lists (regions, plans, etc.). |
| src/output.ts | Adds shared JSON stdout printing and JSON stderr error handling. |
| src/mod.ts | Removes the Deno CLI entrypoint. |
| src/deps.ts | Removes Deno URL imports for Cliffy/std libs. |
| src/config.ts | Removes local config file read/write support. |
| src/commands/vector/transfer.ts | Adds vector index transfer command using Developer API. |
| src/commands/vector/stats.ts | Adds vector stats and per-index stats commands. |
| src/commands/vector/set-plan.ts | Adds vector index plan change command. |
| src/commands/vector/reset-password.ts | Adds vector token reset command. |
| src/commands/vector/rename.ts | Adds vector index rename command. |
| src/commands/vector/list.ts | Adds vector index list command. |
| src/commands/vector/index.ts | Registers vector subcommands under upstash vector. |
| src/commands/vector/get.ts | Adds vector index get command. |
| src/commands/vector/delete.ts | Adds vector index delete command (with dry-run). |
| src/commands/vector/create.ts | Adds vector index create command. |
| src/commands/team/remove-member.ts | Adds team member removal command (with dry-run). |
| src/commands/team/remove_member.ts | Removes old Deno/Cliffy team member removal implementation. |
| src/commands/team/mod.ts | Removes old Deno/Cliffy team command module. |
| src/commands/team/members.ts | Adds team member listing command. |
| src/commands/team/list.ts | Reimplements team list using Node + shared request/auth/output. |
| src/commands/team/list_members.ts | Removes old Deno/Cliffy members list implementation. |
| src/commands/team/index.ts | Registers team subcommands under upstash team. |
| src/commands/team/delete.ts | Reimplements team delete using Node + shared request/auth/output (with dry-run). |
| src/commands/team/create.ts | Reimplements team create using Node + shared request/auth/output. |
| src/commands/team/add-member.ts | Adds team member add command with role validation. |
| src/commands/team/add_member.ts | Removes old Deno/Cliffy add-member implementation. |
| src/commands/search/transfer.ts | Adds search index transfer command. |
| src/commands/search/stats.ts | Adds search stats and per-index stats commands. |
| src/commands/search/reset-password.ts | Adds search token reset command. |
| src/commands/search/rename.ts | Adds search index rename command. |
| src/commands/search/list.ts | Adds search index list command. |
| src/commands/search/index.ts | Registers search subcommands under upstash search. |
| src/commands/search/get.ts | Adds search index get command. |
| src/commands/search/delete.ts | Adds search index delete command (with dry-run). |
| src/commands/search/create.ts | Adds search index create command. |
| src/commands/redis/update-regions.ts | Adds Redis read-replica region update command. |
| src/commands/redis/update-budget.ts | Adds Redis budget update command. |
| src/commands/redis/types.ts | Removes old Redis command-local type definition. |
| src/commands/redis/stats.ts | Reimplements Redis stats using Node + shared request/auth/output. |
| src/commands/redis/reset-password.ts | Adds Redis password reset command. |
| src/commands/redis/reset_password.ts | Removes old Deno/Cliffy reset-password implementation. |
| src/commands/redis/rename.ts | Reimplements Redis rename using Node + shared request/auth/output. |
| src/commands/redis/move-to-team.ts | Adds Redis move-to-team command. |
| src/commands/redis/move_to_team.ts | Removes old Deno/Cliffy move-to-team implementation. |
| src/commands/redis/mod.ts | Removes old Deno/Cliffy Redis command module. |
| src/commands/redis/list.ts | Reimplements Redis list using Node + shared request/auth/output. |
| src/commands/redis/index.ts | Registers Redis subcommands under upstash redis. |
| src/commands/redis/get.ts | Reimplements Redis get using Node + shared request/auth/output (+ hide credentials). |
| src/commands/redis/exec.ts | Adds Redis REST exec command (uses DB REST token, not Developer API key). |
| src/commands/redis/enable-tls.ts | Adds Redis enable TLS command. |
| src/commands/redis/enable-eviction.ts | Adds Redis enable eviction command. |
| src/commands/redis/enable-autoupgrade.ts | Adds Redis enable autoupgrade command. |
| src/commands/redis/enable_multizone_replication.ts | Removes old Deno/Cliffy multizone replication command implementation. |
| src/commands/redis/disable-eviction.ts | Adds Redis disable eviction command. |
| src/commands/redis/disable-autoupgrade.ts | Adds Redis disable autoupgrade command. |
| src/commands/redis/delete.ts | Reimplements Redis delete using Node + shared request/auth/output (with dry-run). |
| src/commands/redis/create.ts | Reimplements Redis create using Node + shared request/auth/output. |
| src/commands/redis/change-plan.ts | Adds Redis change-plan command. |
| src/commands/redis/backup/restore.ts | Adds Redis backup restore command. |
| src/commands/redis/backup/list.ts | Adds Redis backup list command. |
| src/commands/redis/backup/index.ts | Registers Redis backup subcommands. |
| src/commands/redis/backup/enable-daily.ts | Adds enable daily backup command. |
| src/commands/redis/backup/disable-daily.ts | Adds disable daily backup command. |
| src/commands/redis/backup/delete.ts | Adds delete backup command (with dry-run). |
| src/commands/redis/backup/create.ts | Adds create backup command. |
| src/commands/qstash/update-budget.ts | Adds QStash budget update command. |
| src/commands/qstash/stats.ts | Adds QStash stats command (with period option). |
| src/commands/qstash/set-plan.ts | Adds QStash set-plan command. |
| src/commands/qstash/rotate-token.ts | Adds QStash rotate-token command. |
| src/commands/qstash/move-to-team.ts | Adds QStash move-to-team command. |
| src/commands/qstash/list.ts | Adds QStash list command. |
| src/commands/qstash/ipv4.ts | Adds QStash ipv4 CIDR listing command. |
| src/commands/qstash/index.ts | Registers QStash subcommands under upstash qstash. |
| src/commands/qstash/get.ts | Adds QStash get command. |
| src/commands/qstash/enable-prodpack.ts | Adds QStash enable-prodpack command. |
| src/commands/qstash/disable-prodpack.ts | Adds QStash disable-prodpack command. |
| src/commands/auth/whoami.ts | Removes old Deno/Cliffy auth whoami command. |
| src/commands/auth/mod.ts | Removes old Deno/Cliffy auth module registration. |
| src/commands/auth/logout.ts | Removes old Deno/Cliffy logout command. |
| src/commands/auth/login.ts | Removes old Deno/Cliffy login command (config-file based). |
| src/client.ts | Adds shared Developer API request helper (Basic auth + JSON parsing). |
| src/cli.ts | Adds the Node CLI entrypoint and command registration. |
| src/auth.ts | Adds env/flag-based auth resolution helper. |
| README.md | Updates docs to match new non-interactive JSON CLI behavior and command catalog. |
| package.json | Adds npm package metadata, commander dependency, and tsc build scripts. |
| package-lock.json | Adds lockfile for new npm-based dependency graph. |
| Makefile | Removes Deno-focused build/compile targets. |
| cmd/build.ts | Removes the Deno dnt build script previously used for publishing. |
| CLAUDE.md | Adds agent-oriented CLI skill documentation. |
| .gitignore | Adds node_modules to ignored paths. |
| .agents/skills/upstash-cli/SKILL.md | Adds packaged agent skill documentation for the CLI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ytkimirti
reviewed
Apr 1, 2026
merge release.yml
Drop the --command flag and custom shell-quote parser. Args are now either positional tokens (shell handles quoting) or a JSON array via --json.
Declare --email and --api-key once on the root program instead of on every leaf command. Each action resolves auth via optsWithGlobals(), so the flags are accepted in any position on the command line: upstash --email X redis list upstash redis --email X list upstash redis list --email X Removes ~150 lines of duplicated .option(...) declarations and the matching email?/apiKey? fields from every flag type. Positional bug where upstash --email X redis list was previously rejected is fixed.
When the Developer API returns a JSON body like {"error":"Unauthorized"},
the CLI was stringifying the whole body and wrapping it again, producing
{"error":"{\"error\":\"Unauthorized\"}"}. Parse the body and surface the
inner .error or .message string directly so callers see a single
unwrapped error field.
- redis create --region, team add-member --role: remove client-side enum checks. The API is the source of truth and the local enum lists drift; agents can read the returned error just fine. - redis/qstash update-budget --budget and vector create --dimension-count: replace bare parseInt with an explicit coercer that rejects garbage like "10abc" (parseInt silently truncated it to 10) and negatives, failing fast at parse time.
The pre-Commander argv scan only matched the space-separated form, so --env-file=/path/to/.env silently fell back to the default .env instead of loading the user-specified file.
Node 21+ treats --env-file as its own builtin flag and intercepts it from argv before our script runs, producing a raw "node: <path>: not found" message instead of our JSON error shape. Rename our flag so agents get a consistent parseable error regardless of Node version. Default .env-in-cwd loading is unchanged when the flag is omitted.
ytkimirti
approved these changes
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.