melange-cli

module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2026 License: Apache-2.0

README

Melange CLI

Melange CLI

Give your AI agent access to Melange, an on-device AI deployment platform by ZETIC. melange is designed agents-first: non-interactive safe, structured --json output, stable exit codes, and machine-actionable errors.

Install

One line on macOS or Linux — installs the CLI and the agent skill that drives it:

curl -fsSL https://raw.githubusercontent.com/zetic-ai/melange-cli/main/script/install.sh | sh

Restart your coding agent afterward so it can discover the skill. Re-run the same line any time to update both.

The installer downloads the release binary for your platform, verifies its SHA-256 checksum, and installs the skill for universal agents and Claude Code. When cosign is on your PATH it also verifies the release-workflow signature; pass | sh -s -- --require-signature to make that mandatory.

Installer options

Append flags after sh -s --, or set the matching environment variable:

Flag Environment variable Effect
--version v1.2.3 MELANGE_VERSION Install a specific release instead of the latest
--install-dir DIR MELANGE_INSTALL_DIR Binary directory; defaults to /usr/local/bin, falling back to ~/.local/bin
--cli-only MELANGE_SKIP_SKILL=1 Skip the agent skill
--skill-only MELANGE_SKIP_CLI=1 Skip the CLI
--agent "A B" MELANGE_SKILL_AGENTS Agents to install the skill for; defaults to universal claude-code
--require-signature MELANGE_REQUIRE_SIGNATURE=1 Fail unless the release signature is verified
curl -fsSL https://raw.githubusercontent.com/zetic-ai/melange-cli/main/script/install.sh \
  | sh -s -- --version v1.2.3 --agent "universal claude-code codex"

The skill is installed with npx skills when a recent Node is available, and copied straight into the agent skill directories otherwise.

Alternatives: Homebrew, npm, Go, and manual installation

These install the CLI only — add the agent skill separately with the npx skills add command below.

Homebrew (macOS or Linux):

brew install zetic-ai/tap/melange

npm (macOS, Linux, or Windows — the only supported path on Windows):

npm install -g @zetic-ai/melange-cli

With a current Go toolchain:

go install github.com/zetic-ai/melange-cli/cmd/melange@latest

Prebuilt binaries for macOS, Linux, and Windows on amd64/arm64, with checksums and SBOMs, are available on the releases page.

The agent skill, for driving melange from Claude Code, Codex, Cursor, OpenCode, and other compatible coding agents:

# Install for universal agents and Claude Code
npx skills add zetic-ai/melange-cli --skill melange-cli \
  --agent universal claude-code --global --yes

# Or choose one or more supported agents interactively
npx skills add zetic-ai/melange-cli --skill melange-cli --global

Restart your agent afterward so it can discover the skill.

Authentication

By default melange auth login opens a browser for OAuth (recommended, zoa_/zor_ stored in OS keyring and auto-refreshed). For CI/headless use a Personal Access Token (ztp_) from Melange Settings → Personal Access Tokens:

export MELANGE_API_KEY="ztp_your_personal_access_token"
# or
melange auth login --with-token < token.txt

Or store it interactively once:

melange auth login   # browser OAuth; falls back to PAT paste if browser unavailable
Check status
melange auth status

Use the CLI directly

A read-only path to confirm the install works. Nothing here creates anything or counts against a quota:

melange auth login                        # or export MELANGE_API_KEY
melange library list --search whisper     # browse the public model library
melange library view zetic/whisper-tiny   # one model in detail
melange repo list                         # your own repositories

Add --json (optionally with --jq) to any command for machine-readable output.

Identifiers

Three different identifiers appear in command arguments, and they are not interchangeable — passing a repository or display name where a MODEL_KEY or TARGET_ID belongs is the most common mistake:

Identifier What it is How to get it
ACCOUNT/REPO A Melange repository address melange repo list
MODEL_KEY One converted model version inside a repository melange model list -R ACCOUNT/REPO
TARGET_ID One downloadable converted artifact; opaque (tm_…/ltm_…) melange model targets MODEL_KEY -R ACCOUNT/REPO

They chain in that order:

melange model list -R zetic/whisper-tiny
melange model targets MODEL_KEY -R zetic/whisper-tiny
melange model download MODEL_KEY -R zetic/whisper-tiny --target TARGET_ID --yes

melange model download is billable, so it requires --yes when it cannot ask interactively.

Build with AI

What's supported

With the agent skill installed, your agent can:

  • Search the public model library and inspect available model versions.
  • Compare real device benchmarks, targets, and report availability.
  • Create and manage repositories, imports, uploads, and model versions.
  • Generate exact deployment guides for Android, iOS, and Flutter.
  • Check authentication, usage, quotas, and plan-specific availability.
Quick start (example prompts)

Discover a public model and deploy

Find a computer vision model by Meta in the Melange model library,
review its real device benchmark results, and give me the iOS deployment code/guide.

Upload your own model

I want to upload model.pt2 with sample.npy to Melange.
Upload the model, monitor conversion, and report the final status without retrying implicitly.

Compare benchmarks

Compare Gemma4 with another llm available in Melange. Use only benchmark values returned by Melange.
Show throughput and peak memory for iPhone 16 and Galaxy S25 where available.

MCP server

The CLI ships a built-in MCP server: melange mcp serves 18 tools over stdio (17 over HTTP — upload_model needs the caller's local files) so MCP clients call Melange directly instead of shelling out. The stdio server reuses the CLI's credentials (MELANGE_API_KEY or melange auth login), resolved lazily on the first tool call. Install the CLI first (see Install) so melange is on your PATH, then register it with your client. The full tool catalog and per-transport details are in llms.txt.

Claude Code
claude mcp add melange -- melange mcp

Verify with claude mcp list — the entry should show ✔ Connected.

Claude Desktop

Add to claude_desktop_config.json (Settings → Developer → Edit Config; macOS: ~/Library/Application Support/Claude/claude_desktop_config.json, Windows: %APPDATA%\Claude\claude_desktop_config.json), then restart Claude Desktop:

{
  "mcpServers": {
    "melange": {
      "command": "melange",
      "args": ["mcp"]
    }
  }
}
Cursor

Add to .cursor/mcp.json in your project (or ~/.cursor/mcp.json for all projects):

{
  "mcpServers": {
    "melange": {
      "command": "melange",
      "args": ["mcp"]
    }
  }
}
Remote (Streamable HTTP)

For remote agent clients, serve the Streamable HTTP transport. The server itself holds no credentials: every request must carry its own token as Authorization: Bearer <token>, so one deployment serves many callers.

The server speaks plain HTTP; terminate TLS in front of it (load balancer, reverse proxy, or ingress). The https:// client URLs below assume that.

melange mcp --transport http --listen 0.0.0.0:8080

Claude Code (PAT ztp_... or OAuth zoa_...):

claude mcp add --transport http melange https://your-host:8080/ \
  --header "Authorization: Bearer ztp_your_personal_access_token" # or zoa_... OAuth

Cursor (.cursor/mcp.json):

{
  "mcpServers": {
    "melange": {
      "url": "https://your-host:8080/",
      "headers": {
        "Authorization": "Bearer ztp_your_personal_access_token" // or zoa_... OAuth
      }
    }
  }
}

Claude Desktop registers local stdio servers through claude_desktop_config.json (above); remote servers are added as custom connectors in claude.ai settings instead. See melange mcp --help for the HTTP deployment flags (--validate-tokens, --allowed-origins, --resource).

Update

Re-run the installer to update the CLI and the skill together:

curl -fsSL https://raw.githubusercontent.com/zetic-ai/melange-cli/main/script/install.sh | sh

If you installed the CLI another way, update it the same way you installed it — brew upgrade zetic-ai/tap/melange or npm update -g @zetic-ai/melange-cli — and update the skill with npx skills update melange-cli --global.

Documentation

License

Apache-2.0

Directories

Path Synopsis
cmd
melange command
Command melange is the entry point for the melange CLI.
Command melange is the entry point for the melange CLI.
internal
api
Package api provides the HTTP client wrapper for the Melange public API: transport chain (auth, retry, debug), error-envelope decoding, and the hand-written calls that will later be replaced by a generated client.
Package api provides the HTTP client wrapper for the Melange public API: transport chain (auth, retry, debug), error-envelope decoding, and the hand-written calls that will later be replaced by a generated client.
api/gen
Package gen provides primitives to interact with the openapi HTTP API.
Package gen provides primitives to interact with the openapi HTTP API.
authn
Package authn resolves and refreshes credentials shared by CLI entry points.
Package authn resolves and refreshes credentials shared by CLI entry points.
build
Package build provides version information set at build time via -ldflags.
Package build provides version information set at build time via -ldflags.
cmd/api
Package api implements `melange api`, the authenticated raw-request escape hatch: any /v1 endpoint is callable through the standard transport chain even when no dedicated command wraps it yet.
Package api implements `melange api`, the authenticated raw-request escape hatch: any /v1 endpoint is callable through the standard transport chain even when no dedicated command wraps it yet.
cmd/auth
Package auth implements the `melange auth` command family: login, logout, status, and token.
Package auth implements the `melange auth` command family: login, logout, status, and token.
cmd/deploy
Package deploy exposes deterministic SDK deployment guides from public-v1.
Package deploy exposes deterministic SDK deployment guides from public-v1.
cmd/library
Package library implements `melange library` — browsing the public model library: listing and filtering models, viewing a single model with its readme, and listing the providers.
Package library implements `melange library` — browsing the public model library: listing and filtering models, viewing a single model with its readme, and listing the providers.
cmd/mcp
Package mcp implements the `melange mcp` command, which serves the Melange MCP server to agent clients over stdio or Streamable HTTP.
Package mcp implements the `melange mcp` command, which serves the Melange MCP server to agent clients over stdio or Streamable HTTP.
cmd/model
Package model implements `melange model` — uploading models through the ingestion v2 protocol (manifest, resumable GCS uploads, verify/complete), tracking their conversion status, browsing models and their converted targets, and downloading target artifacts.
Package model implements `melange model` — uploading models through the ingestion v2 protocol (manifest, resumable GCS uploads, verify/complete), tracking their conversion status, browsing models and their converted targets, and downloading target artifacts.
cmd/plan
Package plan implements `melange plan` — the account's effective billing plan identity (the tier its quotas derive from).
Package plan implements `melange plan` — the account's effective billing plan identity (the tier its quotas derive from).
cmd/repo
Package repo implements `melange repo` — commands for managing model repositories on the Melange platform.
Package repo implements `melange repo` — commands for managing model repositories on the Melange platform.
cmd/report
Package report implements `melange report` — reading a model's benchmark reports (general, LLM, package) as the dashboard-grade table on a terminal and as raw, one-record-per-line TSV for scripts.
Package report implements `melange report` — reading a model's benchmark reports (general, LLM, package) as the dashboard-grade table on a terminal and as raw, one-record-per-line TSV for scripts.
cmd/root
Package root wires the top-level `melange` cobra command.
Package root wires the top-level `melange` cobra command.
cmd/usage
Package usage implements `melange usage` — the current billing-period usage counters and, via `usage quotas`, those counters against the plan limits.
Package usage implements `melange usage` — the current billing-period usage counters and, via `usage quotas`, those counters against the plan limits.
cmd/version
Package version implements the `melange version` command.
Package version implements the `melange version` command.
cmdutil
Package cmdutil provides shared utilities for CLI commands: the Factory, error types, and exit-code mapping.
Package cmdutil provides shared utilities for CLI commands: the Factory, error types, and exit-code mapping.
config
Package config handles loading, saving, and resolving configuration values for the melange CLI.
Package config handles loading, saving, and resolving configuration values for the melange CLI.
downloadstate
Package downloadstate serializes and persists one logical, billable model download authorization.
Package downloadstate serializes and persists one logical, billable model download authorization.
fixturetest
Package fixturetest provides the shared helpers for tests that exercise the backend contract fixtures under openapi/fixtures: loading a fixture, concretizing its placeholder tokens, comparing JSON structurally with null and absent treated as equal, and matching request paths whose variable segments are placeholders.
Package fixturetest provides the shared helpers for tests that exercise the backend contract fixtures under openapi/fixtures: loading a fixture, concretizing its placeholder tokens, comparing JSON structurally with null and absent treated as equal, and matching request paths whose variable segments are placeholders.
httpmock
Package httpmock provides a minimal mock http.RoundTripper for tests, modeled on gh's pkg/httpmock (simplified).
Package httpmock provides a minimal mock http.RoundTripper for tests, modeled on gh's pkg/httpmock (simplified).
iostreams
Package iostreams provides the IOStreams abstraction used throughout the CLI.
Package iostreams provides the IOStreams abstraction used throughout the CLI.
keyring
Package keyring stores Melange credentials in the OS keychain via zalando/go-keyring.
Package keyring stores Melange credentials in the OS keychain via zalando/go-keyring.
mcp
Package mcp implements the Melange MCP server: a tool catalog over the generated API client, transport-agnostic so the stdio command (and a later HTTP transport) only wire dependencies.
Package mcp implements the Melange MCP server: a tool catalog over the generated API client, transport-agnostic so the stdio command (and a later HTTP transport) only wire dependencies.
mcp/httpserver
Package httpserver serves the Melange MCP server over the MCP Streamable HTTP transport for remote agent clients.
Package httpserver serves the Melange MCP server over the MCP Streamable HTTP transport for remote agent clients.
tableprinter
Package tableprinter renders a command's result for a reader or for a machine.
Package tableprinter renders a command's result for a reader or for a machine.
text
Package text provides small formatting helpers shared by command output: rune-safe truncation, compact relative timestamps, and byte sizes.
Package text provides small formatting helpers shared by command output: rune-safe truncation, compact relative timestamps, and byte sizes.
upload
Package upload implements the client half of the Melange ingestion v2 protocol: manifest digesting, persisted upload-session state, and the GCS resumable upload protocol over v4 signed URLs.
Package upload implements the client half of the Melange ingestion v2 protocol: manifest digesting, persisted upload-session state, and the GCS resumable upload protocol over v4 signed URLs.
uploadflow
Package uploadflow is the upload session state machine, extracted from the `melange model upload` command so that non-CLI frontends (the MCP server's upload_model tool) can drive the same flow.
Package uploadflow is the upload session state machine, extracted from the `melange model upload` command so that non-CLI frontends (the MCP server's upload_model tool) can drive the same flow.
wait
Package wait provides a generic context-aware polling loop with exponential backoff, full jitter, and an overall timeout.
Package wait provides a generic context-aware polling loop with exponential backoff, full jitter, and an overall timeout.
tools
gendocs command
Command gendocs regenerates the Markdown CLI reference in docs/reference from the live cobra command tree.
Command gendocs regenerates the Markdown CLI reference in docs/reference from the live cobra command tree.
mcpeval command
Command mcpeval is the agent eval harness for the melange MCP server: it gives REAL Claude agents Melange jobs to do through the server and scores whether they succeed, so a regression in tool descriptions shows up as a score delta instead of going unnoticed.
Command mcpeval is the agent eval harness for the melange MCP server: it gives REAL Claude agents Melange jobs to do through the server and scores whether they succeed, so a regression in tool descriptions shows up as a score delta instead of going unnoticed.
mcploadgen command
Command mcploadgen is the on-demand load harness for `melange mcp --transport http`.
Command mcploadgen is the on-demand load harness for `melange mcp --transport http`.
mcpschemas command
Command mcpschemas derives the MCP tool output schemas from the vendored OpenAPI 3.0 document (openapi/public-v1.3.0.json) and writes one self-contained JSON Schema draft 2020-12 file per tool to internal/mcp/schemas/<tool>.json.
Command mcpschemas derives the MCP tool output schemas from the vendored OpenAPI 3.0 document (openapi/public-v1.3.0.json) and writes one self-contained JSON Schema draft 2020-12 file per tool to internal/mcp/schemas/<tool>.json.
openapi30 command
Command openapi30 repairs and validates semantics that the pinned generic 3.1->3.0 converter does not preserve for oapi-codegen: nullable unions.
Command openapi30 repairs and validates semantics that the pinned generic 3.1->3.0 converter does not preserve for oapi-codegen: nullable unions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL