@infer-platform/cli
v0.2.0
Published
CLI wrapper for Infer Platform binaries
Maintainers
Readme
@infer-platform/cli
CLI wrapper for Infer Platform binaries. Automatically downloads and manages the node-agent binary for your platform.
Installation
npm install -g @infer-platform/cliOr use directly with npx:
npx @infer-platform/cli --helpUsage
Basic Commands
# Show CLI version
infer --version
# Show help
infer --helpNode Agent Management
# Install/reinstall the node-agent binary
infer node-agent install
# Show path to installed binary
infer node-agent path
# Run node-agent with arguments
infer node-agent --help
infer node-agent --versionRunning Node Agent
The CLI automatically proxies commands to the installed node-agent binary:
# Start node agent
infer node-agent
# With custom configuration
NODE_MODEL=llama3.1:8b \
NODE_PORT=8081 \
COORDINATOR_URL=https://api.infer-platform.com \
infer node-agentEnvironment Variables
Download Configuration
INFER_BINARY_MIRROR- Custom URL for binary downloads (default: GitHub releases)INFER_NODE_AGENT_CHECKSUM_URL- Override SHA256 checksum URL (default:${binaryUrl}.sha256)INFER_SKIP_CHECKSUM- Set totrueto skip SHA256 verification for local development/private mirrorsINFER_SKIP_BINARY_DOWNLOAD- Set totrueto skip automatic download during installINFER_FORCE_REINSTALL- Set totrueto force reinstall even if binary exists
Runtime Configuration
INFER_BINARY_PATH- Custom path to node-agent binary (overrides auto-detected path)
Supported Platforms
- Linux: x64, arm64
- macOS: x64 (Intel), arm64 (Apple Silicon)
- Windows: x64
How It Works
- During
npm install, the CLI downloads the appropriatenode-agentbinary for your platform - By default, it also downloads
${binaryUrl}.sha256and verifies the binary with SHA256 - Binary is stored in
.infer-bin/directory within the package - When you run
infer node-agent, it executes the downloaded binary - If download or checksum verification fails during install, you can manually download and place the binary in the expected location
Development
# Clone the repository
git clone https://github.com/infer-platform/infer.git
cd infer/packages/infer-cli
# Install dependencies (none required - zero dependencies!)
npm install
# Run tests
npm test
# Test CLI locally
node bin/infer.js --helpTesting
The CLI includes comprehensive tests that don't require internet access:
npm testTests cover:
- Platform detection
- Binary download (with mock HTTP server)
- Checksum verification
- CLI commands and argument passing
Troubleshooting
Binary download fails
If the automatic download fails during install:
- Check your internet connection
- Try setting a custom mirror:
export INFER_BINARY_MIRROR=https://your-mirror.com - Manually download the binary from releases
- Place it in:
node_modules/@infer-platform/cli/.infer-bin/node-agent - Make it executable:
chmod +x node_modules/@infer-platform/cli/.infer-bin/node-agent
Command not found
After global install, if infer is not found:
- Check npm global bin directory:
npm bin -g - Ensure it's in your PATH
- Or use
npx @infer-platform/cliinstead
License
MIT - See LICENSE file for details
Related
- Infer Platform - Main repository
- Documentation - Full platform documentation
