<jupyter_start><jupyter_text>Command-Line Interface.. csv-table::   :header: Command, Description   :widths: 20, 40    create-study, Create a new study.    delete-study, Delete a specified study.    dashboard, Launch web dashboard (beta).    storage upgrade, Upgrade the schema of a storage.    studies, Show a list of studies.    study optimize, Start optimization of a study.    study set-user-attr, Set a user attribute to a study.Optuna provides command-line interface as shown in the above table.Let us assume you are not in IPython shell and writing Python script files instead.It is totally fine to write scripts like the following:<jupyter_code>import optuna


def objective(trial):
    x = trial.suggest_float("x", -10, 10)
    return (x - 2) ** 2


if __name__ == "__main__":
    study = optuna.create_study()
    study.optimize(objective, n_trials=100)
    print("Best value: {} (params: {})\n".format(study.best_value, study.best_params))<jupyter_output><empty_output><jupyter_text>However, we can reduce boilerplate codes by using our ``optuna`` command.Let us assume that ``foo.py`` contains only the following code.<jupyter_code>def objective(trial):
    x = trial.suggest_float("x", -10, 10)
    return (x - 2) ** 2<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10547184773988898, 'fraction_numerical': 0.01506740681998414, 'mean_word_length': 4.3474576271186445, 'pattern_counts': {'":': 1, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '396068', 'license': 'MIT', 'n_tokens_mistral': 408, 'n_tokens_neox': 376, 'n_words': 137, 'path': 'Optuna.docset/Contents/Resources/Documents/_downloads/d1bddf5b39c9f90932947a22a3164d8d/004_cli.ipynb', 'repo_name': '29Takuya/dash-docset-optuna', 'size': '1261'}