コマンドラインインターフェース
CLIには自身のドキュメントが含まれています。specforge --helpを実行するとすべての利用可能なコマンドが表示され、specforge <command> --helpで各コマンドの詳細な使い方を確認できます。
$ specforge --help
Usage: specforge COMMAND [--verbosity VERBOSITY | --verbose]
[-p|--project PROJDIR]
Available options:
--verbosity VERBOSITY Set log verbosity: none, attention, info, trace
(default: info)
--verbose Alias for --verbosity trace
-p,--project PROJDIR Path to the project directory (default: ".")
--stdio Compatibility flag for language-client stdio
transports (ignored)
-h,--help Show this help text
--version Show version information
Available commands:
parse Parse a spec file
check Typecheck a spec file
lint Run fast project diagnostics
analyze Run solver-backed project analyses
format Format a spec file
monitor Monitor a spec file
eval Evaluate a spec file
serve Start the server
lsp-server Run the LSP server on stdio
export Export a spec
streammon Monitor a spec in streaming mode from STDIN
init Initialize a new Lilo project
flatten Flatten hierarchical components in a system
schema Generate a schema or template
doctor Troubleshoot common issues
conditional-inconsistency
Analyze conditional inconsistencies in a system
search Search for definitions in a project
validate Validate that the results of the antecedent query are
contained in the results of the consequent query
bulk-label Update labels for selected definitions
doc Print SpecForge documentation pages
specialize Preview feature: generate one specialized spec per
finite enum param combination
fill-stubs Fill in definition stubs using the configured LLM
specialize-system Preview feature: specialize one component-free system
source file
set-tier Set the license tier
ドキュメント(doc)
SpecForgeのドキュメントはバイナリに埋め込まれており、直接出力できます。
specforge docは、各ページの1行の概要とともに利用可能なページを一覧表示します。specforge doc <topic>は、単一のページを出力します(例:specforge doc lilo-language)。specforge doc --allは、すべてのページを連結して出力します。
プロジェクトディレクトリ
CLIコマンドは、プロジェクトディレクトリ(つまり、specforge.tomlファイルを含むディレクトリ)が現在の作業ディレクトリであると想定します。コマンドの末尾に-p / --projectオプションを指定することで、別のプロジェクトディレクトリを指定できます。
出力言語
一部のCLIコマンドは、人間が読むためのコマンド出力をローカライズします。英語(デフォルト)と日本語がサポートされており、日本語訳はコマンドごとに順次展開されています。
言語は標準的なロケール環境変数から選択されます。たとえば$LANGを変更することで言語を切り替えられます:
$ LANG=ja_JP.UTF-8 specforge check # 日本語を強制
$ LANG=en_US.UTF-8 specforge check # 英語を強制
レコードエンコーディング
いくつかのコマンドはRECORD_ENCODINGサブコマンド(flatまたはnested)を受け付け、レコード型のシグナルとパラメータの表現方法を制御します。flatエンコーディングは、フィールドセパレータを設定するための-s / --separator SEPARATORを受け付けます(デフォルト: "_")。
エンコーディングが指定されない場合、デフォルトはファイル形式によって異なります。CSVの場合はflat、**JSON/JSONLの場合はnested**です。
詳細な説明と例については、データファイルの章のレコードエンコーディングを参照してください。