@macroprompt/cli
v1.0.0
Published
MacroPrompt Command Line Interface
Downloads
4
Maintainers
Readme
MacroPrompt CLI
A command-line interface for managing MacroPrompt AI Actions directly from your terminal.
Installation
Prerequisites
- Node.js 16 or higher
- npm or yarn
Install from source
- Clone or download the CLI directory
- Navigate to the CLI directory:
cd cli - Install dependencies:
npm install - Link the CLI globally:
npm link
Now you can use the mpr command from anywhere in your terminal.
Authentication
Before using any commands, you need to authenticate with your MacroPrompt account:
mpr loginTo logout:
mpr logoutCommands
mpr login
Authenticate with your MacroPrompt account.
mpr loginmpr logout
Logout from your MacroPrompt account.
mpr logoutmpr create [parameters...]
Create a new AI Action interactively.
mpr createThe command will guide you through:
- Basic information (title, description, AI prompt)
- Input parameters configuration
- Output parameters configuration
- Optional model selection
mpr list-actions
List all your AI Actions.
mpr list-actionsDisplays:
- AI Action titles and descriptions
- Status (Active/Inactive)
- Input/Output counts
- Creation dates
- Webhook URLs
- Execution counts
mpr delete <ai-action-id>
Delete an AI Action.
mpr delete 507f1f77bcf86cd799439011Warning: This action cannot be undone. The command will ask for confirmation.
mpr describe <ai-action-id>
Show detailed information about an AI Action.
mpr describe 507f1f77bcf86cd799439011Displays:
- Complete AI Action details
- Input/Output specifications
- AI prompt
- Model configuration
- Recent executions
- Webhook information
mpr execution <execution-id>
View details of a specific execution.
mpr execution 507f1f77bcf86cd799439012Shows:
- Execution status and timing
- Input and output data
- Error information (if any)
- Model usage and costs
- Feedback status
mpr feedback <execution-id> <up|down>
Provide feedback for an execution.
mpr feedback 507f1f77bcf86cd799439012 up
mpr feedback 507f1f77bcf86cd799439012 downYou can also use:
thumbs-up/thumbs-down1/-1
Optionally add a comment when prompted.
mpr update <ai-action-id> [details...]
Update an existing AI Action.
mpr update 507f1f77bcf86cd799439011Allows updating:
- Title and description
- AI Action prompt
- Status (Active/Inactive)
- Input and output parameters
- Model configuration
mpr enhance <ai-action-id>
Enhance a manual AI Action using AI-powered improvements.
mpr enhance 507f1f77bcf86cd799439011Enhancement types:
- Auto Enhancement: Automatic AI-powered improvements
- Guided Enhancement: Step-by-step improvements with your input
- Performance Analysis: Analyze and suggest improvements
Configuration
The CLI stores configuration and authentication data in your system's config directory:
- macOS:
~/Library/Preferences/macroprompt-cli/ - Linux:
~/.config/macroprompt-cli/ - Windows:
%APPDATA%\macroprompt-cli\
Environment Variables
MACROPROMPT_API_URL: Override the default API URL (default:https://macroprompt.cloud/api)
Examples
Create a simple AI Action
mpr create
# Follow the interactive promptsList all AI Actions
mpr list-actionsGet detailed info about an AI Action
mpr describe 507f1f77bcf86cd799439011Provide positive feedback for an execution
mpr feedback 507f1f77bcf86cd799439012 upEnhance an AI Action
mpr enhance 507f1f77bcf86cd799439011Error Handling
The CLI provides clear error messages and suggestions:
- Authentication errors will prompt you to login
- Invalid IDs will show available options
- Network errors will display retry suggestions
- Validation errors will explain what needs to be fixed
Support
For issues or questions:
- Check the error message for specific guidance
- Ensure you're authenticated with
mpr login - Verify AI Action IDs with
mpr list-actions - Contact MacroPrompt support if problems persist
Development
Project Structure
cli/
├── bin/
│ └── mpr.js # Main CLI executable
├── commands/
│ ├── login.js # Login command
│ ├── logout.js # Logout command
│ ├── create.js # Create AI Action
│ ├── list-actions.js # List AI Actions
│ ├── delete.js # Delete AI Action
│ ├── describe.js # Describe AI Action
│ ├── execution.js # View execution
│ ├── feedback.js # Provide feedback
│ ├── update.js # Update AI Action
│ └── enhance.js # Enhance AI Action
├── utils/
│ └── auth.js # Authentication utilities
├── package.json
└── README.mdAdding New Commands
- Create a new file in
commands/ - Export an async function that handles the command
- Add the command to
bin/mpr.js - Update this README
License
MIT License - see LICENSE file for details.
