Use npx @farinapp/tenant-cli to query the Farin API from a terminal without a global install. The CLI authenticates with a company-scoped API key; it does not connect to Supabase or need database credentials.
Run describe before querying or changing records so you can check available resources and key permissions. If your agent supports MCP and you prefer a tool connection, follow the hosted MCP setup guide.
Quick facts
Start here
- Use
npxto run the package without installing it globally; global installs provide thefarinand legacywazicommands. describediscovers domains and resources,queryreads data, andmutatemakes permitted changes.- The CLI uses the API key’s domain and method permissions. Set
FARIN_API_KEYand, for another Farin host,FARIN_API_HOST.
Step 1: Install the CLI and authenticate
- Run
npx @farinapp/tenant-cli login wz_...using your active API key. - The login command saves the key in
~/.config/wazi/config.json. Protect that file like a password and revoke the key when you no longer need it. - You can instead set
FARIN_API_KEY(the olderWAZI_API_KEYname is also supported). If your shell saves command history, avoid putting the full key directly in a command.
Step 2: Discover the API resources
- Run
npx @farinapp/tenant-cli describeto see a list of available domains. - Run
npx @farinapp/tenant-cli describe <domain>to see the resources inside a specific domain, likedescribe order.
Step 3: Query data or make permitted changes
- To fetch data:
npx @farinapp/tenant-cli query <domain> <resource> --limit 5. - To create a record:
npx @farinapp/tenant-cli mutate <domain> <resource> create --data '{"key": "value"}'. - Use
npx @farinapp/tenant-cli call <method> <path>for a supported business action that is not a standard create, update, or delete. - Run
npx @farinapp/tenant-cli --helpfor full command options and syntax.
Choose the CLI or hosted MCP for an agent
Use the CLI when an agent can run shell commands and you want explicit query or mutation control. Use hosted MCP when the agent needs structured tool discovery without running shell commands.
- Open Farin CLI Skill to view or copy the instructions.
- Copy the content and paste it into your agent's system prompt or project memory.
If a command returns an authorization error
Check the key and permissions
401 Unauthorized means the key is invalid, revoked, or sent to the wrong host. 403 Forbidden means the key lacks access to that domain or action. API keys cannot be edited after creation; make a replacement with the needed permissions and revoke the old key.
