@try-maglev/cli
v0.5.1
Published
Connect your existing agent to manufacturing with Maglev.
Readme
Maglev CLI
Connect your existing agent to manufacturing through Maglev's API. Requires Node.js 22.12 or later.
Documentation: trymaglev.com/docs.
Install
Install the official npm package:
npm install -g @try-maglev/cli
maglev --helpPackage: @try-maglev/cli version 0.5.1. The same release is available as a versioned archive with a SHA-256 checksum.
If an earlier Maglev archive installed @maglev/cli, first run npm uninstall -g @maglev/cli, then install @try-maglev/cli. This replaces the global executable; it preserves your project skills and saved example state. Do not use --force to overwrite an unrelated executable.
Add it to an existing agent
For guided onboarding, create a sandbox key in the console, set MAGLEV_API_KEY through your environment or secret manager, and run maglev setup. Choose Claude Code, Codex, or terminal only; setup offers a bundled sandbox example. It currently uses your environment key, without browser authentication or credential storage.
For a non-interactive first result:
maglev setup --target terminal --demo --jsonUse --target claude --directory . or --target codex --directory . to install a project skill. maglev demo can be run separately; it saves and retrieves a synthetic enclosure request. Repeated runs recover the same work from ~/maglev-example/, including after an interrupted response. Set MAGLEV_STATE_DIR to an existing writable parent to change that location. State contains the example body, idempotency key and run ID, never the credential. Do not delete uncertain request state to force a retry.
From the project directory, inspect the bundled skill and preview its destination:
maglev agent print
maglev agent install --target claude --directory . --dry-run
maglev agent install --target claude --directory .Use --target codex for Codex. Claude Code uses .claude/skills/maglev-manufacturing/SKILL.md; Codex uses .agents/skills/maglev-manufacturing/SKILL.md. Setup is offline, creates no credential, preserves existing project guidance and refuses to overwrite a customized skill. Invoke /maglev-manufacturing in Claude Code or $maglev-manufacturing in Codex.
Connect
Create a sandbox key in the developer console. Set MAGLEV_API_KEY through your local environment or secret manager. Do not paste the key into chat, commit it, or pass it as a command argument.
maglev auth check --json
maglev context preview ./hardware-project --json
maglev discover --input discovery.json --json
maglev inspect sample-cnc-us --jsondiscovery.json:
{"query":"CNC aluminum enclosures","quantity":100,"country":"US","optimize":"speed"}Use an ID returned by your own discovery result when inspecting a real capability. IDs prefixed with sample- refer to synthetic sandbox records.
Project workflows
maglev projects create --input brief.json --json
maglev actions kinds --json
maglev actions request PROJECT_ID --input action.json --idempotency-key revision-a-action-001 --json
maglev actions get ACTION_ID --json
maglev factories list --input filters.json --jsonUse IDs returned by your requests. Read actions kinds for each action's current schema. Project intake preserves your quality priorities, evidence and open questions. Updating intake replaces the entire object. The synthetic example includes a BOM, brief and strategy request.
Behavior
- Input files and stdin must be valid UTF-8. Malformed bytes fail before transmission; JSON exports may include a leading UTF-8 byte-order mark.
- Project actions return drafts or coordinated tasks. The CLI can read delivery drafts; approval is an explicit HTTP operation which may send or queue a message with a live key.
- Action requests default to a four-minute timeout; other commands use 45 seconds.
--timeoutaccepts 1000–300000 milliseconds. - A catalog quote request is stored for review. It does not contact a supplier, place an order or spend money.
context previewreads selected local file metadata and hashes. It does not parse CAD, upload files or require a key. Hidden/sensitive filenames, generated directories and symbolic links are excluded. Review the resulting selection before sharing anything.- JSON success output goes to stdout. JSON errors go to stderr. Keys are redacted from both.
- No automatic retries of writes. Retrying an identical catalog quote request or project action requires the same idempotency key. Check saved state first after a timeout.
MAGLEV_API_URLcan select an explicit HTTPS API base; HTTP is accepted only for local development. Authenticated redirects are rejected.- Interview confirmation requires
--confirmand the saved interview's latest version.
Run maglev --help for the complete command list. The package has no runtime dependencies.
Development
From the repository root, run npm test. Tests use synthetic data and local mock servers, not supplier communications. The public sandbox smoke check is separate and creates temporary synthetic records under its own key.
Review a BOM locally
maglev context review-bom bom.csv --mapping mapping.json --jsonCLI 0.5.1 reads UTF-8 CSV/TSV with explicit columns and declarations. It preserves raw values, source records and byte hashes, flags missing or ambiguous engineering context, and uploads nothing. It does not expand hierarchies or calculate purchasing quantities. No API key is required. See the mapping guide and runnable example.
