moss.
Authentication
The index, document, job and query commands use project credentials, resolved in this order:- CLI flags:
--project-idand--project-key - Environment variables:
MOSS_PROJECT_IDandMOSS_PROJECT_KEY - Config file:
~/.moss/config.json, written bymoss init
moss init asks before it replaces saved credentials, unless you pass --force. It keeps a
token saved by moss login.
Quick start
Log in and manage keys
moss login connects the CLI to your Moss account, so you can list your projects and manage
project keys from the terminal. These commands use a CLI token instead of a project key.
The CLI token comes from
--token, then MOSS_TOKEN, then the token moss login saved. It
acts as you, and you can revoke it in Settings > API Keys.
Agents and CI
CI that only queries or uploads to one project needs a project key, not a login. Create one withmoss keys create and store it as MOSS_PROJECT_ID and MOSS_PROJECT_KEY. An agent that
creates or deletes keys needs its own CLI token, so logging in or out on your machine doesn’t
affect it:
--api-url or MOSS_API_URL points login, whoami, projects and keys at another
dashboard, such as staging. The saved token is only sent to the dashboard that issued it, so
log in there with moss --api-url <url> login, or pass --token. A --token or MOSS_TOKEN
goes to https://portal.usemoss.dev unless --api-url or MOSS_API_URL names another one.
Index management
Document management
Query
moss query downloads the index and queries it on-device.
Job tracking
Document file formats
JSON
{"documents": [...]}.
CSV
stdin
Global options
Global options go before the command, as inmoss --json index list.