| name | sp-cli |
| description | SimplePractice Docker development CLI tool for managing local microservice environments. Use when working with the `sp` command, docker-compose services, app synchronization, or troubleshooting local development setup. |
SimplePractice CLI (sp)
Ruby-based CLI tool wrapping Docker Compose for managing SimplePractice's microservice development environment.
Core Architecture
- Tool name:
sp(bin/sp)
Command Patterns
All commands follow: sp <command> [args] [--help]
Essential Commands
Environment lifecycle:
sp start [app]- Start all services (or specific app)sp stop- Stop all services and prune imagessp restart [app]- Restart servicessp help- Show commands, environment vars, and service status
Service interaction:
sp attach <app>- Attach to running container's shellsp exec <app> <command>- Execute command in containersp port <app>- Show port mappings
App management:
sp apps:sync- Clone missing repos from apps/*.ymlsp apps:sync-versions- Sync package.json versions across apps
Environment Configuration
Environment sources (in load order):
- System environment
.envfile (root directory)- Inline environment blocks in YAML
- Volume-mounted env files (e.g.,
.env.lake.local)
Common variables:
AWS_PROFILE- AWS credentials profileAWS_SSO_SESSION- AWS SSO session (typically "staging")CONFIG__DEVELOPMENT_USER- Override for development userAPPS- Comma-separated list to limit running services
Lake (production data) access:
- Requires
.env.lake.localand.my.cnfin tmp/ - Setup via
sp setup-lakecommand - Mounted read-only into containers needing prod access
Service Dependencies
Common infrastructure services:
mysql- Database with health checksredis- Cache/session storecognito- LocalStack mock for AWS Cognitosnowflake- LocalStack mock for Snowflake
Troubleshooting Workflows
Service won't start
- Check status:
sp help(shows running services) - View logs:
docker compose logs <service> - Check health:
docker compose ps(shows health status) - Rebuild:
docker compose build <service> --no-cache
Port conflicts
- Find port mapping:
sp port <app> - Check what's using port:
lsof -i :<port> - Kill process or change port in app YAML
Volume issues
- Prune volumes:
docker volume prune - Recreate:
docker compose down -v && sp start - For node_modules issues, delete named volume directly
App sync failures
Missing repos:
sp apps:syncclones from apps/*.yml build contexts- Expects repos in sibling directories to dockerdev
Version conflicts:
sp apps:sync-versionsupdates package.json dependencies- Syncs ember-simplepractice and ember-messaging-client versions
- Skips unsupported apps (messaging-client, track-your-hours-rails)
Advanced Patterns
Selective service startup
Use APPS env var to limit services:
APPS=simplepractice,simplepractice-frontend sp start
Custom compose files
Commands respect COMPOSE_FILE env var:
COMPOSE_FILE=docker-compose.yml:docker-compose.local.yml sp start
Container debugging
Interactive shell:
sp attach <app> # Gets bash/sh shell
One-off commands:
sp exec <app> rails console
sp exec <app> bundle install
Database access
From host:
mysql -h 127.0.0.1 -P 3306 -u root
From container:
sp exec simplepractice mysql
Common Issues
Bundle/npm install fails:
- Volume mounts may be stale
- Solution: Rebuild container, volumes recreate automatically
Can't connect to service:
- Check OrbStack domains in /etc/hosts
- Verify container is healthy:
docker compose ps - Check labels match access pattern
Performance degradation:
- Named volumes for node_modules prevent sync overhead
- Prune unused containers:
docker system prune
AWS/Lake credentials expired:
- Refresh:
aws sso login --profile <profile> - Update .env.lake.local with new credentials