Resources Tools

Tools

Klyn ships with companion tools written in Klyn. They are intended to keep the language ecosystem self-hosted where it makes sense: desktop development, documentation generation, source analysis, and quality feedback use the same language and runtime as application code.

Tool Entry Points

Every source-based tool uses a minimal Start.kn file at the root of its directory. The entry point only starts the application; reusable application classes remain in files that carry their public type name.

klyn tools/editor/Start.kn
klyn tools/klyndoc/Start.kn --help
klyn tools/metrik/Start.kn --help
KlynEditor

KlynEditor is Klyn's graphical development environment. It organizes source code in workspaces and projects and brings editing, navigation, execution, testing, terminals, database exploration, and documentation into one desktop application.

klyn tools/editor/Start.kn

Start by selecting or creating a workspace, then create a project for the language you want to use. The Project Explorer provides access to project files and folders. Open a file to edit it in the central tab area, where code assistance, completion, diagnostics, navigation, and standard editing shortcuts are available when supported by the selected language.

Use the Run commands to execute the current program and the test commands to inspect test progress and failures. The surrounding views can be opened as needed: Project Explorer and Database Explorer on the sides, Terminal and execution output at the bottom, and contextual tools such as chat or embedded documentation alongside the editor.

Appearance and editor behavior can be adjusted from the settings dialog. Docked views may be resized, collapsed, reopened from their side-bar icons, or arranged around the central document area.

Development status

KlynEditor is currently under active development and is not yet a finished IDE. Existing features, workflows, and file-format support may still evolve, and some language-specific assistance or advanced editor operations may remain incomplete. Keep important projects under version control and review generated or refactored changes before relying on them.

KlynDoc

KlynDoc is the static API documentation generator for Klyn source trees. It scans KlynDoc comments, packages, types, members, and signatures, then writes a navigable HTML API reference.

klyn tools/klyndoc/Start.kn \
    -sourcepath ./lib \
    -d ./docs/api \
    --version "$(cat version.txt)"

From a source checkout, the project-level helper script injects the version from version.txt when it regenerates the standard library API reference.

./klyndoc.sh

Run klyn tools/klyndoc/Start.kn --help for the complete option list. In a packaged distribution the source entry point remains under tools/klyndoc; no separate native klyndoc executable is required.

Best use

Use KlynDoc for public library APIs. Keep comments close to the source and include a short description, parameters, return value, exceptions when relevant, and an example.

Metrik

Metrik is the source-code metrics tool currently implemented by the tools/metrik application. It counts files, lines, blanks, comments, code, complexity, duplication, and quality hotspots.

klyn tools/metrik/Start.kn --quality --hotspots 10 ./lib ./samples
klyn tools/metrik/Start.kn --format json --output metrics.json ./src

Use klyn tools/metrik/Start.kn --help to list language filters, output formats, generated/minified-file handling, duplicate detection, and quality-report options.

Its output is useful before refactoring: start with the maintainability summary, then inspect the highest-ranked hotspots instead of guessing where the codebase is hardest to maintain.

Best use

Use Metrik for trend checks and code-review preparation. It is not a replacement for tests or profiling, but it makes large files, duplication, and high-complexity areas visible early.