| name | rema-shared |
| description | Runtime contract for the rema CLI. Covers authentication, output format, error handling, and invocation patterns. Use as foundation before any other rema skill. |
| compatibility | Requires rema binary installed and network access to api.rema.no. Chrome or Chromium required for initial auth. |
rema-shared
Foundation skill for the rema CLI โ a wrapper around the REMA 1000 grocery API. Read this before using any other rema skill.
Authentication
Most commands require authentication. Auth is browser-based (one-time setup):
rema auth login
rema auth status
rema auth logout
Tokens are stored in ~/.rema1000/tokens.json and auto-refresh before expiry. You do not need to re-authenticate between sessions.
Output Format
- Success: JSON to stdout, exit code 0
- Errors:
{"error": "message"} to stderr, exit code 1
- TTY: Pretty-printed JSON (indented)
- Piped: Compact JSON (single line)
- Binary commands (
articles image, lists image): Raw bytes to stdout or --output <file>
Global Flags
Use these on any command:
| Flag | Purpose |
|---|
--json | Force compact JSON output (overrides TTY detection) |
--fields f1,f2 | Return only named fields โ reduces token usage |
Always use --json when parsing output programmatically. Use --fields to minimize tokens when you only need specific data.
Available Resources
| Resource | Commands | Auth Required |
|---|
version | rema version | No |
customer | get, minimal, update | Yes |
offers | list | Yes |
campaigns | list | Yes |
articles | search, image | Yes |
stores | get, search, hours | Yes |
transactions | list, get | Yes |
lists | list, get, create, delete, share, image | Yes |
items | add, update, delete, clear, activate | Yes |
Error Handling
All errors produce JSON on stderr with exit code 1:
{"error": "Token not configured. Run `rema auth login`."}
If you receive an auth error, run rema auth status to check token state. Tokens auto-refresh, but if the refresh token itself has expired, run rema auth login again.
ID Formats
- List IDs: UUIDs (e.g.,
29D9D5F0-99C0-4EA4-9452-ED1D5F95AC6C)
- Item IDs: UUIDs
- Store workplace IDs: Numeric strings (e.g.,
1011141087892)
- Store numbers: Short numeric (e.g.,
3198)
- GTINs (barcodes): 13-digit numeric strings (e.g.,
7057370030369)
- Transaction IDs: Long integers (e.g.,
1011726206912). Source: rema transactions list โ transactions[].id.