Codex
Codex
Codex is OpenAI’s terminal-based AI coding assistant. Integrate Famasi to manage pharmacy operations using natural language commands in your terminal.
What is Codex?
Codex brings GPT-4 to your command line. It can:
- Understand your codebase
- Write and edit code
- Run terminal commands
- Use external tools via MCP
With Famasi MCP, Codex becomes your pharmacy management assistant.
Installation
Step 1: Install Codex
# Install globallynpm install -g @openai/codex
# Or use npxnpx @openai/codexStep 2: Install Famasi Integration
# Install Famasi MCP for Codexnpx @famasi/agents@latest install codexThis creates:
.mcp.json— MCP server configuration.famasi/skills/codex/famasi-provider/SKILL.md— Skill instructionsAGENTS.md— Agent configuration
Step 3: Link Your Account
# Link your provider accountnpx @famasi/agents@latest link provider --provider-id YOUR_PROVIDER_ID
# Or link as individualnpx @famasi/agents@latest link individual --phone +2348012345678Step 4: Verify
# Check everything is workingnpx @famasi/agents@latest doctorUsing Famasi in Codex
Start Codex in your project directory:
codexThen ask naturally:
You: Find nearby pharmacies with malaria medication
Codex: I'll search for pharmacies with malaria medication near you.
[Uses find_nearby_pharmacy tool]
Codex: Here are pharmacies with malaria medication:
1. GreenCross Pharmacy — 0.8km away • Artemether-Lumefantrine: ₦1,500 • Artesunate: ₦800
2. MediCare Plus — 1.5km away • Artemether-Lumefantrine: ₦1,400 • Quinine: ₦1,200
Would you like me to place an order?Common Tasks
Search Medications
"Search for hypertension medication""Find Ventolin inhaler nearby""What antibiotics do you have?"Place Orders
"Order 3 packs of Paracetamol""Create order for customer Jane Doe""Place delivery order for Lekki"Track Orders
"Where's my order?""Check order ORD-456 status""Show all my pending orders"Provider Operations
"List today's completed orders""What's my current revenue?""Show low stock products""Add new customer"Skills System
Codex uses a skills system for specialized tasks:
# Famasi skill is automatically loaded# Located at: .famasi/skills/codex/famasi-provider/SKILL.mdThe skill file teaches Codex:
- Available tools and their parameters
- Best practices for pharmacy operations
- Example workflows
Tips for Best Results
- Context matters: Codex remembers conversation history
- Be clear: State medication names and dosages clearly
- Confirm actions: Codex will ask before placing orders
- Use follow-ups: “The one from GreenCross” references previous results
Comparison with Claude Code
| Feature | Codex | Claude Code |
|---|---|---|
| Developer | OpenAI | Anthropic |
| Model | GPT-4 | Claude |
| Skills system | Yes | Agent personas |
| Slash commands | No | Yes |
| Famasi tools | Full | Full |
Choose based on which AI model you prefer.
Troubleshooting
| Issue | Solution |
|---|---|
| ”Cannot find MCP server” | Re-run npx @famasi/agents@latest install codex |
| Authentication failed | Check ~/.famasi/provider-link.json exists |
| Skills not loading | Verify AGENTS.md is in project root |
| Commands timeout | Check network connection to Famasi API |
Configuration
The .mcp.json file:
{ "mcpServers": { "famasi": { "command": "npx", "args": ["@famasi/agents@latest", "mcp"], "env": { "FAMASI_PROVIDER_ID": "your-provider-id" } } }}Next steps
- Claude Code — Anthropic’s alternative
- Individual Tools — Available tools
- Provider Tools — Provider operations
- Troubleshooting — Common issues