Zo Computer
Zo Computer
Zo Computer is a developer-focused, highly scriptable AI agent. Built for power users, it offers complete API access, custom workflows, and the ability to automate complex pharmacy management tasks through code.
Built for Developers
Zo Computer is not just a chat interface; it’s a programmable environment. If you want to automate your pharmacy interactions, integrate Famasi into your own applications, or simply prefer a command-line interface, Zo Computer provides the tools you need.
Key Features:
- Scriptable Workflows: Write JavaScript or Python scripts to automate orders, checks, and reports.
- Full API Access: Direct access to the underlying Famasi MCP server APIs.
- Custom Integrations: Build your own connections to other services (e.g., your calendar, a smart home device).
- Local Execution: Run scripts on your machine for maximum control and privacy.
Installation
Step 1: Install the CLI
Zo Computer is distributed as a command-line interface (CLI). You can install it using popular package managers.
# Using npm (Node Package Manager)npm install -g @famasi/zo-computer
# Using Homebrew (macOS/Linux)brew install famasi/tap/zo-computer
# Using cargo (Rust's package manager)cargo install zo-computerStep 2: Authenticate
Once installed, you need to link your Zo Computer instance to your Famasi account.
# Initiate the login processzo login
# You will be prompted to enter your phone number.# An OTP will be sent to your device for verification.# Enter the OTP to complete the authentication.This process creates a secure authentication token stored locally on your machine at ~/.zo/config.json.
Step 3: Verify Installation
Run a quick diagnostic to ensure everything is set up correctly.
# Check the status of your connectionzo status
# Expected output:# ✅ Logged in as: +2348012345678# ✅ MCP Server: Connected# ✅ API Version: v2.1.0Usage
Interactive Mode
Start an interactive session with the AI agent. This is useful for one-off queries and exploratory tasks.
zoThis opens a REPL (Read-Eval-Print Loop) where you can type natural language commands or JavaScript code.
> search("Amoxicillin 500mg", { location: "Lekki" })[ { pharmacy: "GreenCross", price: 2500, ... }, ... ]
> order({ pharmacyId: "PH-123", medicationId: "MED-456", quantity: 2 })Order ORD-789 placed successfully.Scripting
The true power of Zo Computer lies in its scripting capabilities. Create a file named order-script.js:
const { search, order } = require('@famasi/zo-computer');
async function main() { // Search for a specific medication const results = await search({ query: "Metformin 500mg", location: "Lagos", maxPrice: 3000 });
if (results.length > 0) { // Automatically order from the cheapest pharmacy const cheapest = results.sort((a, b) => a.price - b.price)[0];
console.log(`Ordering from ${cheapest.pharmacyName} at ₦${cheapest.price}...`);
const newOrder = await order({ pharmacyId: cheapest.pharmacyId, medicationId: cheapest.medicationId, quantity: 1, deliveryType: "delivery" });
console.log(`Success! Order ID: ${newOrder.orderId}`); } else { console.log("Medication not found or too expensive."); }}
main();Run the script:
zo run order-script.jsAPI Access
For even deeper integration, you can call the Famasi MCP server directly.
# Make a direct API callcurl -X POST https://api.famasi.ai/v2/search \ -H "Authorization: Bearer $(zo token)" \ -H "Content-Type: application/json" \ -d '{"query": "Paracetamol", "location": "Ikeja"}'The zo token command outputs your current authentication token, which you can use in your own HTTP clients or applications.
Commands
Zo Computer provides a comprehensive set of commands for various tasks.
| Command | Description | Example |
|---|---|---|
zo | Start interactive mode | zo |
zo run <file> | Execute a script | zo run my-script.js |
zo search <query> | Quick search from CLI | zo search "Panadol" |
zo order <id> | Place a quick order | zo order MED-123 |
zo status | Check connection status | zo status |
zo token | Get auth token | curl ... -H "Bearer $(zo token)" |
zo config | Manage configuration | zo config set default.location "Lekki" |
zo logs | View execution logs | zo logs --tail 50 |
zo doctor | Run diagnostics | zo doctor |
Configuration
Zo Computer can be customized to fit your workflow. Configuration is stored in ~/.zo/config.json.
Example Configuration:
{ "auth": { "phone": "+2348012345678", "token": "eyJhbGciOiJ..." }, "defaults": { "location": "Lekki, Lagos", "pharmacyId": "PH-456", "deliveryType": "delivery" }, "scripts": { "morning-check": "~/.zo/scripts/check-meds.js", "weekly-report": "~/.zo/scripts/report.js" }, "api": { "endpoint": "https://api.famasi.ai", "timeout": 30000, "retries": 3 }}You can modify this file directly or use the zo config command:
zo config set defaults.location "Victoria Island, Lagos"zo config get defaults.location# Output: Victoria Island, LagosAutomation Examples
Daily Medication Check
Create a cron job to check your medication supply every morning.
# Edit your crontabcrontab -e
# Add this line to run at 8:00 AM daily0 8 * * * /usr/local/bin/zo run /home/user/.zo/scripts/morning-check.js >> /home/user/.zo/logs/cron.log 2>&1morning-check.js:
const { getOrderHistory } = require('@famasi/zo-computer');
async function main() { const orders = await getOrderHistory({ limit: 5 });
// Custom logic to determine if a refill is needed const lastOrder = orders[0]; const daysSinceOrder = (Date.now() - new Date(lastOrder.date)) / (1000 * 60 * 60 * 24);
if (daysSinceOrder > 25) { console.log("⚠️ It's been over 25 days since your last order. Time for a refill!"); // You could add logic here to automatically place an order or send a notification } else { console.log("✅ Your medication supply looks good."); }}
main();Price Monitoring
Set up a script to monitor medication prices and alert you when they drop.
const { search } = require('@famasi/zo-computer');const fs = require('fs');
const MEDICATION = "Amoxicillin 500mg";const TARGET_PRICE = 2000;const PRICE_HISTORY_FILE = ".zo/price-history.json";
async function main() { const results = await search({ query: MEDICATION }); const cheapest = results.sort((a, b) => a.price - b.price)[0];
let history = []; if (fs.existsSync(PRICE_HISTORY_FILE)) { history = JSON.parse(fs.readFileSync(PRICE_HISTORY_FILE, 'utf8')); }
history.push({ date: new Date().toISOString(), price: cheapest.price }); fs.writeFileSync(PRICE_HISTORY_FILE, JSON.stringify(history, null, 2));
if (cheapest.price <= TARGET_PRICE) { console.log(`🎉 Price alert! ${MEDICATION} is now ₦${cheapest.price} at ${cheapest.pharmacyName}.`); } else { console.log(`Current price for ${MEDICATION}: ₦${cheapest.price} (Target: ₦${TARGET_PRICE})`); }}
main();Integration with Other Tools
Zo Computer can be integrated into larger workflows. For example, you can pipe its output to other command-line tools.
# Find the cheapest pharmacy and open it in your browserzo search "Paracetamol" --json | jq -r '.[0].pharmacyUrl' | xargs open
# Check order status and send a notification if it's delayedzo status --order ORD-123 | grep "delayed" && osascript -e 'display notification "Your order is delayed" with title "Famasi"'Troubleshooting
| Issue | Solution |
|---|---|
Command not found: zo | Ensure the npm global bin directory is in your PATH. Try npm config get prefix/bin. |
Authentication failed | Run zo login again. Your token may have expired. |
Script execution error | Check that you have the correct permissions (chmod +x script.js) and that the path is correct. |
API timeout | Increase the timeout in your config: zo config set api.timeout 60000. |
Module not found | Ensure you are in the correct directory or have installed the necessary npm packages in your script’s folder. |