Skip to content

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

Terminal window
# Install globally
npm install -g @openai/codex
# Or use npx
npx @openai/codex

Step 2: Install Famasi Integration

Terminal window
# Install Famasi MCP for Codex
npx @famasi/agents@latest install codex

This creates:

  • .mcp.json — MCP server configuration
  • .famasi/skills/codex/famasi-provider/SKILL.md — Skill instructions
  • AGENTS.md — Agent configuration
Terminal window
# Link your provider account
npx @famasi/agents@latest link provider --provider-id YOUR_PROVIDER_ID
# Or link as individual
npx @famasi/agents@latest link individual --phone +2348012345678

Step 4: Verify

Terminal window
# Check everything is working
npx @famasi/agents@latest doctor

Using Famasi in Codex

Start Codex in your project directory:

Terminal window
codex

Then 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:

Terminal window
# Famasi skill is automatically loaded
# Located at: .famasi/skills/codex/famasi-provider/SKILL.md

The skill file teaches Codex:

  • Available tools and their parameters
  • Best practices for pharmacy operations
  • Example workflows

Tips for Best Results

  1. Context matters: Codex remembers conversation history
  2. Be clear: State medication names and dosages clearly
  3. Confirm actions: Codex will ask before placing orders
  4. Use follow-ups: “The one from GreenCross” references previous results

Comparison with Claude Code

FeatureCodexClaude Code
DeveloperOpenAIAnthropic
ModelGPT-4Claude
Skills systemYesAgent personas
Slash commandsNoYes
Famasi toolsFullFull

Choose based on which AI model you prefer.

Troubleshooting

IssueSolution
”Cannot find MCP server”Re-run npx @famasi/agents@latest install codex
Authentication failedCheck ~/.famasi/provider-link.json exists
Skills not loadingVerify AGENTS.md is in project root
Commands timeoutCheck 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