@cdm-lang/cli
v0.1.41
Published
CDM (Common Data Model) - A language for defining data models and generating code
Maintainers
Readme
CDM CLI
CDM (Common Data Model) is a language for defining data models and generating code across multiple platforms.
Installation
Install via npm:
npm install -g @cdm-lang/cliOr use it in a project:
npm install --save-dev @cdm-lang/cliUsage
After installation, the cdm command will be available:
cdm --helpCommand Line
# Run CDM CLI
cdm <command> [options]Programmatic Usage
You can also use CDM programmatically in Node.js:
const cdm = require('@cdm-lang/cli');
// Get the path to the binary
const binaryPath = cdm.getBinaryPath();
console.log('CDM binary location:', binaryPath);
// Run CDM with arguments
const exitCode = cdm.run(['--help']);How It Works
This npm package automatically downloads the appropriate pre-built CDM binary for your platform during installation. The binary is built from Rust and distributed via GitHub releases.
Supported Platforms
- macOS (Intel x64)
- macOS (Apple Silicon arm64)
- Linux (x64)
- Linux (ARM64)
- Windows (x64)
Updating
To update CDM to a newer version, use npm:
# For global installations
npm update -g @cdm-lang/cli
# For local project installations
npm update @cdm-lang/cliNote: The CDM CLI has a built-in cdm update command, but when installed via npm, you should use npm update instead to keep your npm package registry in sync with the actual binary version.
Troubleshooting
If you encounter installation issues:
- Make sure you have a stable internet connection
- Try clearing npm cache:
npm cache clean --force - Reinstall:
npm uninstall -g @cdm-lang/cli && npm install -g @cdm-lang/cli
If the binary fails to download, you can manually install CDM from the GitHub releases page.
License
MPL-2.0
Links
Contributing
Contributions are welcome! Please visit the GitHub repository for more information.
