moon toolchain command provides utilities for managing toolchain plugins, including adding new toolchains and inspecting their capabilities.
Subcommands
add
Add and configure a toolchain plugin interactively.
Arguments
Plugin locator formats:- GitHub:
source:github_user/repo - URL:
source:https://example.com/plugin.wasm - File:
file://./path/to/plugin.wasm
Options
How it works
- Loads the toolchain plugin using the provided or default locator
- Detects version from version files in the current directory (if supported)
- Runs interactive prompts to configure:
- Toolchain version (if not detected)
- Plugin-specific settings
- Installation preferences
- Writes configuration to
toolchains.ymlor appropriate config file - Displays success message with the config file path
- Auto-detects versions from files like
.node-version,rust-toolchain.toml, etc. - Provides context-aware prompts based on plugin capabilities
- Validates settings against the plugin’s schema
- Preserves existing configuration while adding new entries
info
Show detailed information about a toolchain plugin.
Arguments
How it works
- Loads the toolchain plugin without requiring workspace configuration
- Analyzes plugin capabilities by checking implemented APIs
- Displays comprehensive information including:
- Basic metadata (name, description, version)
- Configuration schema and available settings
- Tier 1 APIs (usage detection)
- Tier 2 APIs (ecosystem integration)
- Tier 3 APIs (tool management)
- Shows file patterns the plugin recognizes
Output sections
Toolchain - Basic information:- ID and title
- Description
- Plugin version
- Schema documentation
- Setting types and defaults
- Validation rules
- Config file globs (e.g.,
package.json,Cargo.toml) - Executable names (e.g.,
node,cargo) - Implemented APIs:
register_toolchain✓ (required)define_toolchain_config○initialize_toolchain○detect_version_files○parse_version_file○define_docker_metadata○scaffold_docker○prune_docker○sync_project○sync_workspace○extend_command○
- Manifest files (e.g.,
package.json,Cargo.toml) - Lock files (e.g.,
package-lock.json,Cargo.lock) - Vendor directory (e.g.,
node_modules,target) - Implemented APIs:
extend_project_graph○extend_task_command○extend_task_script○define_requirements○locate_dependencies_root○install_dependencies○hash_task_contents○parse_lock○parse_manifest○setup_environment○
- Implemented APIs:
register_tool✓ (required)load_versions○resolve_version○download_prebuilt✓ (required)unpack_archive○locate_executables✓ (required)setup_toolchain○teardown_toolchain○
Examples
Add a Node.js toolchain
Add a custom toolchain plugin
Add with minimal configuration
Add non-interactively
View Node.js plugin information
Inspect custom plugin capabilities
Compare plugin capabilities
Common workflows
Setting up a new workspace
Exploring available toolchains
Adding toolchains in CI/CD
Debugging plugin issues
Configuration file updates
Thetoolchain add command updates your toolchains.yml:
Before:
moon toolchain add rust --yes:
Error handling
Plugin locator required
If the toolchain ID doesn’t have a default plugin:Invalid plugin
If the plugin fails to load:- Plugin locator is correct
- Plugin file exists and is accessible
- Plugin is compatible with your moon version
Notes
The
toolchain commands interact with moon’s plugin system. Make sure you have network access if loading plugins from remote sources.Use
moon toolchain info before adding a toolchain to understand what features it provides and how it integrates with your workflow.When using custom plugins, ensure they are from trusted sources and are compatible with your moon version.
Exit codes
0- Command completed successfully1- Plugin locator required or not provided- Non-zero - Error loading plugin or updating configuration