Skip to content

Conversation

@jdx
Copy link
Owner

@jdx jdx commented Nov 25, 2025

Summary

  • Add options field to RegistryTool struct with platform support
  • Create jq.rs module for JSON path extraction (e.g., .[].version)
  • Create version_list.rs for fetching/parsing version lists from URLs
  • Update http backend to use version_list_url option
  • Merge registry options with user-provided options in BackendArg
  • Add claude-code entry using http backend with version list endpoint
  • Update registry.toml schema to allow options field

This enables tools to specify version list URLs and platform-specific configurations directly in the registry, reducing reliance on npm/other backends for simple binary downloads.

Example registry.toml entry:

[tools.claude]
aliases = ["claude-code"]
backends = ["http:claude", "npm:@anthropic-ai/claude-code"]

[tools.claude.options]
version_list_url = "https://storage.googleapis.com/claude-code-dist-.../stable"
bin = "claude"

[tools.claude.options.platforms.macos-arm64]
url = "https://storage.googleapis.com/.../{version}/darwin-arm64/claude"

Test plan

  • mise ls-remote claude returns version from version_list_url
  • mise install [email protected] installs from http backend
  • mise exec [email protected] -- claude --version outputs correct version
  • Unit tests pass for jq.rs, version_list.rs, and backend integration
  • Lint passes

🤖 Generated with Claude Code


Note

Adds HTTP backend remote version listing (regex/jq path parsing) with registry-backed options and introduces claude tool via HTTP; updates docs/schema/tests.

  • Backend:
    • HTTP: Implement remote version listing from version_list_url, supporting version_regex and version_json_path.
    • New Modules: Add backend/jq.rs (jq-like JSON extraction) and backend/version_list.rs (fetch/parse versions), with unit tests.
    • Options Merge: BackendArg::opts() now merges registry backend options with user options (user takes precedence).
  • Registry/Build:
    • Schema: Extend schema/mise-registry.json to allow per-backend options (including nested platforms).
    • Codegen: build.rs generates backend options; introduce raw_string_literal for safe string embedding.
    • Runtime: RegistryBackend gains options; add accessors get_backend and backend_options.
    • Tool: Update registry.toml to add tools.claude HTTP backend with version_list_url, bin, and platform-specific URLs; restrict OS; keep npm as alternate.
  • Docs/Tests:
    • Docs: Expand HTTP backend docs with version_list_url, version_regex, and version_json_path usage.
    • E2E: Add e2e/backend/test_http_version_list_slow validating ls-remote and install for claude.

Written by Cursor Bugbot for commit 7cb7c3e. This will update automatically on new commits. Configure here.

Adds the ability to define tool options directly in registry.toml,
enabling tools to specify version_list_url and platform-specific
configurations.

Changes:
- Add `options` field to RegistryTool struct with platform support
- Create jq.rs module for JSON path extraction (e.g., `.[].version`)
- Create version_list.rs for fetching/parsing version lists from URLs
- Update http backend to use version_list_url option
- Merge registry options with user-provided options in BackendArg
- Add claude-code entry using http backend with version list endpoint
- Update registry.toml schema to allow options field

Example registry.toml entry:
```toml
[tools.claude.options]
version_list_url = "https://storage.googleapis.com/.../stable"
bin = "claude"

[tools.claude.options.platforms.macos-arm64]
url = "https://storage.googleapis.com/.../{version}/darwin-arm64/claude"
```

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Copilot AI review requested due to automatic review settings November 25, 2025 18:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for tool-specific options in the registry, enabling HTTP backend tools to fetch version lists from URLs without relying on npm or other package managers. The implementation includes a custom JQ-like JSON path extractor for parsing various version list formats.

Key changes:

  • Added options field to registry tool definitions with platform-specific configuration support
  • Implemented JSON path extraction and version list parsing utilities
  • Modified HTTP backend to fetch versions from configurable URLs

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/registry.rs Adds options field to RegistryTool struct and tool_options() method to convert registry options
src/cli/args/backend_arg.rs Merges registry options with user-provided options, giving user options precedence
src/backend/version_list.rs New module for fetching and parsing version lists from URLs with multiple format support
src/backend/jq.rs New module implementing simplified JQ-like JSON path extraction
src/backend/http.rs Updates HTTP backend to use version_list_url option for remote version listing
src/backend/mod.rs Registers new jq and version_list modules
schema/mise-registry.json Adds options field schema with platform-specific configuration support
registry.toml Adds claude-code tool configuration using HTTP backend with version list URL
build.rs Updates registry codegen to serialize options field from TOML

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +388 to +398
let version_list_url = match opts.get("version_list_url") {
Some(url) => url.clone(),
None => return Ok(vec![]),
};

// Get optional version regex pattern or JSON path
let version_regex = opts.get("version_regex").map(|s| s.as_str());
let version_json_path = opts.get("version_json_path").map(|s| s.as_str());

// Use the version_list module to fetch and parse versions
version_list::fetch_versions(&version_list_url, version_regex, version_json_path).await
Copy link

Copilot AI Nov 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clone() is unnecessary here. Since opts.get() returns Option<&String>, you can use as_str() to get &str and pass it directly to fetch_versions without cloning.

Suggested change
let version_list_url = match opts.get("version_list_url") {
Some(url) => url.clone(),
None => return Ok(vec![]),
};
// Get optional version regex pattern or JSON path
let version_regex = opts.get("version_regex").map(|s| s.as_str());
let version_json_path = opts.get("version_json_path").map(|s| s.as_str());
// Use the version_list module to fetch and parse versions
version_list::fetch_versions(&version_list_url, version_regex, version_json_path).await
let version_list_url = opts.get("version_list_url").map(|s| s.as_str());
if version_list_url.is_none() {
return Ok(vec![]);
}
// Get optional version regex pattern or JSON path
let version_regex = opts.get("version_regex").map(|s| s.as_str());
let version_json_path = opts.get("version_json_path").map(|s| s.as_str());
// Use the version_list module to fetch and parse versions
version_list::fetch_versions(version_list_url.unwrap(), version_regex, version_json_path).await

Copilot uses AI. Check for mistakes.
Comment on lines +387 to +393
// Get version_list_url from options
let version_list_url = match opts.get("version_list_url") {
Some(url) => url.clone(),
None => return Ok(vec![]),
};

// Get optional version regex pattern or JSON path
Copy link

Copilot AI Nov 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] These two lines extract options that are already being extracted from opts. Consider extracting all three options (version_list_url, version_regex, version_json_path) consistently at the same location for better code organization.

Suggested change
// Get version_list_url from options
let version_list_url = match opts.get("version_list_url") {
Some(url) => url.clone(),
None => return Ok(vec![]),
};
// Get optional version regex pattern or JSON path
// Get version_list_url and related options from options
let version_list_url = match opts.get("version_list_url") {
Some(url) => url.clone(),
None => return Ok(vec![]),
};

Copilot uses AI. Check for mistakes.
}
} else if let Some(obj) = val.as_object() {
// Try common version field names
for field in ["version", "tag_name", "name", "tag", "v"] {
Copy link

Copilot AI Nov 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The field name \"v\" is a single letter which could match unintended fields. Consider removing it or placing it last in the priority order to avoid false matches.

Copilot uses AI. Check for mistakes.
@jdx
Copy link
Owner Author

jdx commented Nov 25, 2025

cc @roele @risu729—I think this will be useful for probably other tools that need complex options in registry.toml

The npm backend doesn't use the http-specific tool options.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Options are now specified per-backend, allowing different backends
for the same tool to have different configurations. This enables
claude-code to have both http and npm backends.

Example:
```toml
[[tools.claude.backends]]
full = "http:claude"
[tools.claude.backends.options]
version_list_url = "..."
bin = "claude"

[[tools.claude.backends]]
full = "npm:@anthropic-ai/claude-code"
```

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
jdx and others added 2 commits November 25, 2025 10:14
…tions

Document new HTTP backend options for fetching available versions:
- version_list_url: URL to fetch version list from
- version_regex: Regex to extract versions from response
- version_json_path: jq-like path for JSON version extraction

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
When version_json_path is provided but JSON parsing fails or the path
doesn't match, gracefully fall back to text parsing instead of failing.
This makes the behavior consistent with auto-detection mode.

Also adds e2e test for claude-code http backend with version_list_url.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@github-actions
Copy link

github-actions bot commented Nov 25, 2025

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.11.7 x -- echo 19.4 ± 0.4 18.8 23.1 1.00
mise x -- echo 20.7 ± 0.2 20.1 21.6 1.07 ± 0.02

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.11.7 env 19.5 ± 0.6 18.8 25.8 1.00
mise env 20.0 ± 0.7 18.6 30.1 1.03 ± 0.05

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.11.7 hook-env 18.6 ± 0.4 17.8 21.6 1.00
mise hook-env 19.4 ± 0.5 18.0 20.7 1.04 ± 0.04

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.11.7 ls 16.0 ± 0.4 15.3 18.6 1.00
mise ls 17.7 ± 0.4 16.2 18.8 1.10 ± 0.04

xtasks/test/perf

Command mise-2025.11.7 mise Variance
install (cached) 108ms 108ms +0%
ls (cached) 64ms 65ms -1%
bin-paths (cached) 71ms 72ms -1%
task-ls (cached) 430ms 439ms -2%

jdx and others added 2 commits November 25, 2025 15:22
Add raw_string_literal() helper that dynamically determines the minimum
number of '#' characters needed to safely delimit raw strings. This
prevents build failures if registry option values, descriptions, or
test commands contain sequences like "###.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@jdx jdx enabled auto-merge (squash) November 25, 2025 23:24
ToolVersionOptions::default()
}
})
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Fallback option parsing uses wrong string source

The fallback code in the opts() method attempts to parse bracket notation from self.full(), but self.full() doesn't contain bracket notation—it returns the clean backend specification. Brackets are extracted during BackendArg construction from the tool name, not the full string. While this fallback may not execute in normal usage since self.opts is set during construction, the logic is incorrect if it ever does execute. The regex check at line 294 will never match a full backend string like http:claude since bracket notation is handled separately.

Fix in Cursor Fix in Web

@jdx jdx merged commit d156c2e into main Nov 25, 2025
36 checks passed
@jdx jdx deleted the feat/registry-tool-options branch November 25, 2025 23:34
jdx pushed a commit that referenced this pull request Nov 26, 2025
### 📦 Registry

- add blender by @lucasew in
[#7014](#7014)
- add vespa-cli by @buinauskas in
[#7037](#7037)
- fix vespa-cli order by @buinauskas in
[#7038](#7038)
- add scooter by @TyceHerrman in
[#7039](#7039)
- Prefer github backend for allure by @TobiX in
[#7049](#7049)

### 🚀 Features

- **(plugins)** Install a plugin from a zip file over HTTPS by @KaanYT
in [#6992](#6992)
- **(registry)** add tool options support for http backend by @jdx in
[#7061](#7061)

### 🐛 Bug Fixes

- **(core)** trim `core:` prefix in unalias_backend by @kou029w in
[#7040](#7040)
- **(go)** use -mod=readonly for go install by @joonas in
[#7052](#7052)
- **(npm)** handle v-prefixed versions correctly by @jdx in
[#7062](#7062)
- **(tasks)** add missing task fields to JSON output by @roele in
[#7044](#7044)
- semver in aqua by @lucasew in
[#7018](#7018)
- use the musl version if installing in Android (Termux) by @lucasew in
[#7027](#7027)
- empty enable_tools crash by @moshen in
[#7035](#7035)

### 📚 Documentation

- add MISE and USAGE syntax hl queries to neovim cookbook by @okuuva in
[#7047](#7047)
- use local assets for screenshots by @okuuva in
[#7056](#7056)
- remove GitHub issues link from roadmap by @jdx in
[6897286](6897286)

### 📦️ Dependency Updates

- update docker/metadata-action digest to 318604b by @renovate[bot] in
[#7033](#7033)
- update actions/checkout digest to 34e1148 by @renovate[bot] in
[#7032](#7032)
- lock file maintenance by @renovate[bot] in
[#7048](#7048)

### Chore

- upgrade actionlint to 1.7.9 and fix lint issues by @jdx in
[#7065](#7065)

### New Contributors

- @joonas made their first contribution in
[#7052](#7052)
- @KaanYT made their first contribution in
[#6992](#6992)
- @kou029w made their first contribution in
[#7040](#7040)
- @moshen made their first contribution in
[#7035](#7035)
- @buinauskas made their first contribution in
[#7038](#7038)
- @lucasew made their first contribution in
[#7014](#7014)

## 📦 Aqua Registry Updates

#### New Packages (3)

- [`m7medVision/lazycommit`](https://github.com/m7medVision/lazycommit)
-
[`microsoft/component-detection`](https://github.com/microsoft/component-detection)
- [`owenlamont/ryl`](https://github.com/owenlamont/ryl)

#### Updated Packages (1)

- [`sst/opencode`](https://github.com/sst/opencode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants