Metadata-Version: 2.1
Name: killercoda-cli
Version: 1.0.1
Summary: A CLI helper for writing killercoda scenarios and managing steps
Project-URL: Documentation, https://github.com/unknown/killercoda-cli#readme
Project-URL: Issues, https://github.com/unknown/killercoda-cli/issues
Project-URL: Source, https://github.com/unknown/killercoda-cli
Author-email: Piotr Zaniewski <piotrzan@gmail.com>
License-Expression: MIT
License-File: LICENSE.txt
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# killercoda-cli

[![PyPI - Version](https://img.shields.io/pypi/v/killercoda-cli.svg)](https://pypi.org/project/killercoda-cli)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/killercoda-cli.svg)](https://pypi.org/project/killercoda-cli)

---

**Table of Contents**

- [Installation](#installation)
- [Usage](#usage)
  - [Requirements:](#requirements:)
  - [Functionality:](#functionality:)
  - [Example:](#example:)
- [Disclaimer](#disclaimer)
- [License](#license)

## Installation

```console
pip install killercoda-cli
```

## Usage

Pdoc generated Documentation available at: https://piotr1215.github.io/killercoda-cli/killercoda_cli/cli.html

### Requirements:

- The tool must be run in a directory containing step files or directories (e.g., step1.md, step2/).
- An 'index.json' file must be present in the directory, which contains metadata about the steps.

### Functionality:

- Renames and renumbers step files and directories based on user input.
- Updates the 'index.json' file to reflect changes in step order and titles.

### Example:

Suppose you have a scenario directory with the following structure:

    .
    ├── index.json
    ├── step1.md
    └── step2
        └── step2.md

And you want to insert a new step between 'step1.md' and 'step2/', titled "New Step".

1. Run 'killercoda-cli'.
2. Enter the title for the new step: "New Step".
3. Enter the step number to insert the new step at: 2.

After running the tool, your directory structure will be updated to:

    .
    ├── index.json
    ├── step1.md
    ├── step2
        └── step2.md (previously step1.md content)
    └── step3
        └── step3.md (previously step2.md content)

The `index.json` file will also be updated to include the new step and renumber existing steps accordingly.

Before:

```json
{
  "steps": [
    {
      "title": "Step 1",
      "text": "step1.md"
    },
    {
      "title": "Step 2",
      "text": "step2/step2.md"
    }
  ]
}
```

After:

```json
{
  "steps": [
    {
      "title": "Step 1",
      "text": "step1.md"
    },
    {
      "title": "New Step",
      "text": "step2/step2.md"
    },
    {
      "title": "Step 2",
      "text": "step3/step3.md"
    }
  ]
}
```

> [!NOTE]
>
> The tool automatically handles the renaming of directories and files, ensuring a smooth workflow for scenario development and updates.

## Disclaimer

This is an my personal project to easier create and manage killercoda scenarios.
Check out [killercoda](https://killercoda.com/) interactive scenarios to learn more about
the service.

## License

`killercoda-cli` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
