killercoda-cli
Table of Contents
Installation
pip install killercoda-cli
Introduction
The interactive killercoda scenarios are a great way learn new technologies in an hands-on approach. However, creating the scenarios and managing can be tedious and time consuming.
The killercoda-cli solves some of those problems by:
- Adding a new step after the existing last step and creating a directory for including foreground and background scripts placeholders.
- Adding a regular step with
background.shandforeground.shscripts or a verify step withverify.shscript. - Renaming and re indexing step files and directories allowing for inserting a step in between existing steps and moving content down
- Updating the
index.jsonfile to reflect changes in step order and titles.
Documentation
Autogenerated API documentation generated in pdoc 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.jsonfile must be present in the directory, which contains metadata about the steps.
Usage
Initialize a new scenario
In a new directory run killercoda-cli init. This command will trigger a wizard
to create a new scenario. After answering all the questions, the directory will
contain the following structure:
.
├── index.json
├── intro.md
├── finish.md
Add a new step
From here run killercoda-cli without arguments. This command will trigger a
wizard to add a new step. After answering all the questions, the directory will
contain steps in the similar structure:
.
├── index.json
├── step1.md
└── step2
└── step2.md
And you want to insert a new step between step1.md and step2/, titled "New Step".
- Run
killercoda-cli. - Enter the title for the new step: "New Step".
- Enter the step number to insert the new step at: 2.
- Enter the step type (regular or verify): regular.
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:
{
"steps": [
{
"title": "Step 1",
"text": "step1.md"
},
{
"title": "Step 2",
"text": "step2/step2.md"
}
]
}
After:
{
"steps": [
{
"title": "Step 1",
"text": "step1.md"
},
{
"title": "New Step",
"text": "step2/step2.md"
},
{
"title": "Step 2",
"text": "step3/step3.md"
}
]
}
Adding assets
The killercoda-cli assets command has been added to facilitate the generation of necessary assets and folder structures in the current working directory using a predefined cookiecutter template.
This command will generate the required folder structure and files directly in the current working directory and remove the temporary directory.
Assets are NOT automatically added to the index.json to leave the decision to
the user how to bring the assets into the scenario.
Validating courses
The killercoda-cli validate command allows you to validate the structure and configuration of your scenarios:
➜ killercoda-cli validate
=== Scenario Validation ===
[+]json-syntax ok
[+]step-1 ok
[+]step-2 ok
Validation Status: PASSED
Location: /scenario/folder
This command checks:
- Presence and validity of index.json files
- Required fields in configuration
- Existence of all referenced files
- Step structure and consistency
The validation command is useful for CI/CD pipelines to ensure course integrity before deployment.
Development
Installing locally with pip install -e . --user will allow you to run the tool
locally.
Testing
To run the tests, use the following commands:
Here is the text rendered as a Markdown list:
hatch run test:unit- to run the unit tests.hatch run test:integration- to run the integration tests.hatch run test:coverage-report- to generate the coverage report.
Let me know if you have any further requests!
Disclaimer
This is an my personal project to easier create and manage killercoda scenarios. Check out killercoda interactive scenarios to learn more about the service.
License
killercoda-cli is distributed under the terms of the MIT license.
Metadata
Release files for killercoda-cli 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| killercoda_cli-1.3.0.tar.gz | 36.1 kB | Without provenance | Details for killercoda_cli-1.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| killercoda_cli-1.3.0-py3-none-any.whl | Python 3 | none | any | Details for killercoda_cli-1.3.0-py3-none-any.whl |
Total release size: 50.2 kB
Release files / killercoda_cli-1.3.0.tar.gz
| Download URL | killercoda_cli-1.3.0.tar.gz |
|---|---|
| Size | 36.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71f194c48ecd429e2be8f3a4415d9111ecc40b90b9ee6e298fd292d42b574fcb
|
|
BLAKE2b-256 checksum How to use checksums |
ee1e3f22c1149f40bb58ebb2b40e5c0a360562e81dbd28c463bcb2cb1dca3bbf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.9
|
Release files / killercoda_cli-1.3.0-py3-none-any.whl
| Download URL | killercoda_cli-1.3.0-py3-none-any.whl |
|---|---|
| Size | 14.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0702780a95223f354f7a480e82dfcb543cc4039fb553a0d8b8d7be9f9756de2c
|
|
BLAKE2b-256 checksum How to use checksums |
f935a498213d6f2da6b69595d26bc28e759760d97b4148f8d297f173e9fd805f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.9
|
Security for killercoda-cli 1.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.