Getting Started
Installation
Installation Guide
This guide will help you install and set up the Metaplex CLI on your system.
Prerequisites
Before installing the CLI, ensure you have:
- Node.js 16.x or later
- npm 7.x or later
- A Solana wallet (optional, but recommended)
- Git (optional, for development)
Installation Methods
Using npm (Recommended)
npm install -g @metaplex-foundation/cli
Using yarn
yarn global add @metaplex-foundation/cli
Using pnpm
pnpm add -g @metaplex-foundation/cli
Verify Installation
After installation, verify that the CLI is properly installed:
mplx --version
You should see the current version of the CLI displayed.
Initial Setup
1. Create Configuration Directory
The CLI will automatically create a configuration file at ~/.config/mplx
when first setting config settings. This config stores:
- Wallet configurations
- RPC endpoint settings
- Explorer preferences
- Other CLI settings
2. Configure Your Environment
Set up a Wallet
# Create a new wallet
mplx config wallets new --name dev1
# Or add an existing wallet
mplx config wallets add <name> <path>
mplx config wallets add dev1 /path/to/keypair.json
# After adding a wallet you'll need to set it
mplx config wallets set
Further reading see
Configure RPC Endpoint
mplx config set rpcUrl https://api.mainnet-beta.solana.com
Set Preferred Explorer
mplx config explorer set
Development Installation
If you want to contribute to the CLI or run it from source:
- Clone the repository:
git clone https://github.com/metaplex-foundation/cli.git
cd cli
- Install dependencies:
npm install
- Build the project:
npm run build
- Link the CLI:
npm link
Troubleshooting
Common Issues
Command Not Found
- Ensure the global npm bin directory is in your PATH
- Try reinstalling the package
Permission Errors
- Use
sudo
for global installation on Unix-based systems - Or configure npm to install global packages without sudo
- Use
Node Version Issues
- Use nvm to manage Node.js versions
- Ensure you're using a compatible Node.js version
Getting Help
If you encounter any issues:
- Check the documentation
- Search GitHub issues
- Join the Discord community
Next Steps
Now that you have the CLI installed, you can:
Updating
To update the CLI to the latest version:
npm update -g @metaplex-foundation/cli
Or if you installed via yarn:
yarn global upgrade @metaplex-foundation/cli
Uninstallation
To remove the CLI:
npm uninstall -g @metaplex-foundation/cli
Or if you installed via yarn:
yarn global remove @metaplex-foundation/cli