cli-anything-novita
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecli-anything-novita
cli-anything-novita
A CLI harness for Novita AI - an OpenAI-compatible API service for AI models like DeepSeek, GLM, and others.
一款面向Novita AI的CLI工具——Novita AI是兼容OpenAI的API服务,支持DeepSeek、GLM等多种AI模型。
Installation
安装
This CLI is installed as part of the cli-anything-novita package:
bash
pip install cli-anything-novitaPrerequisites:
- Python 3.10+
- Novita API key from novita.ai
该CLI作为cli-anything-novita包的一部分进行安装:
bash
pip install cli-anything-novita前置要求:
- Python 3.10及以上版本
- 从novita.ai获取Novita API密钥
Usage
使用方法
Basic Commands
基础命令
bash
undefinedbash
undefinedShow help
显示帮助信息
cli-anything-novita --help
cli-anything-novita --help
Start interactive REPL mode
启动交互式REPL模式
cli-anything-novita
cli-anything-novita
Chat with model
与模型对话
cli-anything-novita chat --prompt "What is AI?" --model deepseek/deepseek-v3.2
cli-anything-novita chat --prompt "什么是AI?" --model deepseek/deepseek-v3.2
Streaming chat
流式对话
cli-anything-novita stream --prompt "Write a poem about code"
cli-anything-novita stream --prompt "写一首关于代码的诗"
List available models
列出可用模型
cli-anything-novita models
cli-anything-novita models
JSON output (for agent consumption)
JSON格式输出(供Agent使用)
cli-anything-novita --json chat --prompt "Hello"
undefinedcli-anything-novita --json chat --prompt "你好"
undefinedREPL Mode
REPL模式
When invoked without a subcommand, the CLI enters an interactive REPL session:
bash
cli-anything-novita当不指定子命令调用时,CLI会进入交互式REPL会话:
bash
cli-anything-novitaEnter commands interactively with tab-completion and history
可交互式输入命令,支持自动补全和历史记录
undefinedundefinedCommand Groups
命令组
Chat
对话
Chat with AI models through the Novita API.
| Command | Description |
|---|---|
| Chat with the Novita API |
| Stream chat completion |
通过Novita API与AI模型对话。
| 命令 | 描述 |
|---|---|
| 通过Novita API进行对话 |
| 流式输出对话完成结果 |
Session
会话
Session management for chat history.
| Command | Description |
|---|---|
| Show session status |
| Clear session history |
| Show command history |
对话历史的会话管理。
| 命令 | 描述 |
|---|---|
| 显示会话状态 |
| 清除会话历史 |
| 显示命令历史 |
Config
配置
Configuration management.
| Command | Description |
|---|---|
| Set a configuration value |
| Get a configuration value (or show all) |
| Delete a configuration value |
| Show the config file path |
配置管理。
| 命令 | 描述 |
|---|---|
| 设置配置值 |
| 获取配置值(或显示所有配置) |
| 删除配置值 |
| 显示配置文件路径 |
Utility
工具类
| Command | Description |
|---|---|
| Test API connectivity |
| List available models |
| 命令 | 描述 |
|---|---|
| 测试API连通性 |
| 列出可用模型 |
Examples
示例
Configure API Key
配置API密钥
bash
undefinedbash
undefinedSet API key via config file (recommended)
通过配置文件设置API密钥(推荐)
cli-anything-novita config set api_key "sk-xxx"
cli-anything-novita config set api_key "sk-xxx"
Or use environment variable
或使用环境变量
export NOVITA_API_KEY="sk-xxx"
undefinedexport NOVITA_API_KEY="sk-xxx"
undefinedChat with DeepSeek
与DeepSeek对话
bash
undefinedbash
undefinedSimple chat
简单对话
cli-anything-novita chat --prompt "Explain quantum computing" --model deepseek/deepseek-v3.2
cli-anything-novita chat --prompt "解释量子计算" --model deepseek/deepseek-v3.2
Streaming chat
流式对话
cli-anything-novita stream --prompt "Write a Python function to calculate factorial"
undefinedcli-anything-novita stream --prompt "编写一个计算阶乘的Python函数"
undefinedTest Connectivity
测试连通性
bash
undefinedbash
undefinedVerify API key and connectivity
验证API密钥和连通性
cli-anything-novita test --model deepseek/deepseek-v3.2
cli-anything-novita test --model deepseek/deepseek-v3.2
List all available models
列出所有可用模型
cli-anything-novita models
undefinedcli-anything-novita models
undefinedDefault Models
默认模型
The Novita API supports multiple model providers:
| Model ID | Provider | Description |
|---|---|---|
| DeepSeek | DeepSeek V3.2 model (default) |
| Zhipu AI | GLM-5 model |
| MiniMax | MiniMax M2.5 model |
Novita API支持多个模型提供商:
| 模型ID | 提供商 | 描述 |
|---|---|---|
| DeepSeek | DeepSeek V3.2模型(默认) |
| 智谱AI | GLM-5模型 |
| MiniMax | MiniMax M2.5模型 |
Output Formats
输出格式
All commands support dual output modes:
- Human-readable (default): Tables, colors, formatted text
- Machine-readable (flag): Structured JSON for agent consumption
--json
bash
undefined所有命令支持两种输出模式:
- 人类可读格式(默认):表格、彩色文本、格式化内容
- 机器可读格式(参数):结构化JSON,供Agent使用
--json
bash
undefinedHuman output
人类可读输出
cli-anything-novita chat --prompt "Hello"
cli-anything-novita chat --prompt "你好"
JSON output for agents
供Agent使用的JSON输出
cli-anything-novita --json chat --prompt "Hello"
undefinedcli-anything-novita --json chat --prompt "你好"
undefinedFor AI Agents
面向AI Agent的使用说明
When using this CLI programmatically:
- Always use flag for parseable output
--json - Check return codes - 0 for success, non-zero for errors
- Parse stderr for error messages on failure
- Use absolute paths for all file operations
- Verify outputs exist after export operations
当以编程方式使用该CLI时:
- 始终使用参数以获得可解析的输出
--json - 检查返回码——0表示成功,非0表示错误
- 解析stderr以获取失败时的错误信息
- 文件操作使用绝对路径
- 导出操作后验证输出是否存在
More Information
更多信息
- Full documentation: See README.md in the package
- Test coverage: See TEST.md in the package
- Methodology: See HARNESS.md in the cli-anything-plugin
- 完整文档:查看包中的README.md
- 测试覆盖:查看包中的TEST.md
- 方法说明:查看cli-anything-plugin中的HARNESS.md
Version
版本
1.0.0
1.0.0