SMF Works — AI Solutions for Small Business
← Back to all skills
Freemorning-commute

Morning 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 Services

Installation

# 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

RequirementDetailsCost
SMF Works Pro subscriptionsmfworks.com/subscribe$19.99/mo
Python 3.8+Built into macOS 12+, available on LinuxFree
OpenClawInstalled and authenticatedFree
Google Maps API keyFree $200/mo credit from GoogleFree for personal use
smfworks-skills repositoryCloned via gitIncluded

Step 1 — Subscribe to SMF Works Pro

Visit smfworks.com/subscribe.

Verify authentication:

openclaw auth status

Step 2 — Get a Google Maps API Key

  1. Go to console.cloud.google.com
  2. Create a new project (e.g., "Morning Commute")
  3. Go to APIs & Services → Library
  4. Search "Directions API" → Enable it
  5. Go to APIs & Services → Credentials
  6. Click "Create Credentials" → "API Key"
  7. Copy the key — it looks like: YOUR_GMAPS_API_KEY_HERE
  8. (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:

  1. Go to console.cloud.google.com
  2. Click the project selector at the top → "New Project"
  3. Name: Morning Commute → Click "Create"
  4. Wait for project creation (30 seconds)

Step 2 — Enable the Directions API:

  1. In the left sidebar: APIs & Services → Library
  2. Search: Directions API
  3. Click the result → Click "Enable"
  4. Wait for the API to enable

Step 3 — Create an API Key:

  1. APIs & Services → Credentials
  2. Click "+ Create Credentials" → "API Key"
  3. Your new key is displayed — copy it
  4. 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:

  1. In the API key settings page:
  2. Under "Application restrictions" → Select "IP addresses"
  3. Add your machine's public IP (find it at whatismyip.com)
  4. Under "API restrictions" → "Restrict key" → Select "Directions API"
  5. 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:

ModeWhen to useWhat it shows
drivingYou commute by carTraffic-aware route, current conditions
transitYou use public transitBus/train schedules, walking segments
walkingShort commute on footWalking route, estimated time
bicyclingYou bikeBike-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

TimeFormat
7:00 AM07:00
8:30 AM08:30
9:00 AM09:00
5:30 PM17: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

  1. How to Check Your Morning Commute
  2. How to Change Your Route or Departure Time
  3. How to Compare Driving vs Transit
  4. Automating with Cron
  5. Combining with Other Skills
  6. Troubleshooting Common Issues
  7. 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.