# Farin Tenant CLI Skill

Use this skill when you are an AI agent with access to a terminal where the `@farinapp/tenant-cli` is available.

## Setup

- **Install**: `npm install -g @farinapp/tenant-cli` or use via `npx`.
- **Auth**: `wazi login wz_...` or set `WAZI_API_KEY` environment variable.
- **Environment**: Set `WAZI_API_HOST="https://farin.app"`.

## Primary Commands

- `wazi describe`: List all domains.
- `wazi describe <domain>`: List resources in a domain.
- `wazi query <domain> <resource>`: Fetch data with `--filter`, `--order`, and `--limit`.
- `wazi mutate <domain> <resource> <action>`: Perform `create`, `update`, `upsert`, or `delete`.
- `wazi call <method> <path>`: Call custom business logic endpoints.

## Examples

- `wazi query order vendors --limit 5`
- `wazi mutate tasks tasks create --data '{"title":"Clean oven"}'`
- `wazi call POST /api/v1/accounting/payroll-runs/123/finalize`

## Agent Best Practices

1. **Always use `--limit`**: Default to small limits (e.g., 5-10) when exploring.
2. **Chain Commands**: Use `describe` then `query` to ensure you have the right schema.
3. **Escaping**: Ensure JSON data in `--data` is properly escaped for the shell.
4. **Validation**: Check command output for errors; the CLI returns structured error messages for permission issues.
