A lightweight CLI tool to streamline common development tasks. Built to scratch my own itch after typing the same commands hundreds of times.
mo handles the repetitive stuff - creating databases, switching environment configs, syncing files between local and remote servers. Nothing fancy, just saves time.
git clone https://github.com/lpheller/mogo.git
cd mogo
go build -o mo
sudo mv mo /usr/local/bin/Or with Go installed:
go install github.com/lpheller/mogo@latestmo db create mydb # Create a new MySQL database
mo db list # List all databases
mo db open # Open database clientAliases: db:create, createdb, etc. - whatever feels natural.
mo l:clear # Clear all caches (or: mo lc)
mo l:fresh # Migrate fresh with seed (or: mo lf)
mo l:fresh --no-seed # Without seeding
# Or with subcommands:
mo l clear
mo l freshQuick switches for common Laravel .env configurations:
mo env sqlite # Switch to SQLite
mo env mailtrap # Configure Mailtrap for emails
mo env maildev # Use local Maildev
mo env sync # Sync .env with .env.exampleOpen config files without remembering where they are:
mo config nvim # Opens your nvim config
mo config git # Opens .gitconfig
mo config -e vim myapp # Use vim instead of default editorFirst time? Run mo config:edit to set up your config paths.
Manage SSH connections and connect to servers:
mo ssh forge@example.com # Connect to server (adds to config if new)
mo ssh -c # Interactive host selection with fzf
mo ssh # Same as above
mo ssh:add myserver user@host # Manually add SSH entry
mo ssh:list # List all SSH entries
mo ssh:connect # Interactive selection with fzfSmart connection: When you use mo ssh <connection>, it will:
- Check if the connection already exists in
~/.ssh/config - If not found, prompt you for a name and save it automatically
- Connect immediately after adding
All entries are stored in your ~/.ssh/config file and can be used with regular ssh commands afterward.
mo setup # Auto-detect and setup project (composer, npm, migrations, etc.)Detects Laravel, Node.js projects and runs the appropriate setup steps.
Sync databases and storage folders between local and remote servers (Laravel Projects):
mo pull --database # Pull database from remote server
mo pull --storage # Pull storage folder
mo push --database # Push database to remote
mo push --storage # Push storage folderRequires SSH config in your projects .env file. When no PULL_SSH_HOST, PULL_SSH_HOST, and PULL_PROJECT_DIR are set, mo will prompt you to enter them. These values are then stored in the local .env for future use. Same goes for mo push.
Config lives in ~/.config/mortimer/config.json:
{
"db_user": "root",
"db_password": "",
"db_host": "127.0.0.1",
"db_port": "3306",
"editor": "vscode",
"config_paths": {
"nvim": "/Users/you/.config/nvim/init.vim",
"git": "/Users/you/.gitconfig"
}
}Edit with mo config:edit or add your own shortcuts.
Short for Mortimer/ Morty. Needed a CLI sidekick that's short to type and doesn't clash with existing commands. Plus, typing mo hundreds of times a day just feels right.
go test ./... # Run tests
go build # Build binaryMIT - do whatever you want with it.