Install and sign in
Install the OpenStock CLI and sign in with a store API key.
Requirements#
Node.js 20 or newer on macOS, Linux or Windows. The CLI has no other dependencies.
Install#
npm install --global @openstock/cliCheck it worked with openstock --version.
Create a key#
Open API keys
In the dashboard go to Developers → API keys and choose New key.
Choose scopes
Under Store API, set Theme code to Write and Store details to Read. That is all the CLI needs.
Copy the key
The key is shown once. Keep it somewhere safe, such as a password manager.
Sign in#
$ openstock login
OpenStock sign in
Create a key in Dashboard → Developers → API keys.
Give it themes:write to push and publish, or store:read to look around.
API key › ••••••••••••••••••••••••••••
✓ Signed in to Acme Keys acme.openstock.devThe key is stored in ~/.config/openstock/credentials.json (%APPDATA%\openstock on Windows), readable only by your user. Sign in to more than one store and the CLI uses the right key for each theme folder automatically. openstock whoami shows which store and scopes are active.
Skip the prompt
Set OPENSTOCK_API_KEY or pass --key and the CLI uses that key without saving anything. This is how CI works.