Răsfoiți Sursa

cli docs update

tonyboylehub 5 luni în urmă
părinte
comite
6c92ef98dd

+ 2 - 2
src/components/products/cli/index.js

@@ -63,10 +63,10 @@ export const cli = {
             },
             {
               title: 'Update Asset',
-              href: '/cli/core/update',
+              href: '/cli/core/update-asset',
             },
             {
-              title: 'Fetch Asset',
+              title: 'Fetch Asset or Collection',
               href: '/cli/core/fetch',
             },
           ],

+ 0 - 130
src/pages/cli/config/rpc.md

@@ -1,130 +0,0 @@
----
-title: RPC Configuration
-description: Manage RPC endpoints in your configuration
----
-
-The `mplx config rpc` commands allow you to manage RPC endpoints in your configuration. You can add, remove, list, and set active RPC endpoints.
-
-## Basic Usage
-
-### Add an RPC
-```bash
-mplx config rpc add <name> <endpoint>
-```
-
-### List RPCs
-```bash
-mplx config rpc list
-```
-
-### Remove an RPC
-```bash
-mplx config rpc remove <name>
-```
-
-### Set Active RPC
-```bash
-mplx config rpc set
-```
-
-## Commands
-
-### Add RPC
-Adds a new RPC endpoint to your configuration.
-
-#### Arguments
-- `name`: Name of RPC (max 15 characters, no spaces)
-- `endpoint`: RPC endpoint URL
-
-#### Examples
-```bash
-mplx config rpc add mainnet https://api.mainnet-beta.solana.com
-mplx config rpc add devnet https://api.devnet.solana.com
-```
-
-#### Notes
-- RPC name must be 15 characters or less
-- RPC name cannot contain spaces
-- Cannot add duplicate RPC names or endpoints
-- The endpoint must be a valid URL
-
-### List RPCs
-Lists all RPC endpoints in your configuration.
-
-#### Examples
-```bash
-mplx config rpc list
-```
-
-#### Output
-```
-Installed RPCs:
-┌─────────┬────────────┬────────────────────────────────────────────┐
-│ (index) │    name    │                  endpoint                   │
-├─────────┼────────────┼────────────────────────────────────────────┤
-│    0    │ 'mainnet'  │ 'https://api.mainnet-beta.solana.com'      │
-│    1    │ 'devnet'   │ 'https://api.devnet.solana.com'            │
-└─────────┴────────────┴────────────────────────────────────────────┘
-```
-
-### Remove RPC
-Removes an RPC endpoint from your configuration.
-
-#### Arguments
-- `name`: Name of RPC to remove
-
-#### Examples
-```bash
-mplx config rpc remove devnet
-```
-
-#### Notes
-- The RPC must exist in your configuration
-- This only removes the RPC from configuration, it doesn't affect the actual endpoint
-
-### Set Active RPC
-Sets a new active RPC endpoint from your configured endpoints.
-
-#### Examples
-```bash
-mplx config rpc set
-```
-
-#### Notes
-- Opens an interactive prompt to select from available RPC endpoints
-- Updates the active RPC in your configuration
-- The selected RPC will be used for subsequent commands
-- If no RPC is selected in the configuration, the command will default to using the Solana default RPC endpoint
-
-## Configuration File
-
-The RPC configuration is stored in your config file (default: `~/.mplx/config.json`). The structure looks like this:
-
-```json
-{
-  "rpcs": [
-    {
-      "name": "mainnet",
-      "endpoint": "https://api.mainnet-beta.solana.com"
-    },
-    {
-      "name": "devnet",
-      "endpoint": "https://api.devnet.solana.com"
-    }
-  ],
-  "rpcUrl": "https://api.mainnet-beta.solana.com"
-}
-```
-
-## Notes
-
-- All RPC operations modify your local configuration file
-- The active RPC (specified by `rpcUrl`) is used for network connections
-- If no RPC is configured, the command will use the Solana default RPC endpoint
-- RPC names are case-sensitive
-- The configuration file is automatically created if it doesn't exist
-- You can use any valid Solana RPC endpoint URL
-- Common RPC endpoints include:
-  - Mainnet: `https://api.mainnet-beta.solana.com`
-  - Devnet: `https://api.devnet.solana.com`
-  - Testnet: `https://api.testnet.solana.com`

+ 0 - 162
src/pages/cli/config/wallet.md

@@ -1,162 +0,0 @@
----
-title: Wallet Configuration
-description: Manage wallets in your configuration
----
-
-The `mplx config wallet` commands allow you to manage wallets in your configuration. You can create new wallets, add existing ones, remove, list, and set active wallets.
-
-## Basic Usage
-
-### Create a New Wallet
-```bash
-mplx config wallet new [options]
-```
-
-### Add an Existing Wallet
-```bash
-mplx config wallet add <name> <path>
-```
-
-### List Wallets
-```bash
-mplx config wallet list
-```
-
-### Remove a Wallet
-```bash
-mplx config wallet remove <name>
-```
-
-### Set Active Wallet
-```bash
-mplx config wallet set
-```
-
-## Commands
-
-### Create New Wallet
-Creates a new wallet and optionally adds it to your configuration.
-
-#### Options
-- `--name <string>`: Name for wallet (max 6 characters, alphanumeric, hyphens and underscores only)
-- `--output <path>`: Directory path where to save the wallet file
-- `--hidden`: Save wallet in the hidden `mplx config` folder
-
-#### Examples
-```bash
-# Create a new wallet in current directory
-mplx config wallet new
-
-# Create a named wallet and add it to config
-mplx config wallet new --name dev1
-
-# Create a wallet in a specific directory
-mplx config wallet new --name dev1 --output ./wallets
-
-# Create a wallet in the hidden config directory
-mplx config wallet new --name dev1 --hidden
-```
-
-#### Notes
-- If no name is provided, the wallet will be created but not added to config
-- If a name is provided, the wallet will be automatically added to config
-- Wallet name must be 6 characters or less
-- Wallet name can only contain alphanumeric characters, hyphens and underscores
-- The wallet file will be named using the format: `<name>-<publicKey>.json` or `<publicKey>.json` if no name is provided
-- Cannot create a wallet with a name, path, or address that already exists in config
-
-### Add Wallet
-Adds an existing wallet to your configuration.
-
-#### Arguments
-- `name`: Name of wallet (max 6 characters, no spaces)
-- `path`: Path to keypair JSON file
-
-#### Examples
-```bash
-mplx config wallet add dev1 /path/to/keypair.json
-```
-
-#### Notes
-- Wallet name must be 6 characters or less
-- Wallet name cannot contain spaces
-- Keypair file must be a JSON file
-- Cannot add duplicate wallet names, paths, or addresses
-- The wallet's public key will be automatically extracted from the keypair file
-
-### List Wallets
-Lists all wallets in your configuration.
-
-#### Examples
-```bash
-mplx config wallet list
-```
-
-#### Output
-```
-Installed Wallets:
-┌─────────┬────────┬──────────────────────────────┬──────────────────────────────┐
-│ (index) │  name  │            path             │           address            │
-├─────────┼────────┼──────────────────────────────┼──────────────────────────────┤
-│    0    │ 'dev1' │ '/path/to/keypair.json'     │ '5avjMVza8SuMhgTfzEGNWJsk...' │
-│    1    │ 'dev2' │ '/path/to/another.json'     │ 'HaKyubAWuTS9AZkpUHtFkTK...'  │
-└─────────┴────────┴──────────────────────────────┴──────────────────────────────┘
-```
-
-### Remove Wallet
-Removes a wallet from your configuration.
-
-#### Arguments
-- `name`: Name of wallet to remove
-
-#### Examples
-```bash
-mplx config wallet remove dev1
-```
-
-#### Notes
-- The wallet must exist in your configuration
-- This only removes the wallet from configuration, it doesn't delete the keypair file
-
-### Set Active Wallet
-Sets a new active wallet from your configured wallets.
-
-#### Examples
-```bash
-mplx config wallet set
-```
-
-#### Notes
-- Opens an interactive prompt to select from available wallets
-- Updates the active wallet in your configuration
-- The selected wallet will be used for subsequent commands
-- If no wallet is selected in the configuration, the command will default to using the Solana CLI default wallet (`~/.config/solana/id.json`)
-
-## Configuration File
-
-The wallet configuration is stored in your config file (default: `~/.mplx/config.json`). The structure looks like this:
-
-```json
-{
-  "wallets": [
-    {
-      "name": "dev1",
-      "address": "5avjMVza8SuMhgTfzEGNWJskDELMCQk9juAAc8zeQoNa",
-      "path": "/path/to/keypair.json"
-    }
-  ],
-  "keypair": "/path/to/active/keypair.json"
-}
-```
-
-## Notes
-
-- All wallet operations modify your local configuration file
-- The active wallet (specified by `keypair`) is used for transactions
-- If no wallet is configured, the command will use the Solana CLI default wallet (`~/.config/solana/id.json`)
-- Wallet names are case-sensitive
-- Keypair files must be valid Solana keypair JSON files
-- The configuration file is automatically created if it doesn't exist
-- Wallet addresses are displayed in shortened format for better readability
-- New wallets can be created in any directory or in the hidden config directory
-- Wallet files are named using the public key for uniqueness 

+ 5 - 5
src/pages/cli/core/create-collection.md

@@ -31,13 +31,13 @@ mplx core collection create --wizard
 ## Options
 
 ### Basic Options
-- `-n, --name <string>`: Collection name (required for simple creation)
-- `-u, --uri <string>`: URI of the Collection metadata (required for simple creation)
+- `--name <string>`: Collection name (required for simple creation)
+- `--uri <string>`: URI of the Collection metadata (required for simple creation)
 
 ### File-based Options
-- `-f, --files`: Flag to indicate file-based creation
-- `-i, --image <path>`: Path to image file to upload and assign to Collection
-- `-j, --json <path>`: Path to JSON metadata file
+- `--files`: Flag to indicate file-based creation
+- `--image <path>`: Path to image file to upload and assign to Collection
+- `--json <path>`: Path to JSON metadata file
 
 ### Plugin Options
 - `--plugins`: Use interactive plugin selection

+ 8 - 7
src/pages/cli/core/fetch.md

@@ -15,15 +15,15 @@ mplx core fetch asset <assetId>
 ### Download Options
 ```bash
 mplx core fetch asset <assetId> --download --output ./assets
-mplx core fetch asset <assetId> --download --image-only
-mplx core fetch asset <assetId> --download --metadata-only
+mplx core fetch asset <assetId> --download --image
+mplx core fetch asset <assetId> --download --metadata
 ```
 
 ### Asset Fetch Options
-- `--download`: Download asset files to disk
+- `--download`: Download asset files to disk (can select individual files also with additional flags)
 - `--output <path>`: Directory path where to save the downloaded assets (requires --download)
-- `--image-only`: Only download the image file (requires --download)
-- `--metadata-only`: Only download the metadata file (requires --download)
+- `--image`: Download the image file (requires --download)
+- `--metadata`: Download the metadata file (requires --download)
 - `--asset`: Download the asset data file (requires --download)
 
 ## Fetch Collection
@@ -56,7 +56,7 @@ mplx core fetch asset 5avjMVza8SuMhgTfzEGNWJskDELMCQk9juAAc8zeQoNa --download --
 
 3. Download only the image:
 ```bash
-mplx core fetch asset 5avjMVza8SuMhgTfzEGNWJskDELMCQk9juAAc8zeQoNa --download --image-only
+mplx core fetch asset 5avjMVza8SuMhgTfzEGNWJskDELMCQk9juAAc8zeQoNa --download --image
 ```
 
 ### Fetch Collection Examples
@@ -79,7 +79,7 @@ When downloading files, the following structure will be created:
   <assetId>/
     metadata.json
     image.<extension>
-    asset.<extension> (if --asset flag is used)
+    asset.json
 ```
 
 ### Collection Fetch Output
@@ -89,6 +89,7 @@ When downloading files, the following structure will be created:
   <collectionId>/
     metadata.json
     image.<extension>
+    collection.json
 ```
 
 ## Notes

+ 86 - 0
src/pages/cli/core/plugins.md

@@ -0,0 +1,86 @@
+---
+title: Plugins
+description: Manage MPL Core Asset and Collection plugins
+---
+
+The `mplx core plugins` commands allow you to manage plugins for MPL Core Assets and Collections. Plugins extend the functionality of assets and collections with additional features and capabilities.
+
+## Add Plugin
+
+Add a plugin to an asset or collection.
+
+### Basic Usage
+
+```bash
+mplx core plugins add <assetId> [options]
+```
+
+### Options
+- `--wizard`: Interactive wizard mode to select and configure plugins
+- `--collection`: Flag to indicate if the target is a collection (default: false)
+
+### Methods
+
+#### 1. Using Wizard Mode
+```bash
+mplx core plugins add <assetId> --wizard
+```
+This will:
+1. Launch an interactive wizard to select the plugin type
+2. Guide you through plugin configuration
+3. Add the configured plugin to the asset/collection
+
+#### 2. Using JSON File
+```bash
+mplx core plugins add <assetId> ./plugin.json
+```
+The JSON file should contain the plugin configuration in the following format:
+```json
+{
+  "pluginType": {
+    "property1": "value1",
+    "property2": "value2"
+  }
+}
+```
+
+### Examples
+
+#### Add Plugin to Asset
+```bash
+mplx core plugins add 5avjMVza8SuMhgTfzEGNWJskDELMCQk9juAAc8zeQoNa --wizard
+```
+
+#### Add Plugin to Collection
+```bash
+mplx core plugins add 5avjMVza8SuMhgTfzEGNWJskDELMCQk9juAAc8zeQoNa --wizard --collection
+```
+
+#### Add Plugin Using JSON
+```bash
+mplx core plugins add 5avjMVza8SuMhgTfzEGNWJskDELMCQk9juAAc8zeQoNa ./my-plugin.json
+```
+
+## Output
+
+After a successful plugin addition, the command will display:
+```
+--------------------------------
+  Asset: <assetId>
+  Signature: <transactionSignature>
+  Explorer: <explorerUrl>
+  Core Explorer: https://core.metaplex.com/explorer/<assetId>
+--------------------------------
+```
+
+## Notes
+
+- The wizard mode provides an interactive way to select and configure plugins
+- Different plugins are available for assets and collections
+- Plugin configuration must be valid according to the plugin's requirements
+- You must have the appropriate authority to add plugins to the asset or collection
+- The command will automatically handle:
+  - Plugin type validation
+  - Configuration validation
+  - Transaction signing and confirmation
+  - Authority verification 

+ 9 - 25
src/pages/cli/core/update.md → src/pages/cli/core/update-asset.md

@@ -3,13 +3,13 @@ title: Update Asset
 description: Update MPL Core Asset metadata and properties
 ---
 
-The `mplx core update` command allows you to update MPL Core Assets by modifying their metadata, name, URI, or image. You can update a single asset or multiple assets at once.
+The `mplx core asset update` command allows you to update MPL Core Assets by modifying their metadata, name, URI, or image. You can update a single asset or multiple assets at once.
 
 ## Basic Usage
 
 ### Update Single Asset
 ```bash
-mplx core update <assetId> [options]
+mplx core asset update <assetId> [options]
 ```
 
 ### Update Options
@@ -17,55 +17,44 @@ mplx core update <assetId> [options]
 - `--uri <string>`: New URI for the asset metadata
 - `--image <path>`: Path to new image file
 - `--json <path>`: Path to JSON file containing new metadata
-- `--edit`: Download metadata JSON, open for editing, then use for update
 
 ## Update Methods
 
 ### 1. Update Name and URI
 ```bash
-mplx core update <assetId> --name "Updated Asset" --uri "https://example.com/metadata.json"
+mplx core asset update <assetId> --name "Updated Asset" --uri "https://example.com/metadata.json"
 ```
 
 ### 2. Update with JSON File
 ```bash
-mplx core update <assetId> --json ./asset/metadata.json
+mplx core asset update <assetId> --json ./asset/metadata.json
 ```
 
 ### 3. Update with Image
 ```bash
-mplx core update <assetId> --image ./asset/image.jpg
+mplx core asset update <assetId> --image ./asset/image.jpg
 ```
 
 ### 4. Update with JSON and Image
 ```bash
-mplx core update <assetId> --json ./asset/metadata.json --image ./asset/image.jpg
-```
-
-### 5. Interactive Edit
-```bash
-mplx core update <assetId> --edit
+mplx core asset update <assetId> --json ./asset/metadata.json --image ./asset/image.jpg
 ```
 
 ## Examples
 
 ### Update Asset Name
 ```bash
-mplx core update 5avjMVza8SuMhgTfzEGNWJskDELMCQk9juAAc8zeQoNa --name "New Asset Name"
+mplx core asset update 5avjMVza8SuMhgTfzEGNWJskDELMCQk9juAAc8zeQoNa --name "New Asset Name"
 ```
 
 ### Update Asset with New Image
 ```bash
-mplx core update 5avjMVza8SuMhgTfzEGNWJskDELMCQk9juAAc8zeQoNa --image ./images/new-image.png
+mplx core asset update 5avjMVza8SuMhgTfzEGNWJskDELMCQk9juAAc8zeQoNa --image ./images/new-image.png
 ```
 
 ### Update Asset with New Metadata
 ```bash
-mplx core update 5avjMVza8SuMhgTfzEGNWJskDELMCQk9juAAc8zeQoNa --json ./metadata/new-metadata.json
-```
-
-### Interactive Metadata Update
-```bash
-mplx core update 5avjMVza8SuMhgTfzEGNWJskDELMCQk9juAAc8zeQoNa --edit
+mplx core asset update 5avjMVza8SuMhgTfzEGNWJskDELMCQk9juAAc8zeQoNa --json ./metadata/new-metadata.json
 ```
 
 ## Output
@@ -86,11 +75,6 @@ After a successful update, the command will display:
 - The `--name` and `--uri` flags cannot be used together with `--json` or `--edit`
 - When using `--json`, the metadata file must contain a valid `name` field
 - The `--image` flag will update both the image URI in the metadata and the image file reference
-- When using `--edit`, the command will:
-  1. Download the current metadata
-  2. Open it for editing in your default text editor
-  3. Wait for you to save and close the file
-  4. Upload the updated metadata
 - The command will automatically handle:
   - File uploads to the appropriate storage
   - Metadata JSON formatting

+ 10 - 8
src/pages/cli/installation.md

@@ -50,7 +50,7 @@ You should see the current version of the CLI displayed.
 
 ### 1. Create Configuration Directory
 
-The CLI will automatically create a configuration directory at `~/.mplx` on first run. This directory stores:
+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
@@ -61,19 +61,21 @@ The CLI will automatically create a configuration directory at `~/.mplx` on firs
 #### Set up a Wallet
 ```bash
 # Create a new wallet
-mplx config wallet new --name dev1
+mplx config wallets new --name dev1
 
 # Or add an existing wallet
-mplx config wallet add dev1 /path/to/keypair.json
+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
 ```bash
-# Add mainnet RPC
-mplx config rpc add mainnet https://api.mainnet-beta.solana.com
-
-# Add devnet RPC
-mplx config rpc add devnet https://api.devnet.solana.com
+mplx config set rpcUrl  https://api.mainnet-beta.solana.com
 ```
 
 #### Set Preferred Explorer