Install agent rules
Use lomi install-rules to add lomi. SDK and API documentation for Cursor, Claude Code, Codex, VS Code, and llms.txt.
The lomi install-rules command installs versioned lomi. documentation into your project so AI coding assistants understand checkout sessions, webhooks, payment intents, subscriptions, and the API reference.
Inspired by the agent-rules pattern used by tools like Trigger.dev, your AI reads these files automatically when you work in the repo.
Usage
lomi install-rulesInteractive mode shows a multi-select wizard:
- Cursor:
.cursor/rules/lomi.*.mdc - Claude Code: appends to
CLAUDE.md - OpenAI Codex: appends to
AGENTS.md - VS Code:
.github/instructions/lomi-*.instructions.md - llms.txt: project-root briefing synced from docs.lomi.africa/llms.txt
Non-interactive
lomi install-rules --target cursor --target llms.txt
lomi install-rules --target claude-code --target codex --target vscode
lomi install-rules --force| Flag | Description |
|---|---|
--target <name> | Repeat for each target (cursor, claude-code, codex, vscode, llms.txt) |
--force | Reinstall even if already up to date |
In CI or non-TTY environments, defaults to Cursor + llms.txt when no targets are specified.
Rule topics
Each target receives bundled rules for:
| Topic | Covers |
|---|---|
| SDK basics | Client setup, authentication, environment |
| Checkout sessions | Hosted checkout flow |
| Webhooks | Signature verification, event handling |
| Payment intents | Card and Elements-style flows |
| Subscriptions | Recurring billing |
| API reference | Generated from OpenAPI |
| Docs writing | Editorial contract for docs.lomi.africa |
Cursor rules include YAML frontmatter (description, globs, alwaysApply) so Cursor picks them up automatically.
When rules are offered
- Running
lomi install-rulesdirectly - First run of
lomi init(unless--skip-rules-install) - First run of
lomi dev(unless--skip-rules-install)
The CLI tracks the installed rules version in your global config and may prompt again when a new version ships.
Example: Cursor setup
cd my-project
lomi install-rules --target cursorCreates files like:
.cursor/rules/
lomi.sdk-basics.mdc
lomi.checkout-sessions.mdc
lomi.webhooks.mdc
lomi.charges.mdc
lomi.subscriptions.mdc
lomi.api-reference.mdcExample: full AI stack
lomi install-rules \
--target cursor \
--target claude-code \
--target codex \
--target vscode \
--target llms.txtRelated docs
For manual AI setup without the CLI, see API integration: agent setup.