Use the StoreFront CLI with Grok Bot
Grok Bot runs on a cloud computer with no keychain, so the CLI keeps the sign-in in an encrypted file unlocked by a key that you give the Bot as a secret. Status: Documented.
How the Grok Bot computer behaves
Grok Bot gives each user one cloud computer. Every Bot on the account shares it, so files and command-line credentials on it are visible to all of them. A secret, by contrast, can belong to one Bot.
Files under /workspace survive updates, Recover and Reset. Installed packages do not. That is why the CLI is installed under /workspace and reinstalled when it goes missing.
Prerequisites
- A Grok Bot. On a Team Bot (Team or Enterprise plan) you need access to its Secrets.
- Your own computer, to create the key.
- An UltraCart account whose user has StoreFront access.
1. Create the key and give it to the Bot
The key is a new random value you make now, not your UltraCart password. Create it on your own computer, straight onto the clipboard, so it is never displayed:
- macOS:
openssl rand -base64 32 | pbcopy - Linux:
openssl rand -base64 32 | xclip -selection clipboard - Windows PowerShell:
$b = New-Object byte[] 32; [Security.Cryptography.RandomNumberGenerator]::Create().GetBytes($b); [Convert]::ToBase64String($b) | Set-Clipboard
Paste it into a secret, never the chat:
-
Team Bot: open Secrets, choose Add secret, and enter:
- environment variable name:
ULTRACART_STOREFRONT_CREDENTIAL_KEY - description:
UltraCart StoreFront CLI sign-in key. Never print or echo it. - value: paste from the clipboard
Then choose Save secret. Everyone who chats with a Team Bot can use its secrets.
- environment variable name:
-
Personal Bot: ask the Bot to request a secret named
ULTRACART_STOREFRONT_CREDENTIAL_KEYwith the secure secret card, and to make it available to its shell commands as an environment variable. Paste the key into the card and choose Save securely.
Copy something else afterwards so the key does not stay on your clipboard. A saved secret reaches the Bot's new commands right away; you do not need a new chat.
2. Install the CLI under /workspace
In every command, the Bot puts /workspace/.npm-global/bin on PATH and sets ULTRACART_STOREFRONT_CONFIG_DIR to a folder under /workspace, for example /workspace/.ultracart. It installs with:
npm install -g --prefix /workspace/.npm-global @ultracart/storefront-cli@beta --@ultracart:registry=https://registry.npmjs.org/
It repeats that install after an update, Recover or Reset, or whenever uc-storefront goes missing.
Then it creates a workspace under /workspace. Because the Bot's shell cannot answer prompts, it names a target and passes --no-input:
uc-storefront init /workspace/my-storefront --target codex --no-input
Grok Bot's own skills are saved instructions in a library you manage in the Grok app, not folders it reads from the computer, so it does not load the installed skill by itself. Ask it to read /workspace/my-storefront/.agents/skills/build-ultracart-storefronts/SKILL.md before it works on your store, and to follow the references that file points to. To avoid repeating that, save a Grok Bot skill that says so. UltraCart has not yet confirmed this in a test run with Grok Bot.
3. Check the key
The Bot runs uc-storefront auth status and reads the credential lines:
credential store: encrypted-file (durable, available)andcredential key: set: go on to sign in.credential key: absent: the secret is not reaching the Bot's shell. The Bot stops and tells you. Check the secret's name. Do not work around it.credential key: invalid: replace the secret with a new key.
Before a profile exists, auth status also refuses and exits 1 (no profiles are configured, or workspace binding: missing inside a workspace). That is expected.
4. Approve the sign-in
The Bot's command tool shows output only when a command ends, so it signs in in two steps:
uc-storefront profile create main
uc-storefront auth login --profile main --no-wait
uc-storefront auth login --profile main --continue --wait
uc-storefront profile bind main
auth login --no-waitprints a URL and a code and exits at once. The Bot sends you both.- Open the URL in your own browser, check the code, accept the StoreFront CLI terms, and approve. Never give the Bot your UltraCart password, and do not let it open the page.
auth login --continue --waitwaits up to 45 seconds. Exit3means still waiting, so the Bot runs it again until it exits0.sign_in_expiredmeans start again with a new code.
5. Keep the Bot on an approved address
The sign-in works only from addresses you approve. Without any change, the Bot's cloud computer uses static egress addresses that xAI shares across all Grok Bot customers, so approving one means trusting an address others use too. Route the Bot's traffic through your own computer instead: in the Grok Bot desktop app, go to Settings, then Computer, and under Your computer turn on Route traffic through this computer.
Then have the Bot run uc-storefront sf storefronts. If it stops with location_approval_required, the Bot runs uc-storefront auth approve-location and relays the link and code. Check that the address in the request (error.ip with --json) is your own internet address before you approve. Approved addresses and a stable IP covers the route's limits, including shared Team Bot chats and the Enterprise setting.
6. Confirm
uc-storefront auth statusshowscredential store: encrypted-file (durable, available),local grant: presentandcredential key: set, and shows the same in a new session.uc-storefront sf storefrontslists your storefronts.
Rules for the Bot
- Never print the environment (
env,printenv,echo $VAR), never runuc-storefront auth keygen, and never open, copy or upload thecredentialsfolder in the configuration directory. - A second Bot gets its own configuration folder, key and sign-in. Do not share one configuration folder between Bots.
- If the key or a token ever appears in a chat, create a new key, replace the secret, revoke the CLI's authorized application in UltraCart, and sign in again.
Next steps
- Hosted agents, containers and CI: how the encrypted-file sign-in works
- Connect your store: profiles, binding and how long a sign-in lasts
- Safety and human approval: read before the first live change
- What it can do: the areas the Bot can work on with the skill