Skip to content

Commands Misc

dxx114514-stack edited this page Oct 3, 2026 · 3 revisions

命令参考 · 其它模块

通用说明

帮助

clijudge help                    # 总帮助
clijudge <命令> help             # 分模块帮助(article/contest/ide/problem/submit/displaylang)

语言检查按顶层命令判定:仅顶层 help 与 displaylang 不要求已配置显示语言,problem help 等子命令帮助同样受此限制。

退出码

退出码 含义
0 成功(查询 / 管理类命令)
1 失败 / 对象未找到 / 参数错误
0 / 1 problem submit、submit rejudge:0 = AC,1 = 非 AC 或失败
0 / 1 contest problem submit:0 = 提交已受理(不看评测结果),1 = 比赛或题号无效
n ide run:返回被运行程序自身的退出码(沙箱启动失败为 1)

评测状态

缩写 含义 缩写 含义
AC Accepted PE Presentation Error
WA Wrong Answer OLE Output Limit Exceeded
TLE Time Limit Exceeded PC Partially Correct
MLE Memory Limit Exceeded IV Invalid Special Judge
RE Runtime Error ST Special Judge TLE
CE Compilation Error SR Special Judge Runtime Error
SE System Error IE Interactor Error
SK Skipped ?? Unknown

以上 16 个为评测状态;另有受理/校验阶段状态 pending(已受理待评测)与 error(题目或提交文件不存在),只会出现在提交记录中。


1. 提交记录模块 submit

clijudge submit count — 统计提交数量

输出: 纯数字。

clijudge submit list [L=1] [R=50] — 列出提交记录

JSON 数组,字段含 id、problem_id、problem_title、file_path、username、status、score、time_used、memory_used、judge_times、submitted_at 等。

clijudge submit rejudge [提交编号] — 重新评测

重新读取原提交文件评测并更新记录。受 judge.max_rejudge_times(默认 12)限制;源文件必须仍存在。

=== Rejudge Result ===
Submission: 1
Status: AC
Score: 100
Time: 15 ms
Memory: 3200 KB
Judge times: 2

退出码: AC 为 0,否则 1;超限时 Max rejudge times reached (12).(退出码 1)。

2. 文章模块 article

clijudge article count — 统计文章数量

输出: 纯数字。

clijudge article create [标题] [md文件路径] — 创建文章

md 文件可省略(正文为空)。article 没有 edit 子命令——事后只能直接手改 data/articles/article_N.json,或删除重建。输出 Article created, ID: 1

clijudge article delete [编号] — 删除文章

输出 Article 1 deleted. / Article 1 not found.(退出码 1)

clijudge article list [L=1] [R=50] — 列出文章

文章对象 JSON 数组,含完整 content 正文(并非精简摘要)。

clijudge article view [编号] — 查看文章

文章详情 JSON(标题、Markdown 正文等)。

3. 在线运行模块 ide

clijudge ide run [代码路径] [输入文件路径] — 运行代码

在沙箱中编译并运行:

  • 编译复用评测链路(可信沙箱、compile_time_limit_ms 编译时限、错误输出捕获后打印)
  • 运行以单进程在受限沙箱中进行(超时 10s、内存 256MB、进程上限 1,不经 shell,结构化 argv 直接执行),程序输出直接打印到终端
  • 提供输入文件时将其内容重定向到 stdin;未提供输入文件时继承终端 stdin(可交互);临时工作目录运行后自动清理

支持语言:C/C++(.cpp .cc .cxx .c)、Python(.py)、Java(.java)、JavaScript(.js);其它扩展名尝试直接执行(含已注册的 自定义语言)。

clijudge ide run main.cpp in.txt
Exit code: 0
Time: 15 ms
Memory: 3200 KB

被信号终止时追加一行 Signal: SIGKILL。

退出码: 程序自身退出码;沙箱启动失败为 1。

4. 显示语言模块 displaylang

(详见 显示语言)

clijudge displaylang list [--online]

本地列表每项为 名称 (显示名) v版本 *(* 为当前语言);--online 列出远端可下载语言。

Local languages:
  en (English) v1.0.0 *

* = currently active

clijudge displaylang switch [语言名]

本地没有该语言包时自动下载(en 为内置包,离线可用)。本地缺失时先输出 Language 'zh' not found locally. Downloading...,随后输出 Using built-in language pack.(内置包)或 Downloaded successfully.;最终输出 Switched to language: zh——该行经语言包 success.switched 键本地化,当前语言非英文时会显示为对应语言的译文。

clijudge displaylang delete [语言名]

若删除的是当前语言,先停用(Deactivated current language.)再删除。输出 Deleted language: zh。内置语言 en 拒绝删除(exit 1,Built-in language 'en' cannot be deleted.;本地副本可改用 displaylang pull en 刷新)。

clijudge displaylang pull [语言名]

拉取语言包但不切换。

Downloading language: zh...
Updated language: zh

返回 Home

Clone this wiki locally