morning-commuteMorning Commute
Plan your commute with real-time traffic estimates, current weather at your location, and departure time alerts. Uses free OSRM routing with optional Google Maps API for accurate traffic. Configure your home and work addresses for personalized route planning.
Key Features
- •Route calculation with traffic estimates
- •OpenStreetMap geocoding (free)
- •OSRM routing (free)
- •Optional: OpenWeatherMap for weather
- •Optional: Google Maps for accurate traffic
- •Departure time alerts
Common Use Cases
- →Daily commute planning
- →Traffic delay warnings
- →Weather-aware departure times
- →Weekday morning routine
Custom Workflow Integration
This skill can be customized for your specific workflow as part of an SMF Works services engagement. Whether you need custom automation rules, integrations with your existing tools, or specialized configurations for your team, we can tailor this skill to fit your exact requirements.
Explore ServicesInstallation
# Install the skill (via TUI or CLI)
smfw install morning-commute
# Get help
smfw run morning-commute --help
💡 Tip: Install via the OpenClaw TUI skill manager for an interactive experience, or use the CLI command above.
Setup Guide
Morning Commute — Setup Guide
Estimated setup time: 15–20 minutes
Difficulty: Moderate (requires Google Maps API key)
Tier: Pro — requires SMF Works Pro subscription ($19.99/mo)
What You'll Need
| Requirement | Details | Cost |
|---|---|---|
| SMF Works Pro subscription | smfworks.com/subscribe | $19.99/mo |
| Python 3.8+ | Built into macOS 12+, available on Linux | Free |
| OpenClaw | Installed and authenticated | Free |
| Google Maps API key | Free $200/mo credit from Google | Free for personal use |
| smfworks-skills repository | Cloned via git | Included |
Step 1 — Subscribe to SMF Works Pro
Visit smfworks.com/subscribe.
Verify authentication:
openclaw auth status
Step 2 — Get a Google Maps API Key
- Go to console.cloud.google.com
- Create a new project (e.g., "Morning Commute")
- Go to APIs & Services → Library
- Search "Directions API" → Enable it
- Go to APIs & Services → Credentials
- Click "Create Credentials" → "API Key"
- Copy the key — it looks like:
YOUR_GMAPS_API_KEY_HERE - (Recommended) Restrict the key to the Directions API only
Cost: Google gives $200/month free credit. A daily commute check costs ~$0.005 — well within free tier.
Step 3 — Get the Repository
git clone https://github.com/smfworks/smfworks-skills ~/smfworks-skills
Step 4 — Configure the Skill
cd ~/smfworks-skills/skills/morning-commute
python3 main.py --configure
Prompts:
Google Maps API Key: [paste key]
Home address: 123 Main St, New York, NY 10001
Work address: 456 Business Ave, New York, NY 10002
Departure time [08:00]: 08:00
Travel mode (driving/transit/walking/bicycling) [driving]: driving
✅ Configuration saved!
Step 5 — Verify
python3 main.py
Expected: A formatted commute briefing with travel time and traffic conditions.
Configuration File
Location: ~/.config/smf/skills/morning-commute/config.json
Troubleshooting
Error: SMF Works Pro subscription required — Subscribe at smfworks.com/subscribe.
REQUEST_DENIED — Enable the Directions API in Google Cloud Console for your project.
ZERO_RESULTS — Use full street addresses with city and ZIP code.
API key not valid — Check the key is correctly copied with no extra spaces.
Configuration File Details
Your configuration is saved at:
~/.config/smf/skills/morning-commute/config.json
Sample configuration:
{
"google_maps_api_key": "YOUR_GMAPS_API_KEY_HERE",
"home_address": "123 Main St, New York, NY 10001",
"work_address": "456 Business Ave, New York, NY 10002",
"departure_time": "08:00",
"travel_mode": "driving"
}
Edit directly or re-run --configure to update.
Google Maps API Setup in Detail
Step 1 — Create a Google Cloud Project:
- Go to console.cloud.google.com
- Click the project selector at the top → "New Project"
- Name:
Morning Commute→ Click "Create" - Wait for project creation (30 seconds)
Step 2 — Enable the Directions API:
- In the left sidebar: APIs & Services → Library
- Search:
Directions API - Click the result → Click "Enable"
- Wait for the API to enable
Step 3 — Create an API Key:
- APIs & Services → Credentials
- Click "+ Create Credentials" → "API Key"
- Your new key is displayed — copy it
- Click "Edit API key" to add restrictions (recommended)
Step 4 — Restrict Your API Key (Recommended):
Restricting your key prevents unauthorized use if it's ever exposed:
- In the API key settings page:
- Under "Application restrictions" → Select "IP addresses"
- Add your machine's public IP (find it at whatismyip.com)
- Under "API restrictions" → "Restrict key" → Select "Directions API"
- Save
Step 5 — Verify the API Key Works:
Test directly:
curl "https://maps.googleapis.com/maps/api/directions/json?origin=New+York&destination=Brooklyn&key=YOUR_KEY_HERE" | python3 -m json.tool | head -5
Expected: A JSON response with route data (not an error).
Understanding Google Maps Costs
The Directions API costs $0.005 per request (as of 2024). Google provides $200 free credit per month.
Your estimated monthly cost:
1 check/day × 30 days × $0.005 = $0.15/month
2 checks/day × 30 days × $0.005 = $0.30/month
Both are well within the $200 free tier. You won't be charged unless you significantly exceed this.
Monitor your usage:
- Go to Google Cloud Console → Billing → Overview
- Verify charges remain at $0 (within free credit)
Set up billing alerts:
- Billing → Budgets & alerts → Create Budget
- Set alert threshold at $5 to catch any unexpected usage
Travel Mode Options
Configure via --configure or edit the config file:
| Mode | When to use | What it shows |
|---|---|---|
driving | You commute by car | Traffic-aware route, current conditions |
transit | You use public transit | Bus/train schedules, walking segments |
walking | Short commute on foot | Walking route, estimated time |
bicycling | You bike | Bike-friendly routes |
Tip: Set to driving even if you sometimes take transit — driving mode shows the best traffic picture. Transit mode requires transit data to be available for your area.
Address Format Tips
For best results, use complete addresses:
Good:
123 Main Street, New York, NY 10001, USA
456 Business Ave Suite 200, Chicago, IL 60601
Less reliable:
123 Main St
My Office
Work
Google Maps is flexible, but complete addresses with ZIP codes are most reliable. Test your addresses at maps.google.com first to confirm they resolve correctly.
Departure Time Format
Set as 24-hour format: HH:MM
| Time | Format |
|---|---|
| 7:00 AM | 07:00 |
| 8:30 AM | 08:30 |
| 9:00 AM | 09:00 |
| 5:30 PM | 17:30 |
The skill queries Google Maps for traffic conditions at your configured departure time.
Verifying Your Setup Works Correctly
After running --configure, test that everything is working:
Step 1 — Run the skill:
python3 main.py
Step 2 — Check the output includes traffic data:
A working output looks like:
🚗 Morning Commute Briefing — Wednesday, March 15, 2024
Departure: 8:00 AM
📍 Route: 123 Main St → 456 Business Ave
Distance: 12.3 miles
🚗 Driving
Typical time: 28 min
Current time: 32 min
Estimated arrival: 8:32 AM
Step 3 — Verify traffic data is live:
If "Typical time" and "Current time" are the same, traffic data may not be working. This can happen if:
- You're running it outside business hours (less traffic data available)
- The Directions API isn't fully enabled yet (wait 5 minutes after enabling)
Step 4 — Test edge cases:
Run during different times to see how traffic varies:
# Normal time
python3 main.py
# Verify it shows reasonable numbers for your route
Common Setup Mistakes
Wrong API key (has extra spaces or missing characters): API keys from Google Cloud Console are exactly 39 characters. If yours is shorter or longer, re-copy it carefully.
Directions API enabled but key not working: There can be a 5-minute delay after enabling a new API before the key starts working. Wait and retry.
Home or work address resolves to wrong location: Test your addresses at maps.google.com before configuring. If Google Maps shows the right place, the skill will too.
Configured for transit mode but no transit data appears:
Not all areas have detailed transit data in Google Maps. Switch to driving for the best results.
Uninstalling / Resetting
To reset the configuration and start fresh:
rm ~/.config/smf/skills/morning-commute/config.json
python3 main.py --configure
This wipes the saved config without deleting the skill files.
Next Steps
Setup complete. See HOWTO.md for daily usage and cron automation.
How-To Guide
Morning Commute — How-To Guide
Prerequisites: SMF Works Pro subscription active. Google Maps API key configured. Setup complete (see SETUP.md).
Table of Contents
- How to Check Your Morning Commute
- How to Change Your Route or Departure Time
- How to Compare Driving vs Transit
- Automating with Cron
- Combining with Other Skills
- Troubleshooting Common Issues
- Tips & Best Practices
1. How to Check Your Morning Commute
What this does: Queries Google Maps for current traffic on your configured route and presents a commute briefing.
When to use it: Every morning 15–30 minutes before you plan to leave.
Steps
Step 1 — Navigate to the skill.
cd ~/smfworks-skills/skills/morning-commute
Step 2 — Run the briefing.
python3 main.py
Output:
🚗 Morning Commute Briefing — Wednesday, March 15, 2024
Departure: 8:00 AM
═══════════════════════════════════════════════════════
📍 Route: 123 Main St → 456 Business Ave
Distance: 12.3 miles
🚗 Driving
Typical time: 28 min
Current time: 42 min ⚠️ (heavy traffic)
Estimated arrival: 8:42 AM
🚇 Transit
Next departure: 8:07 AM
Estimated arrival: 8:51 AM
Configure: smf run morning-commute --configure
Step 3 — Decide your commute strategy.
- If current time is close to typical, traffic is normal — leave as planned
- If current time is significantly longer (as above), consider:
- Leaving earlier
- Taking transit if faster
- Waiting for traffic to clear
Result: You leave at the right time with confidence.
2. How to Change Your Route or Departure Time
When to use it: You're working at a different location today, or have an earlier/later meeting.
Steps
Step 1 — Re-run configure.
python3 main.py --configure
Step 2 — Update the relevant settings.
Press Enter to keep any setting unchanged, or type a new value.
Step 3 — Run to verify the new route.
python3 main.py
Result: Your briefing now shows the updated route.
3. How to Compare Driving vs Transit
When to use it: You're deciding whether to drive or take public transit.
Steps
Step 1 — Check driving (if that's your current mode).
python3 main.py
Note the estimated travel time.
Step 2 — Switch mode to transit.
Edit ~/.config/smf/skills/morning-commute/config.json and change travel_mode to transit, or re-run --configure.
Step 3 — Run again for transit comparison.
python3 main.py
Step 4 — Decide which is faster today.
Result: Data-driven commute decision every morning.
4. Automating with Cron
Open crontab
crontab -e
Example: Generate commute briefing weekdays at 7 AM
0 7 * * 1-5 python3 /home/yourname/smfworks-skills/skills/morning-commute/main.py > /home/yourname/commute-brief.txt 2>&1
Then read it when you wake up:
cat ~/commute-brief.txt
Example: Print commute in terminal at login (add to ~/.bashrc)
python3 ~/smfworks-skills/skills/morning-commute/main.py
5. Combining with Other Skills
Morning Commute + Coffee Briefing: Complete morning overview — weather, calendar, commute:
python3 ~/smfworks-skills/skills/coffee-briefing/main.py
python3 ~/smfworks-skills/skills/morning-commute/main.py
Create a morning.sh script:
#!/bin/bash
echo "=== MORNING BRIEFING ==="
python3 ~/smfworks-skills/skills/coffee-briefing/main.py
echo ""
echo "=== COMMUTE ==="
python3 ~/smfworks-skills/skills/morning-commute/main.py
6. Troubleshooting Common Issues
Error: SMF Works Pro subscription required
Fix: Subscribe at smfworks.com/subscribe and re-authenticate.
REQUEST_DENIED from Google Maps
Google Maps API isn't configured correctly.
Fix: Go to Google Cloud Console → APIs & Services → Library → Ensure "Directions API" is enabled for your project. Check your API key restrictions.
ZERO_RESULTS
No route was found between your addresses.
Fix: Use complete street addresses with city, state, and ZIP code. Avoid abbreviations.
Traffic data not shown
Traffic data requires the "Directions API" specifically with traffic model support.
Fix: Ensure driving mode is set (transit/walking don't show traffic). Verify API key has correct permissions.
7. Tips & Best Practices
Run 15–20 minutes before departure. Too early and traffic conditions may change; too late and you're already rushing. The 15–20 minute window is the sweet spot.
Save driving vs transit comparison data. If you regularly commute, note which days driving is faster vs transit. Patterns emerge (e.g., Thursdays are always congested).
Use cron for passive awareness. Schedule the briefing to run at 7 AM so you can glance at the output while having breakfast — no need to remember to run it manually.
Restrict your Google Maps API key. In Google Cloud Console, add an IP restriction to your API key so only your machine can use it. This prevents abuse if the key is accidentally exposed.
Check the Google API dashboard monthly. Even on the free tier, verify your usage in Google Cloud Console under APIs & Services → Dashboard. One daily check is ~$0.30/month — easily within the $200 free credit.
