cli

cli

Command-line interface for Keecas configuration management.

Provides commands for managing global and local configuration files.

Functions

Name Description
get_version Get the current version of keecas.
get_editor Get the preferred text editor from environment variables.
get_system_editor Get the system default editor command for opening files.
open_with_system_editor Open a file with the system default editor.
find_free_port Find a free port starting from start_port.
get_templates_dir Get the templates directory path.
generate_untitled_name Generate an available untitled-N.ipynb filename.
copy_template_to_workdir Copy a template notebook to the working directory.
check_jupyter_available Check if Jupyter is available.
check_jupyterlab_available Check if JupyterLab is available.
cmd_init Initialize a new configuration file.
cmd_config_edit Edit configuration file in the user’s preferred editor.
cmd_edit Launch Jupyter server with keecas notebook templates.
cmd_open Open configuration file with the system default editor.
cmd_show Show current configuration.
cmd_path Show path to configuration files.
cmd_reset Reset configuration to defaults.
cmd_config_version Show configuration version information.
cmd_migrate Manually trigger configuration migration.
create_parser Create and configure the argument parser.
main Main CLI entry point.

get_version

get_version()

Get the current version of keecas.

get_editor

get_editor()

Get the preferred text editor from environment variables.

get_system_editor

get_system_editor()

Get the system default editor command for opening files.

open_with_system_editor

open_with_system_editor(file_path)

Open a file with the system default editor.

find_free_port

find_free_port(start_port=8888, max_attempts=10)

Find a free port starting from start_port.

get_templates_dir

get_templates_dir()

Get the templates directory path.

generate_untitled_name

generate_untitled_name(work_dir)

Generate an available untitled-N.ipynb filename.

copy_template_to_workdir

copy_template_to_workdir(template_name, work_dir, target_filename=None)

Copy a template notebook to the working directory.

check_jupyter_available

check_jupyter_available()

Check if Jupyter is available.

check_jupyterlab_available

check_jupyterlab_available()

Check if JupyterLab is available.

cmd_init

cmd_init(args)

Initialize a new configuration file.

cmd_config_edit

cmd_config_edit(args)

Edit configuration file in the user’s preferred editor.

cmd_edit

cmd_edit(args)

Launch Jupyter server with keecas notebook templates.

cmd_open

cmd_open(args)

Open configuration file with the system default editor.

cmd_show

cmd_show(args)

Show current configuration.

cmd_path

cmd_path(args)

Show path to configuration files.

cmd_reset

cmd_reset(args)

Reset configuration to defaults.

cmd_config_version

cmd_config_version(args)

Show configuration version information.

cmd_migrate

cmd_migrate(args)

Manually trigger configuration migration.

create_parser

create_parser()

Create and configure the argument parser.

main

main()

Main CLI entry point.