cli-anything-novita

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

cli-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-novita
Prerequisites:
该CLI作为cli-anything-novita包的一部分进行安装:
bash
pip install cli-anything-novita
前置要求:
  • Python 3.10及以上版本
  • novita.ai获取Novita API密钥

Usage

使用方法

Basic Commands

基础命令

bash
undefined
bash
undefined

Show 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"
undefined
cli-anything-novita --json chat --prompt "你好"
undefined

REPL Mode

REPL模式

When invoked without a subcommand, the CLI enters an interactive REPL session:
bash
cli-anything-novita
当不指定子命令调用时,CLI会进入交互式REPL会话:
bash
cli-anything-novita

Enter commands interactively with tab-completion and history

可交互式输入命令,支持自动补全和历史记录

undefined
undefined

Command Groups

命令组

Chat

对话

Chat with AI models through the Novita API.
CommandDescription
chat
Chat with the Novita API
stream
Stream chat completion
通过Novita API与AI模型对话。
命令描述
chat
通过Novita API进行对话
stream
流式输出对话完成结果

Session

会话

Session management for chat history.
CommandDescription
status
Show session status
clear
Clear session history
history
Show command history
对话历史的会话管理。
命令描述
status
显示会话状态
clear
清除会话历史
history
显示命令历史

Config

配置

Configuration management.
CommandDescription
set
Set a configuration value
get
Get a configuration value (or show all)
delete
Delete a configuration value
path
Show the config file path
配置管理。
命令描述
set
设置配置值
get
获取配置值(或显示所有配置)
delete
删除配置值
path
显示配置文件路径

Utility

工具类

CommandDescription
test
Test API connectivity
models
List available models
命令描述
test
测试API连通性
models
列出可用模型

Examples

示例

Configure API Key

配置API密钥

bash
undefined
bash
undefined

Set 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"
undefined
export NOVITA_API_KEY="sk-xxx"
undefined

Chat with DeepSeek

与DeepSeek对话

bash
undefined
bash
undefined

Simple 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"
undefined
cli-anything-novita stream --prompt "编写一个计算阶乘的Python函数"
undefined

Test Connectivity

测试连通性

bash
undefined
bash
undefined

Verify 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
undefined
cli-anything-novita models
undefined

Default Models

默认模型

The Novita API supports multiple model providers:
Model IDProviderDescription
deepseek/deepseek-v3.2
DeepSeekDeepSeek V3.2 model (default)
zai-org/glm-5
Zhipu AIGLM-5 model
minimax/minimax-m2.5
MiniMaxMiniMax M2.5 model
Novita API支持多个模型提供商:
模型ID提供商描述
deepseek/deepseek-v3.2
DeepSeekDeepSeek V3.2模型(默认)
zai-org/glm-5
智谱AIGLM-5模型
minimax/minimax-m2.5
MiniMaxMiniMax M2.5模型

Output Formats

输出格式

All commands support dual output modes:
  • Human-readable (default): Tables, colors, formatted text
  • Machine-readable (
    --json
    flag): Structured JSON for agent consumption
bash
undefined
所有命令支持两种输出模式:
  • 人类可读格式(默认):表格、彩色文本、格式化内容
  • 机器可读格式
    --json
    参数):结构化JSON,供Agent使用
bash
undefined

Human 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"
undefined
cli-anything-novita --json chat --prompt "你好"
undefined

For AI Agents

面向AI Agent的使用说明

When using this CLI programmatically:
  1. Always use
    --json
    flag
    for parseable output
  2. Check return codes - 0 for success, non-zero for errors
  3. Parse stderr for error messages on failure
  4. Use absolute paths for all file operations
  5. Verify outputs exist after export operations
当以编程方式使用该CLI时:
  1. 始终使用
    --json
    参数
    以获得可解析的输出
  2. 检查返回码——0表示成功,非0表示错误
  3. 解析stderr以获取失败时的错误信息
  4. 文件操作使用绝对路径
  5. 导出操作后验证输出是否存在

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