Skip to main content

Klynx Textual CLI application package.

Project description

Klynx CLI (klynx-cli)

klynx-cli is the official command-line and TUI interface for Klynx. It provides:

  • An interactive terminal UI (klynx)
  • A headless automation mode (klynx run ...)
  • Session persistence, model switching, auth helpers, diagnostics, and shell completion

The package installs two equivalent commands:

  • klynx
  • klynx-cli

Install (PyPI)

pip install -U klynx-cli

Optional browser tooling (needed only for browser-based tools):

playwright install chromium

Quick Start (5 Minutes)

1) Configure your model API key

klynx auth login --model gpt-4o

Or set environment variables manually (example):

export OPENAI_API_KEY="sk-..."

2) Launch the interactive TUI

klynx

3) Run one task immediately

klynx "review the current repository and propose a refactor plan"

4) Run in headless mode

klynx run "fix the failing tests and explain the root cause"

5) Resume the latest session

klynx resume --last

Usage Tutorial

Tutorial A: Interactive coding workflow in TUI

  1. Start TUI: klynx
  2. Enter a task, for example:
    • implement retry logic for the API client and add tests
  3. Use slash commands inside TUI:
    • /help
    • /context
    • /compact
    • /model
  4. Continue follow-up prompts in the same session to iterate.

Tutorial B: CI-friendly headless execution

Use run for scripted workflows:

klynx run --json "summarize current test failures"
klynx run --show-tools "apply fixes and run verification"
klynx run --mode plan --approval on-request "design and implement a migration path"

Tutorial C: Work across multiple directories

Allow additional directories when needed:

klynx run --add-dir ../shared-lib --add-dir ../docs "check cross-repo compatibility"

Tutorial D: Manage session history

klynx session list
klynx session show --last
klynx session compact --last
klynx session delete <session_id>

Common Commands

klynx run "..."
klynx resume --last
klynx session list
klynx auth status
klynx auth login --model gpt-4o
klynx models list
klynx models set gpt-4o --scope global
klynx config show
klynx doctor
klynx completion powershell

Configuration and Credentials

Configuration precedence:

  1. Built-in defaults
  2. ~/.klynx/config.toml
  3. .klynx/config.toml
  4. .klynx/tui/config.yaml (legacy TUI config)
  5. Environment variables (for example KLYNX_DEFAULT_PROVIDER, KLYNX_DEFAULT_MODEL)
  6. CLI overrides (-c key=value)

Credential lookup precedence:

  1. Process environment variables
  2. ~/.klynx/.env
  3. .klynx/.env
  4. Values written by klynx auth login

TUI Output Configuration

You can tune transcript visibility in .klynx/tui/config.yaml:

output:
  visible_events: [warning, error, answer, tool_exec]
  show_reasoning_indicator: true
  show_raw_stdout: false
  tool_result_max_lines: 8

Logging and Diagnostics

klynx run --log-level DEBUG --print-logs "debug this task"
klynx doctor --json
  • Logs are written to ~/.klynx/logs/klynx-cli.log
  • --print-logs also mirrors logs to stderr
  • doctor checks import health, writable paths, tool availability, and auth readiness

Shell Completion

klynx completion bash
klynx completion powershell

PowerShell load example:

klynx completion powershell | Invoke-Expression

Exit Codes

  • 0: success
  • 1: runtime failure
  • 2: usage error
  • 3: config validation failure
  • 4: session not found

Related Package

klynx-cli depends on the core SDK package klynx and installs it automatically via PyPI dependency resolution.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

klynx_cli-0.0.4.tar.gz (52.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

klynx_cli-0.0.4-py3-none-any.whl (59.3 kB view details)

Uploaded Python 3

File details

Details for the file klynx_cli-0.0.4.tar.gz.

File metadata

  • Download URL: klynx_cli-0.0.4.tar.gz
  • Upload date:
  • Size: 52.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for klynx_cli-0.0.4.tar.gz
Algorithm Hash digest
SHA256 30df1d7d731841539c82adb1bf71f80d58eac79fa0dfaed9c2f743eedfd574da
MD5 2eb70e848d824c10cd964137734abecd
BLAKE2b-256 7caf1f047a97a29888a94a6e8749264cd592db6931da9de445b2003fc4456d56

See more details on using hashes here.

File details

Details for the file klynx_cli-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: klynx_cli-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 59.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for klynx_cli-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ce548e5b9492ebf2e9eb5a461ca62daa0f1685231fa09f5b79c7a665e3a4780d
MD5 479620306bec23c1f8974fce361e90a3
BLAKE2b-256 7fa49658def9f98088371bda4e9e0696b98b17677e9c315c24e6bb7dde7d1d0d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page