Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
06591b7
feat: update cli to work with up to date developer api
alitariksahin Mar 30, 2026
3cc0be2
refactor: streamline CLI commands and remove deprecated authenticatio…
alitariksahin Mar 30, 2026
cb8f580
fix: copilet reviews
alitariksahin Mar 31, 2026
a340396
feat: add tests
alitariksahin Mar 31, 2026
4c2c5c0
fix: update release workflow to use Node.js 24 and improve npm publis…
CahidArda Apr 2, 2026
4da3ee7
fix: unify error handling
alitariksahin Apr 14, 2026
9441c54
Merge branch 'DX-2531' of github.com:upstash/cli into DX-2531
alitariksahin Apr 14, 2026
fdb9b62
feat: add dotenv support
alitariksahin Apr 14, 2026
cce0d53
feat: add ci.yml
alitariksahin Apr 14, 2026
76099fd
refactor: simplify redis exec to positional args or --json
ytkimirti Apr 15, 2026
2794704
fix: delete claude.md file
ytkimirti Apr 15, 2026
afcb868
fix: downgrade dotenv to the stable v16 to avoid advertisements
ytkimirti Apr 15, 2026
428ffb3
refactor: promote --email and --api-key to root-level global flags
ytkimirti Apr 15, 2026
a276e47
fix: unwrap API error bodies instead of stringifying them
ytkimirti Apr 15, 2026
f55aa91
refactor: drop redundant enum validation, tighten numeric coercers
ytkimirti Apr 15, 2026
54a6089
fix: accept --env-file=path form in addition to --env-file path
ytkimirti Apr 15, 2026
ef6a9b9
rename: --env-file to --env-path to avoid Node builtin collision
ytkimirti Apr 15, 2026
a83e0fb
chore: remove skills
alitariksahin Apr 15, 2026
5890fb7
feat: add `upstash login` / `upstash logout` for persisted credentials
ytkimirti Apr 16, 2026
90b955d
test: remove team integration tests
ytkimirti Apr 16, 2026
daa1b07
docs: slim README to intro, install, auth, and a few examples
ytkimirti Apr 16, 2026
38abc4c
test: skip redis backup test when API reports cluster maintenance
ytkimirti Apr 16, 2026
51c4e08
fix: update readme
ytkimirti Apr 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
UPSTASH_EMAIL=you@example.com
UPSTASH_API_KEY=your_dev_api_key
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
name: Build & Typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 24

- run: npm ci

- run: npm run build

- run: npm run typecheck

test:
name: Tests
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 24

- run: npm ci

- name: Run tests
env:
UPSTASH_EMAIL: ${{ secrets.UPSTASH_EMAIL }}
UPSTASH_API_KEY: ${{ secrets.UPSTASH_API_KEY }}
run: npm test
65 changes: 13 additions & 52 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,67 +5,28 @@ on:
types:
- published

permissions:
id-token: write
contents: read

jobs:
npm:
name: Release on npm
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2

- name: Set env
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: 16

- run: curl -fsSL https://deno.land/x/install/install.sh | sh
node-version: 24
registry-url: https://registry.npmjs.org

- run: echo "$HOME/.deno/bin" > $GITHUB_PATH
- run: npm ci

- name: Build
run: deno run -A ./cmd/build.ts $VERSION
- name: Publish release candidate
if: github.event.release.prerelease
run: npm publish --access public --tag next --provenance

- name: Publish
if: "!github.event.release.prerelease"
working-directory: ./dist
run: |
echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" > .npmrc
npm publish --access public
- name: Publish release candidate
if: "github.event.release.prerelease"
working-directory: ./dist
run: |
echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" > .npmrc
npm publish --access public --tag=next
binaries:
name: Release binary
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch:
[
"x86_64-unknown-linux-gnu",
"x86_64-pc-windows-msvc",
"x86_64-apple-darwin",
"aarch64-apple-darwin",
]
steps:
- name: Checkout Repo
uses: actions/checkout@v2

- run: curl -fsSL https://deno.land/x/install/install.sh | sh
- run: echo "$HOME/.deno/bin" > $GITHUB_PATH

- name: compile
run: deno compile --allow-env --allow-read --allow-write --allow-net --target=${{ matrix.arch }} --output=./bin/upstash_${{ matrix.arch}} ./src/mod.ts

- name: upload
run: gh release upload ${GITHUB_REF#refs/*/} ./bin/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm publish --access public --provenance
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.env
dist
node_modules
23 changes: 0 additions & 23 deletions Makefile

This file was deleted.

128 changes: 42 additions & 86 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,112 +1,68 @@
# Upstash CLI

Manage Upstash resources in your terminal or CI.
[![GitHub release](https://img.shields.io/github/v/release/upstash/cli)](https://github.com/upstash/cli/releases/latest)
[![npm downloads](https://img.shields.io/npm/dw/@upstash/cli.svg)](https://npmjs.org/package/@upstash/cli)

![](./img/banner.svg)
Agent-friendly CLI for managing & debugging Upstash resources from your terminal. [Docs](https://upstash.com/docs/agent-resources/cli).

![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/upstash/cli)
[![Downloads/week](https://img.shields.io/npm/dw/lstr.svg)](https://npmjs.org/package/@upstash/cli)

# Installation

## npm

You can install upstash's cli directly from npm
## Installation

```bash
npm i -g @upstash/cli
```

It will be added as `upstash` to your system's path.

## Compiled binaries:

`upstash` is also available from the
[releases page](https://github.com/upstash/cli/releases/latest) compiled for
windows, linux and mac (both intel and m1).

# Usage
For agents, pair the CLI with the [Upstash Skill](https://docs.upstash.com/agent-resources/skills), it bundles Upstash docs alongside docs for the `upstash` CLI.

```bash
> upstash

Usage: upstash
Version: development

Description:

Official cli for Upstash products

Options:

-h, --help - Show this help.
-V, --version - Show the version number for this program.
-c, --config <string> - Path to .upstash.json file

Commands:

auth - Login and logout
redis - Manage redis database instances
team - Manage your teams and their members

Environment variables:

UPSTASH_EMAIL <string> - The email you use on upstash
UPSTASH_API_KEY <string> - The api key from upstash
npx skills add upstash/skills
```

## Authentication

When running `upstash` for the first time, you should log in using
`upstash auth login`. Provide your email and an api key.
[See here for how to get a key.](https://docs.upstash.com/redis/howto/developerapi#api-development)
Grab a Developer API key from the [Upstash Console](https://console.upstash.com/account/api), then save it once per machine:

As an alternative to logging in, you can provide `UPSTASH_EMAIL` and
`UPSTASH_API_KEY` as environment variables.
```bash
upstash login
```

## Usage
Or set `UPSTASH_EMAIL` and `UPSTASH_API_KEY` in your shell or a `.env` file. See the [auth docs](https://upstash.com/docs/agent-resources/cli#authentication) for env files, per-command flags, and precedence rules.

Let's create a new redis database:
## Quick examples

```
> upstash redis create --name=my-db --region=eu-west-1
Database has been created

database_id a3e25299-132a-45b9-b026-c73f5a807859
database_name my-db
database_type Pay as You Go
region eu-west-1
type paid
port 37090
creation_time 1652687630
state active
password 88ae6392a1084d1186a3da37fb5f5a30
user_email andreas@upstash.com
endpoint eu1-magnetic-lacewing-37090.upstash.io
edge false
multizone false
rest_token AZDiASQgYTNlMjUyOTktMTMyYS00NWI5LWIwMjYtYzczZjVhODA3ODU5ODhhZTYzOTJhMTA4NGQxMTg2YTNkYTM3ZmI1ZjVhMzA=
read_only_rest_token ApDiASQgYTNlMjUyOTktMTMyYS00NWI5LWIwMjYtYzczZjVhODA3ODU5O_InFjRVX1XHsaSjq1wSerFCugZ8t8O1aTfbF6Jhq1I=


You can visit your database details page: https://console.upstash.com/redis/a3e25299-132a-45b9-b026-c73f5a807859

Connect to your database with redis-cli: redis-cli -u redis://88ae6392a1084d1186a3da37fb5f5a30@eu1-magnetic-lacewing-37090.upstash.io:37090
All output is JSON, so you can pipe to `jq`. Use `--dry-run` to preview destructive commands.

```bash
# Redis
upstash redis list
upstash redis create --name my-db --region us-east-1
upstash redis exec --db-url $URL --db-token $TOKEN GET key

# Vector
upstash vector list
upstash vector create --name my-index --region us-east-1 --similarity-function COSINE --dimension-count 1536

# Search
upstash search list
upstash search create --name my-search --region us-central1 --type DENSE

# QStash
upstash qstash list
upstash qstash stats --qstash-id $QSTASH_ID --period 7d

# Team
upstash team list
upstash team add-member --team-id $TEAM_ID --member-email you@example.com --role dev
```

## Output
Run `upstash --help` (or `--help` on any subcommand) to discover everything else, and check the [full docs](https://upstash.com/docs/agent-resources/cli) for the complete catalog.

Most commands support the `--json` flag to return the raw api response as json,
which you can parse and automate your system.
## Contributing

```bash
> upstash redis create --name=test2113 --region=us-central1 --json | jq '.endpoint'

"gusc1-clean-gelding-30208.upstash.io"
npm install
npm run build
node dist/cli.js --help # try your build
npm link # or expose it as `upstash` globally
```

## Contributing

If anything feels wrong, you discover a bug or want to request improvements,
please create an issue or talk to us on
[Discord](https://discord.com/invite/w9SenAtbme)
Open an issue, send a PR, or join us on [Discord](https://discord.com/invite/w9SenAtbme).
64 changes: 0 additions & 64 deletions cmd/build.ts

This file was deleted.

17 changes: 0 additions & 17 deletions img/banner.svg

This file was deleted.

Loading
Loading