# BizManage CRM AI Context

BizManage CRM customizations are normally edited in a local CLI project and deployed with bizmanage-cli.

Core workflow:
```bash
bizmanage login
bizmanage init my-project
cd my-project
bizmanage pull
bizmanage validate
bizmanage push
```

Local source tree:
```
src/objects/<object>/definition.json
src/objects/<object>/fields/<field>.json
src/objects/<object>/actions/<action>.json
src/objects/<object>/actions/<action>.js
src/objects/<object>/data/*.json
src/backend/<script>.json
src/backend/<script>.js
src/reports/<report>.json
src/reports/<report>.sql
src/pages/<page>.json
src/pages/<page>.html
```

Rules for AI agents:
- Never ask the user to paste API keys into chat.
- Never edit .bizmanage/ cache or credential files.
- Pull before editing when the local project may be stale.
- Keep examples generic and avoid customer data.
- Use BMML elements for custom pages: bmml-data-src, bmml-report, bmml-form, bmml-heb-datepicker.
- Use action JS when a button/menu/row action should run in the browser.
- Use backend scripts when logic needs server-side modules, schedules, database access, or webhooks.
- Use reports for SQL-backed tabular output.
- Use policies to restrict access; prefer least privilege for API/public users.
- Validate before push and explain exactly what will deploy.

Important CLI selectors:
```bash
bizmanage pull --include pages
bizmanage pull --include actions --object customers
bizmanage push --page /dashboards/team-overview
bizmanage push --script nightly-sync
bizmanage push --field customers.status
bizmanage push --action customers.send_welcome
bizmanage push --include data --object statuses
```
