Windows: Node execFile/execFileSync cannot run global lark-cli (.cmd shim)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Documentación
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, node.js, powershell
- Área
- cli, documentation
Línea de trabajo
Start with the bin entry in package.json and the entry script at scripts/run.js, then check the README for any existing install or usage notes. Confirm the reported Windows behaviour by running the .cmd shim versus node scripts/run.js with execFileSync. Done means a short "Programmatic usage" section that shows the node …/scripts/run.js invocation for Windows without shell: true, pending maintainer agreement on whether an install-layout change is also wanted.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
On Windows, after a normal npm global install of @larksuite/cli, calling:
import { execFileSync } from 'node:child_process'
execFileSync('lark-cli', ['--profile', '…', 'docs', '+fetch', /* … */], {
encoding: 'utf8',
stdio: ['ignore', 'pipe', 'pipe'],
})
fails, while the same command works when typed in PowerShell/cmd.
This affects programmatic / Agent callers that intentionally use execFile (no shell) to keep argv unescaped and avoid shell injection.
Environment
- OS: Windows 10/11
- Package:
@larksuite/cli(reproduced on 1.0.97) - Install: npm global (
lark-clion PATH) - Node: 22+ / 24.x
What npm installs on Windows
Global bin typically creates:
lark-cli.cmdlark-cli.ps1- real entry:
node_modules/@larksuite/cli/scripts/run.js(package.jsonbin: { lark-cli: scripts/run.js }`)
The .cmd shim ultimately runs:
node ...\node_modules\@larksuite\cli\scripts\run.js %*
PowerShell/cmd resolve lark-cli to that shim, so interactive use works.
Node execFile / execFileSync does not run .cmd without shell: true, so looking up the bare command name lark-cli fails in Agent/tooling code.
Workaround (works today)
Spawn the Node entry directly (no shell):
execFileSync(process.execPath, [
String.raw`C:\path\to\node_global\node_modules\@larksuite\cli\scripts\run.js`,
'--profile', profile,
'docs', '+fetch',
'--doc', url,
'--as', 'user',
'--format', 'json',
], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] })
(or resolve run.js from PATH’s */node_modules/@larksuite/cli/scripts/run.js)
Using shell: true also “works” but is undesirable for untrusted/argv-sensitive automation.
Request
- Document the recommended Windows programmatic invocation (
node …/scripts/run.js …) for humans and AI Agents that must avoidshell: true. - Optionally consider a Windows-friendly install story for non-shell spawners (e.g. document PATH layout, or ship/clarify a non-
.cmdentry if feasible). Understanding this is partly an npm-on-Windows convention; even a short “Programmatic usage” note would unblock Agent integrations.
Not asking for
- Changing Feishu OpenAPI auth or docs APIs — this is only about the CLI process entrypoint on Windows.
Thanks!
- Lenguaje dominante
- Go
- Estrellas
- 18.2k
- Forks
- 1.4k
- Merge medio
- 1 d 3 h
- PR fusionados (30 d)
- 18
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de larksuite/cli
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
domain/im
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
bug domain/doc
Dificultad 1/5 Menos de una hora Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
mail: all-ASCII draft bodies are hard-wrapped every 998 bytes, inserting newlines inside words and tagsPosiblemente ocupada @linye157 la tomó hace 26 días. Abiertodomain/mail
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Los mantenedores suelen responder en 1 día
-
auth: a 429 from the Token Endpoint during refresh deletes a still-valid loginPosiblemente ocupada @linye157 la tomó hace 26 días. Abiertobug domain/auth domain/im
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
larksuite/cli#2869 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de larksuite/cli
Issues similares
-
Add Alice&BotAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
slavakurilyak/awesome-ai-agents#1048 ·
-
【文章自荐】本地 LLM 实测:GPU 推理速度与测量条件Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
eryajf/learning-weekly#235 ·
-
test_archive_is_downloaded_after_logout_login doesn't wait for the storage client after loginAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
list_issues and search_issues: inconsistent `fields` allow-lists (`html_url` rejected by list)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
github/github-mcp-server#3960 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día