spark-agent-launcher
v0.5.0
Published
Install and run the spark CLI (Go binary) via npm
Readme
spark-agent-launcher
English
A cross-platform CLI tool for launching Spark agents.
Installation
npm i -g spark-agent-launcherUsage
# Run spark
spark
# Show help
spark --helpConfiguration
Spark stores configuration in ~/.spark/config.json. You can configure:
- OpenAI API key and base URL
- Default model and profiles
- Anthropic credentials
# Configure your profile
spark
# Follow the interactive prompts to set up your API key and modelEnvironment Variables
| Variable | Description |
|----------|-------------|
| OPENAI_BASE_URL | Override API base URL |
| OPENAI_API_KEY | Override API key |
| ANTHROPIC_BASE_URL | Anthropic-specific endpoint |
| ANTHROPIC_AUTH_TOKEN | Anthropic auth token |
| SPARK_BINARY_URL | Direct download URL for binary |
| SPARK_BINARY_BASE_URL | Base URL for GitHub releases mirror |
| SPARK_BINARY_VERSION | Specific version to download |
Manual Binary Download
If npm install fails, you can manually download the binary:
- Visit GitHub Releases
- Download the appropriate binary for your platform
- Add it to your PATH
Troubleshooting
E403 error during npm publish
Use an npm Automation token with publish permission and bypass 2FA enabled.
Network errors during install
# Use a mirror
SPARK_BINARY_BASE_URL="https://your-mirror.com/releases" npm i -g spark-agent-launcher
# Or direct URL
SPARK_BINARY_URL="https://direct-url/spark-linux-amd64" npm i -g spark-agent-launcher中文
跨平台的 Spark Agent 启动器 CLI 工具。
安装
npm i -g spark-agent-launcher使用方法
# 运行 spark
spark
# 显示帮助
spark --help配置
Spark 将配置存储在 ~/.spark/config.json,你可以配置:
- OpenAI API 密钥和基础 URL
- 默认模型和配置文件
- Anthropic 凭证
# 配置你的配置文件
spark
# 按照交互提示设置你的 API 密钥和模型环境变量
| 变量 | 描述 |
|------|------|
| OPENAI_BASE_URL | 覆盖 API 基础 URL |
| OPENAI_API_KEY | 覆盖 API 密钥 |
| ANTHROPIC_BASE_URL | Anthropic 专用端点 |
| ANTHROPIC_AUTH_TOKEN | Anthropic 认证令牌 |
| SPARK_BINARY_URL | 二进制文件的直接下载 URL |
| SPARK_BINARY_BASE_URL | GitHub releases 镜像基础 URL |
| SPARK_BINARY_VERSION | 要下载的特定版本 |
手动下载二进制文件
如果 npm 安装失败,你可以手动下载二进制文件:
- 访问 GitHub Releases
- 下载适合你平台的二进制文件
- 将其添加到 PATH 中
故障排除
npm 发布时出现 E403 错误
使用具有发布权限并启用 2FA 绑过的 npm Automation 令牌。
安装时网络错误
# 使用镜像
SPARK_BINARY_BASE_URL="https://your-mirror.com/releases" npm i -g spark-agent-launcher
# 或使用直接 URL
SPARK_BINARY_URL="https://direct-url/spark-linux-amd64" npm i -g spark-agent-launcherLicense
MIT
