@jcodigital/jman
v1.5.0
Published
A command-line tool for managing projects
Readme
jman
jman is a command-line utility designed to manage WordPress sites hosted on SpinupWP, with additional support for MainWP integration. It provides a streamlined way to fetch site data, run remote wp-cli commands, manage plugins, and create administrative users across multiple sites.
Features
- SpinupWP Integration: Fetch and list site/server data directly from the SpinupWP API.
- Remote WP-CLI: Execute
wp-clicommands on remote sites via SSH. - MainWP Support: Automated MainWP Child plugin installation and site management.
- Bulk Operations: Perform actions like disabling file modifications or installing plugins across multiple sites.
- Site Aliases: Generate YAML-based alias files for SSH and WP-CLI, supporting both individual sites and server-based groups.
- Local Caching: Optimized performance by caching site and server metadata locally.
Installation
The best way to install jman is via pnpm:
pnpm install -g @jcodigital/jmanPrerequisites
- Node.js (v18 or later recommended)
pnpm(recommended)- SSH access configured for your SpinupWP servers.
Building from source
Clone the repository:
git clone https://github.com/JCO-Digital/jman.git cd jmanInstall dependencies:
pnpm installBuild the project:
pnpm run build
The binary will be generated at ./dist/jman.
Configuration
jman uses a TOML configuration file located in your XDG config directory (typically ~/.config/jman/config.toml on Linux).
Create the file and add your credentials:
tokenSpinup = "your_spinupwp_api_token"
tokenMainwp = "your_mainwp_api_token" (optional)
urlMainwp = "https://your-mainwp-dashboard.com" (optional)Usage
jman <command> [target] [args...]Local Caching
To speed up operations, jman caches site and server data from SpinupWP. If you add new sites or servers, you should run the fetch command to update your local cache:
jman fetchAvailable Commands
| Command | Description |
| :--------- | :---------------------------------------------------------------------------------- |
| fetch | Fetch latest data from SpinupWP and update local cache. |
| list | List cached data from SpinupWP. |
| wp | Run a wp-cli command on a target site. |
| search | Search for a specific term across sites. |
| admin | Create a new administrator user on target sites. |
| plugin | Install a plugin on target sites. Supports WordPress.org slugs or custom repo URLs. |
| mods | Set DISALLOW_FILE_MODS to true on target sites. |
| alias | Create SSH/WP-CLI alias files for all sites or a filtered collection. |
| inactive | List sites that don't have an active MainWP Child connection. |
| mainwp | Install and configure MainWP on sites. |
Examples
Run WP-CLI on a site:
jman wp mysite.com plugin list --status=activeInstall a plugin on a site:
jman plugin mysite.com akismetCreate an admin user:
jman admin mysite.com myusername [email protected]Generate WP-CLI aliases for a server group:
# This outputs a YAML structure compatible with WP-CLI's alias configuration
jman alias my-server-name > ~/.wp-cli/alias.ymlDevelopment
- Run in development mode:
pnpm run dev - Linting:
pnpm run test - Formatting:
pnpm run format
License
GPL-3.0-only
