{ "published": true, "title": "@upstash/cli", "description": "A CLI to provision and manage Upstash resources, including Redis and Kafka databases.", "date": "2022-05-16T00:00:00.000Z", "url": "https://upstash.com/cli", "repository": "upstash/cli", "body": { "raw": "\n\nManage Upstash resources in your terminal or CI.\n\n![](https://raw.githubusercontent.com/upstash/cli/main/img/banner.svg)\n\n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/upstash/cli)\n[![Downloads/week](https://img.shields.io/npm/dw/lstr.svg)](https://npmjs.org/package/@upstash/cli)\n\n# Installation\n\n## npm\n\nYou can install upstash's cli directly from npm\n\n```bash\nnpm i -g @upstash/cli\n```\n\nIt will be added as `upstash` to your system's path.\n\n## Compiled binaries:\n\n`upstash` is also available from the\n[releases page](https://github.com/upstash/upstash-cli/releases/latest) compiled\nfor windows, linux and mac (both intel and m1).\n\n# Usage\n\n```bash\n> upstash\n\n Usage: upstash \n Version: development\n\n Description:\n\n Official cli for Upstash products\n\n Options:\n\n -h, --help - Show this help. \n -V, --version - Show the version number for this program. \n -c, --config - Path to .upstash.json file\n\n Commands:\n\n auth - Login and logout \n redis - Manage redis database instances \n kafka - Manage kafka clusters and topics \n team - Manage your teams and their members\n\n Environment variables:\n\n UPSTASH_EMAIL - The email you use on upstash\n UPSTASH_API_KEY - The api key from upstash\n```\n\n## Authentication\n\nWhen running `upstash` for the first time, you should log in using\n`upstash auth login`. Provide your email and an api key.\n[See here for how to get a key.](https://docs.upstash.com/redis/howto/developerapi#api-development)\n\nAs an alternative to logging in, you can provide `UPSTASH_EMAIL` and\n`UPSTASH_API_KEY` as environment variables.\n\n## Usage\n\nLet's create a new redis database:\n\n```\n> upstash redis create --name=my-db --region=eu-west-1\n Database has been created\n\n database_id a3e25299-132a-45b9-b026-c73f5a807859\n database_name my-db\n database_type Pay as You Go\n region eu-west-1\n type paid\n port 37090\n creation_time 1652687630\n state active\n password 88ae6392a1084d1186a3da37fb5f5a30\n user_email andreas@upstash.com\n endpoint eu1-magnetic-lacewing-37090.upstash.io\n edge false\n multizone false\n rest_token AZDiASQgYTNlMjUyOTktMTMyYS00NWI5LWIwMjYtYzczZjVhODA3ODU5ODhhZTYzOTJhMTA4NGQxMTg2YTNkYTM3ZmI1ZjVhMzA=\n read_only_rest_token ApDiASQgYTNlMjUyOTktMTMyYS00NWI5LWIwMjYtYzczZjVhODA3ODU5O_InFjRVX1XHsaSjq1wSerFCugZ8t8O1aTfbF6Jhq1I=\n\n\n You can visit your database details page: https://console.upstash.com/redis/a3e25299-132a-45b9-b026-c73f5a807859\n\n Connect to your database with redis-cli: redis-cli -u redis://88ae6392a1084d1186a3da37fb5f5a30@eu1-magnetic-lacewing-37090.upstash.io:37090\n```\n\n## Output\n\nMost commands support the `--json` flag to return the raw api response as json,\nwhich you can parse and automate your system.\n\n```bash\n> upstash redis create --name=test2113 --region=us-central1 --json | jq '.endpoint'\n\n \"gusc1-clean-gelding-30208.upstash.io\"\n```\n", "code": "var Component=(()=>{var d=Object.create;var c=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var m=(n,l)=>()=>(l||n((l={exports:{}}).exports,l),l.exports),u=(n,l)=>{for(var s in l)c(n,s,{get:l[s],enumerable:!0})},o=(n,l,s,r)=>{if(l&&typeof l==\"object\"||typeof l==\"function\")for(let a of p(l))!F.call(n,a)&&a!==s&&c(n,a,{get:()=>l[a],enumerable:!(r=E(l,a))||r.enumerable});return n};var B=(n,l,s)=>(s=n!=null?d(y(n)):{},o(l||!n||!n.__esModule?c(s,\"default\",{value:n,enumerable:!0}):s,n)),g=n=>o(c({},\"__esModule\",{value:!0}),n);var t=m((v,i)=>{i.exports=_jsx_runtime});var N={};u(N,{default:()=>f,frontmatter:()=>C});var e=B(t()),C={title:\"@upstash/cli\",description:\"A CLI to provision and manage Upstash resources, including Redis and Kafka databases.\",date:\"2022-05-16\",url:\"https://upstash.com/cli\",repository:\"upstash/cli\",published:!0};function h(n){let l=Object.assign({p:\"p\",img:\"img\",a:\"a\",h1:\"h1\",span:\"span\",h2:\"h2\",div:\"div\",pre:\"pre\",code:\"code\"},n.components);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.p,{children:\"Manage Upstash resources in your terminal or CI.\"}),`\n`,(0,e.jsx)(l.p,{children:(0,e.jsx)(l.img,{src:\"https://raw.githubusercontent.com/upstash/cli/main/img/banner.svg\",alt:\"\"})}),`\n`,(0,e.jsxs)(l.p,{children:[(0,e.jsx)(l.img,{src:\"https://img.shields.io/github/v/release/upstash/cli\",alt:\"GitHub release (latest SemVer)\"}),`\n`,(0,e.jsx)(l.a,{href:\"https://npmjs.org/package/@upstash/cli\",children:(0,e.jsx)(l.img,{src:\"https://img.shields.io/npm/dw/lstr.svg\",alt:\"Downloads/week\"})})]}),`\n`,(0,e.jsxs)(l.h1,{id:\"installation\",children:[(0,e.jsx)(l.a,{className:\"subheading-anchor\",\"aria-label\":\"Link to section\",href:\"#installation\",children:(0,e.jsx)(l.span,{className:\"icon icon-link\"})}),\"Installation\"]}),`\n`,(0,e.jsxs)(l.h2,{id:\"npm\",children:[(0,e.jsx)(l.a,{className:\"subheading-anchor\",\"aria-label\":\"Link to section\",href:\"#npm\",children:(0,e.jsx)(l.span,{className:\"icon icon-link\"})}),\"npm\"]}),`\n`,(0,e.jsx)(l.p,{children:\"You can install upstash's cli directly from npm\"}),`\n`,(0,e.jsx)(l.div,{\"data-rehype-pretty-code-fragment\":\"\",children:(0,e.jsx)(l.pre,{\"data-language\":\"bash\",\"data-theme\":\"default\",children:(0,e.jsx)(l.code,{\"data-language\":\"bash\",\"data-theme\":\"default\",children:(0,e.jsxs)(l.span,{className:\"line\",children:[(0,e.jsx)(l.span,{style:{color:\"#B392F0\"},children:\"npm\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"i\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#79B8FF\"},children:\"-g\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"@upstash/cli\"})]})})})}),`\n`,(0,e.jsxs)(l.p,{children:[\"It will be added as \",(0,e.jsx)(l.code,{children:\"upstash\"}),\" to your system's path.\"]}),`\n`,(0,e.jsxs)(l.h2,{id:\"compiled-binaries\",children:[(0,e.jsx)(l.a,{className:\"subheading-anchor\",\"aria-label\":\"Link to section\",href:\"#compiled-binaries\",children:(0,e.jsx)(l.span,{className:\"icon icon-link\"})}),\"Compiled binaries:\"]}),`\n`,(0,e.jsxs)(l.p,{children:[(0,e.jsx)(l.code,{children:\"upstash\"}),` is also available from the\n`,(0,e.jsx)(l.a,{href:\"https://github.com/upstash/upstash-cli/releases/latest\",children:\"releases page\"}),` compiled\nfor windows, linux and mac (both intel and m1).`]}),`\n`,(0,e.jsxs)(l.h1,{id:\"usage\",children:[(0,e.jsx)(l.a,{className:\"subheading-anchor\",\"aria-label\":\"Link to section\",href:\"#usage\",children:(0,e.jsx)(l.span,{className:\"icon icon-link\"})}),\"Usage\"]}),`\n`,(0,e.jsx)(l.div,{\"data-rehype-pretty-code-fragment\":\"\",children:(0,e.jsx)(l.pre,{\"data-language\":\"bash\",\"data-theme\":\"default\",children:(0,e.jsxs)(l.code,{\"data-language\":\"bash\",\"data-theme\":\"default\",children:[(0,e.jsxs)(l.span,{className:\"line\",children:[(0,e.jsx)(l.span,{style:{color:\"#F97583\"},children:\">\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" upstash\"})]}),`\n`,(0,e.jsx)(l.span,{className:\"line\",children:\" \"}),`\n`,(0,e.jsxs)(l.span,{className:\"line\",children:[(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#B392F0\"},children:\"Usage:\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"upstash\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"})]}),`\n`,(0,e.jsxs)(l.span,{className:\"line\",children:[(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#B392F0\"},children:\"Version:\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"development\"})]}),`\n`,(0,e.jsx)(l.span,{className:\"line\",children:\" \"}),`\n`,(0,e.jsxs)(l.span,{className:\"line\",children:[(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#B392F0\"},children:\"Description:\"})]}),`\n`,(0,e.jsx)(l.span,{className:\"line\",children:\" \"}),`\n`,(0,e.jsxs)(l.span,{className:\"line\",children:[(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#B392F0\"},children:\"Official\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"cli\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"for\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"Upstash\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"products\"})]}),`\n`,(0,e.jsx)(l.span,{className:\"line\",children:\" \"}),`\n`,(0,e.jsxs)(l.span,{className:\"line\",children:[(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#B392F0\"},children:\"Options:\"})]}),`\n`,(0,e.jsx)(l.span,{className:\"line\",children:\" \"}),`\n`,(0,e.jsxs)(l.span,{className:\"line\",children:[(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#B392F0\"},children:\"-h,\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#79B8FF\"},children:\"--help\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"-\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"Show\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"this\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"help.\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"})]}),`\n`,(0,e.jsxs)(l.span,{className:\"line\",children:[(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#B392F0\"},children:\"-V,\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#79B8FF\"},children:\"--version\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"-\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"Show\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"the\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"version\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"number\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"for\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"this\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"program.\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"})]}),`\n`,(0,e.jsxs)(l.span,{className:\"line\",children:[(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#B392F0\"},children:\"-c,\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#79B8FF\"},children:\"--config\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#F97583\"},children:\"<\"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"strin\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\"g\"}),(0,e.jsx)(l.span,{style:{color:\"#F97583\"},children:\">\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"-\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"Path\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"to\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\".upstash.json\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"file\"})]}),`\n`,(0,e.jsx)(l.span,{className:\"line\",children:\" \"}),`\n`,(0,e.jsxs)(l.span,{className:\"line\",children:[(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#B392F0\"},children:\"Commands:\"})]}),`\n`,(0,e.jsx)(l.span,{className:\"line\",children:\" \"}),`\n`,(0,e.jsxs)(l.span,{className:\"line\",children:[(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#B392F0\"},children:\"auth\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"-\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"Login\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"and\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"logout\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"})]}),`\n`,(0,e.jsxs)(l.span,{className:\"line\",children:[(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#B392F0\"},children:\"redis\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"-\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"Manage\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"redis\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"database\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"instances\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"})]}),`\n`,(0,e.jsxs)(l.span,{className:\"line\",children:[(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#B392F0\"},children:\"kafka\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"-\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"Manage\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"kafka\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"clusters\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"and\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"topics\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"})]}),`\n`,(0,e.jsxs)(l.span,{className:\"line\",children:[(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#B392F0\"},children:\"team\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"-\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"Manage\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"your\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"teams\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"and\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"their\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"members\"})]}),`\n`,(0,e.jsx)(l.span,{className:\"line\",children:\" \"}),`\n`,(0,e.jsxs)(l.span,{className:\"line\",children:[(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#B392F0\"},children:\"Environment\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"variables:\"})]}),`\n`,(0,e.jsx)(l.span,{className:\"line\",children:\" \"}),`\n`,(0,e.jsxs)(l.span,{className:\"line\",children:[(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#B392F0\"},children:\"UPSTASH_EMAIL\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#F97583\"},children:\"<\"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"strin\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\"g\"}),(0,e.jsx)(l.span,{style:{color:\"#F97583\"},children:\">\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"-\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"The\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"email\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"you\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"use\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"on\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"upstash\"})]}),`\n`,(0,e.jsxs)(l.span,{className:\"line\",children:[(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#B392F0\"},children:\"UPSTASH_API_KEY\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#F97583\"},children:\"<\"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"strin\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\"g\"}),(0,e.jsx)(l.span,{style:{color:\"#F97583\"},children:\">\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"-\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"The\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"api\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"key\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"from\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"upstash\"})]})]})})}),`\n`,(0,e.jsxs)(l.h2,{id:\"authentication\",children:[(0,e.jsx)(l.a,{className:\"subheading-anchor\",\"aria-label\":\"Link to section\",href:\"#authentication\",children:(0,e.jsx)(l.span,{className:\"icon icon-link\"})}),\"Authentication\"]}),`\n`,(0,e.jsxs)(l.p,{children:[\"When running \",(0,e.jsx)(l.code,{children:\"upstash\"}),` for the first time, you should log in using\n`,(0,e.jsx)(l.code,{children:\"upstash auth login\"}),`. Provide your email and an api key.\n`,(0,e.jsx)(l.a,{href:\"https://docs.upstash.com/redis/howto/developerapi#api-development\",children:\"See here for how to get a key.\"})]}),`\n`,(0,e.jsxs)(l.p,{children:[\"As an alternative to logging in, you can provide \",(0,e.jsx)(l.code,{children:\"UPSTASH_EMAIL\"}),` and\n`,(0,e.jsx)(l.code,{children:\"UPSTASH_API_KEY\"}),\" as environment variables.\"]}),`\n`,(0,e.jsxs)(l.h2,{id:\"usage-1\",children:[(0,e.jsx)(l.a,{className:\"subheading-anchor\",\"aria-label\":\"Link to section\",href:\"#usage-1\",children:(0,e.jsx)(l.span,{className:\"icon icon-link\"})}),\"Usage\"]}),`\n`,(0,e.jsx)(l.p,{children:\"Let's create a new redis database:\"}),`\n`,(0,e.jsx)(l.pre,{children:(0,e.jsx)(l.code,{children:`> upstash redis create --name=my-db --region=eu-west-1\n Database has been created\n\n database_id a3e25299-132a-45b9-b026-c73f5a807859\n database_name my-db\n database_type Pay as You Go\n region eu-west-1\n type paid\n port 37090\n creation_time 1652687630\n state active\n password 88ae6392a1084d1186a3da37fb5f5a30\n user_email andreas@upstash.com\n endpoint eu1-magnetic-lacewing-37090.upstash.io\n edge false\n multizone false\n rest_token AZDiASQgYTNlMjUyOTktMTMyYS00NWI5LWIwMjYtYzczZjVhODA3ODU5ODhhZTYzOTJhMTA4NGQxMTg2YTNkYTM3ZmI1ZjVhMzA=\n read_only_rest_token ApDiASQgYTNlMjUyOTktMTMyYS00NWI5LWIwMjYtYzczZjVhODA3ODU5O_InFjRVX1XHsaSjq1wSerFCugZ8t8O1aTfbF6Jhq1I=\n\n\n You can visit your database details page: https://console.upstash.com/redis/a3e25299-132a-45b9-b026-c73f5a807859\n\n Connect to your database with redis-cli: redis-cli -u redis://88ae6392a1084d1186a3da37fb5f5a30@eu1-magnetic-lacewing-37090.upstash.io:37090\n`})}),`\n`,(0,e.jsxs)(l.h2,{id:\"output\",children:[(0,e.jsx)(l.a,{className:\"subheading-anchor\",\"aria-label\":\"Link to section\",href:\"#output\",children:(0,e.jsx)(l.span,{className:\"icon icon-link\"})}),\"Output\"]}),`\n`,(0,e.jsxs)(l.p,{children:[\"Most commands support the \",(0,e.jsx)(l.code,{children:\"--json\"}),` flag to return the raw api response as json,\nwhich you can parse and automate your system.`]}),`\n`,(0,e.jsx)(l.div,{\"data-rehype-pretty-code-fragment\":\"\",children:(0,e.jsx)(l.pre,{\"data-language\":\"bash\",\"data-theme\":\"default\",children:(0,e.jsxs)(l.code,{\"data-language\":\"bash\",\"data-theme\":\"default\",children:[(0,e.jsxs)(l.span,{className:\"line\",children:[(0,e.jsx)(l.span,{style:{color:\"#F97583\"},children:\">\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" upstash redis create --name\"}),(0,e.jsx)(l.span,{style:{color:\"#F97583\"},children:\"=\"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"test2113\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" --region\"}),(0,e.jsx)(l.span,{style:{color:\"#F97583\"},children:\"=\"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"us-central1\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" --json \"}),(0,e.jsx)(l.span,{style:{color:\"#F97583\"},children:\"|\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#B392F0\"},children:\"jq\"}),(0,e.jsx)(l.span,{style:{color:\"#E1E4E8\"},children:\" \"}),(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:\"'.endpoint'\"})]}),`\n`,(0,e.jsx)(l.span,{className:\"line\",children:\" \"}),`\n`,(0,e.jsx)(l.span,{className:\"line\",children:(0,e.jsx)(l.span,{style:{color:\"#9ECBFF\"},children:' \"gusc1-clean-gelding-30208.upstash.io\"'})})]})})})]})}function b(n={}){let{wrapper:l}=n.components||{};return l?(0,e.jsx)(l,Object.assign({},n,{children:(0,e.jsx)(h,n)})):h(n)}var f=b;return g(N);})();\n;return Component;" }, "_id": "projects/upstash-cli.mdx", "_raw": { "sourceFilePath": "projects/upstash-cli.mdx", "sourceFileName": "upstash-cli.mdx", "sourceFileDir": "projects", "contentType": "mdx", "flattenedPath": "projects/upstash-cli" }, "type": "Project", "path": "/projects/upstash-cli", "slug": "upstash-cli" }