v0.2.14 : kimi-cli via uv (paquet PyPI kimi-cli, fini le npm inexistant) + uv venv autonome (python 3.13 gere par uv, plus besoin de python systeme pour les installs uv)
This commit is contained in:
+4
-4
@@ -341,14 +341,14 @@ agents:
|
||||
|
||||
- name: kimi-cli
|
||||
display_name: "Kimi CLI"
|
||||
description: "Agent CLI officiel Moonshot AI, skills, MCP, intégration ACP IDE (Apache-2.0)."
|
||||
description: "Agent CLI officiel Moonshot AI, skills, MCP, intégration ACP IDE (Apache-2.0). Installé via uv (paquet PyPI kimi-cli)."
|
||||
category: coding-agent
|
||||
website: https://github.com/MoonshotAI/kimi-cli
|
||||
install:
|
||||
type: npm
|
||||
package: "@moonshotai/kimi-cli"
|
||||
type: uv
|
||||
package: kimi-cli
|
||||
dependencies:
|
||||
- { name: node, min_version: "18.0.0", install_hint: "https://nodejs.org" }
|
||||
- { name: uv, min_version: "0.4.0", install_hint: "https://docs.astral.sh/uv" }
|
||||
run: kimi
|
||||
tags: [moonshot, skills, mcp]
|
||||
|
||||
|
||||
+33
-15
@@ -31,6 +31,10 @@ fn venv_python(venv: &Path) -> PathBuf {
|
||||
}
|
||||
|
||||
/// Shared implementation for pip (use_uv=false) and uv (use_uv=true).
|
||||
///
|
||||
/// The uv path creates the venv with 'uv venv': uv downloads and manages a
|
||||
/// Python interpreter itself when no working system Python exists, so uv
|
||||
/// installs do not depend on a system Python at all.
|
||||
pub fn install(
|
||||
app: &App,
|
||||
agent: &AgentDef,
|
||||
@@ -42,7 +46,6 @@ pub fn install(
|
||||
.package
|
||||
.as_deref()
|
||||
.ok_or_else(|| anyhow!("pip/uv install requires 'package'"))?;
|
||||
let python = find_python(runner)?;
|
||||
let root = install_root(app, &agent.name);
|
||||
let venv = root.join("venv");
|
||||
ensure_dir(app, &root)?;
|
||||
@@ -51,25 +54,26 @@ pub fn install(
|
||||
.with_context(|| format!("cannot remove {}", venv.display()))?;
|
||||
}
|
||||
let empty = BTreeMap::new();
|
||||
sh(
|
||||
runner,
|
||||
&python.display().to_string(),
|
||||
&[
|
||||
"-m".to_string(),
|
||||
"venv".to_string(),
|
||||
venv.display().to_string(),
|
||||
],
|
||||
&empty,
|
||||
None,
|
||||
)?;
|
||||
let vp = venv_python(&venv);
|
||||
let vbin = venv_bin_dir(&venv);
|
||||
if use_uv {
|
||||
let uv = require_tool(
|
||||
runner,
|
||||
"uv",
|
||||
"https://docs.astral.sh/uv — e.g. 'pip install uv'",
|
||||
)?;
|
||||
sh(
|
||||
runner,
|
||||
&uv.display().to_string(),
|
||||
&[
|
||||
"venv".into(),
|
||||
"--python".into(),
|
||||
"3.13".into(),
|
||||
venv.display().to_string(),
|
||||
],
|
||||
&empty,
|
||||
None,
|
||||
)?;
|
||||
let vp = venv_python(&venv);
|
||||
let vbin = venv_bin_dir(&venv);
|
||||
let mut args: Vec<String> = vec![
|
||||
"pip".into(),
|
||||
"install".into(),
|
||||
@@ -80,6 +84,20 @@ pub fn install(
|
||||
args.extend(method.args.iter().cloned());
|
||||
sh(runner, &uv.display().to_string(), &args, &method.env, None)?;
|
||||
} else {
|
||||
let python = find_python(runner)?;
|
||||
sh(
|
||||
runner,
|
||||
&python.display().to_string(),
|
||||
&[
|
||||
"-m".to_string(),
|
||||
"venv".to_string(),
|
||||
venv.display().to_string(),
|
||||
],
|
||||
&empty,
|
||||
None,
|
||||
)?;
|
||||
let vp = venv_python(&venv);
|
||||
let vbin = venv_bin_dir(&venv);
|
||||
let mut args: Vec<String> = vec![
|
||||
"-m".into(),
|
||||
"pip".into(),
|
||||
@@ -91,7 +109,7 @@ pub fn install(
|
||||
sh(runner, &vp.display().to_string(), &args, &method.env, None)?;
|
||||
}
|
||||
let expected = expected_bin_names(agent, method);
|
||||
let mut bins = find_bins(&vbin, &expected);
|
||||
let mut bins = find_bins(&venv_bin_dir(&venv), &expected);
|
||||
if bins.is_empty() {
|
||||
bins = find_bins(&bin_dir(app), &expected);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user