Command-Line Interface¶
The Kiwi CLI provides an interface for working with Kiwi files.
Basic Usage¶
Options¶
-h, --help¶
Displays help information with a summary of all available commands and their purposes.
-v, --version¶
Prints the current version.
-s, --settings¶
Prints the interpreter settings (for debugging).
-i, --interactive¶
Starts an interactive Read-Evaluate-Print Loop (REPL) where you can type and execute Kiwi code directly in the terminal.
To learn more about the REPL, please see REPL.
-d, --debug <input_file_path>¶
Runs a script under the kdb interactive debugger. Execution pauses at the first statement and presents a (kdb) prompt where you can step through the program, inspect variables, set breakpoints, and evaluate expressions.
To learn more, see kdb — Kiwi Debugger.
-a, --ast <input_file_path>¶
Prints the abstract syntax tree of the input file.
-t, --tokens <input_file_path>¶
Tokenizes a file with the Kiwi lexer and prints the results to the standard output stream.
-n, --new <file_path>¶
Creates a new file with the .kiwi extension. If you don't include the extension in <file_path>, it will be appended automatically.
kiwi -n filename # Creates ./filename.kiwi
kiwi -n ../app # Creates ../app.kiwi in the parent directory
kiwi -n ./somedir/app # Creates ./somedir/app.kiwi in the specified subdirectory
Note: If a file with the same name already exists, the CLI will notify you to prevent accidental overwriting.
-sm, --safemode¶
Runs Kiwi in safe mode. This disables access to web, filesystem, and system shell functionality.
-ns, --no-stdlib¶
Runs Kiwi without loading its standard library.
-p, --stdlib-path <path>¶
Overrides the standard library path. Kiwi will load .kiwi files from the specified directory instead of the default stdlib location.
-<key>=<value>¶
Sets a specific argument as a key-value pair, which can be used for various configuration purposes or to pass parameters into scripts.