HN 표시: Elasticsearch 및 OpenSearch용 CLI 및 TUI

hackernews | | 💼 비즈니스
#cli #command r #elasticsearch #ktsearch #opensearch #tui
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

Elasticsearch와 OpenSearch를 위한 CLI 및 TUI 도구인 'ktsearch'가 공개되었습니다. 이 도구는 명령줄에서 검색을 실행하고 인덱스 및 데이터 스트림을 관리할 수 있으며, ktsearch top 기능을 통해 클러스터 상태를 모니터링할 수 있습니다. Mac과 Linux 환경에서는 Homebrew를 통해 쉽게 설치할 수 있으며, 로컬뿐만 아니라 Elastic Cloud와 AWS OpenSearch에 대한 실험적 지원도 포함되어 있습니다. 해당 프로젝트는 Kotlin 기반의 멀티플랫폼 라이브러리의 일부로 개발되었습니다.

본문

ktsearch-cli is a multiplatform command line tool for Elasticsearch and OpenSearch operations based on kt-search . It supports Elasticsearch 7-9 and OpenSearch 1-3 , with installable native binaries for macOS/Linux and Bash/Zsh completion. The full command reference is generated in cli-manual.md . Install the ktsearch command from the dedicated Homebrew tap: brew tap jillesvangurp/tap https://github.com/jillesvangurp/homebrew-tap brew install ktsearch Bash and Zsh completions are installed automatically. A key advantage of kt-search being multiplatform is that ktsearch-cli ships as native binaries on macOS and Linux. - Easy installation - No runtime dependencies - Fast startup - Easy to script - Easy to use for agentic coding workflows The CLI is a thin layer on top of kt-search . It uses Clikt for command-line parsing and Okio for native I/O. Use this as a high-level map. For full command syntax, flags, and more examples, see cli-manual.md . ktsearch cluster ... for health, stats, state, and settings.ktsearch top for live cluster/node vitals and admin panels.ktsearch cat ... for table/csv operational views.ktsearch cloud elastic ... for cloud context, check, and status helpers.ktsearch tasks status|wait ... for task inspection and task polling.ktsearch index create|get|refresh|delete|search ... for index-level operations.ktsearch index mappings/settings/template ... for schema and template management.ktsearch index alias ... andktsearch index data-stream ... for routing/data stream tasks.ktsearch index snapshot ... ,reindex ... , andilm ... for maintenance workflows.ktsearch index dump|restore ... for NDJSON export/import. Example ktsearch top dashboard output: Commands that modify or delete data ask for confirmation by default. Use --yes in automation. ktsearch index reindex defaults to --wait false and returns the task response immediately. - Use --progress-reporting to keep polling and print a single-line progress view (percent, docs, batches, rate, ETA). - If you use --disable-refresh-interval or--set-replicas-zero , the CLI keeps polling until the task completes so temporary destination settings can be restored safely (these flags imply progress reporting). - Temporary destination settings are restored to prior values (or defaults if they were unset). Native support in Kotlin/Native and dependency toolchains keeps improving, and some limits below may change in future releases. - Main focus is reliable support for macosArm64 ,macosX64 , andlinuxArm64 . linuxX64 is supported and cross-built on macOS by default; disable it with-Pktsearch.disableLinuxTargetsOnMac=true .- Direct host cross-builds for linuxArm64 on macOS may still fail at link time due toktor-client-curl /OpenSSL linker issues. - Building Apple final binaries on Linux CI is not supported by Kotlin/Native host restrictions. - Windows mingwX64 binaries can be built, but Windows ARM64 is not available as a Kotlin/Native target today. - For now, the easiest way to get a native binary for your system is to run the build on that same system via ./ktsearch-cli/install.sh . - Prebuilt packaging and CI-produced binaries may be added later if this stabilizes. ktsearch-cli has experimental WebAssembly support. wasmJs status: supported as an opt-in target (-Pktsearch.enableWasmCli=true ) and runnable with Node.js.- Build optimized wasm executable artifacts: ./gradlew :ktsearch-cli:compileProductionExecutableKotlinWasmJs -Pktsearch.enableWasmCli=true - Run from Node.js: ./gradlew :ktsearch-cli:wasmJsNodeProductionRun -Pktsearch.enableWasmCli=true wasmJs limitation: platform I/O is partial. Commands that require local file read/write or gzip dump/restore are not supported yet.wasmWasi status: not supported yet in this project.wasmWasi blocker: WASI runtimes (for examplewasmtime ) are not wired yet. That would require adding awasmWasi target plus platform I/O implementations. Use the scripts from the repository root: println("./ktsearch-cli/install.sh") println("./ktsearch-cli/uninstall.sh") Captured Output: ./ktsearch-cli/install.sh ./ktsearch-cli/uninstall.sh install.sh builds and installs ktsearch for the current macOS/Linux host and also installs Bash/Zsh completion. For installation behavior details (install path selection and completion path overrides), see cli-manual.md . For more examples and all flags, see cli-manual.md . println("ktsearch cluster health") println("ktsearch top --samples 1") println("ktsearch info") println("ktsearch cat indices") println("ktsearch cloud elastic context") println("ktsearch index create products") println("ktsearch index wait-green products") Captured Output: ktsearch cluster health ktsearch top --samples 1 ktsearch info ktsearch cat indices ktsearch cloud elastic context ktsearch index create products ktsearch index wait-green products Use Cloud ID and API key directly: println("ktsearch \\") println(" --cloud-id \"\$ELASTIC_CLOUD_ID\" \\") println(" --api-key \"\$ELASTIC_API_KEY\" \\") println(" cloud elastic st

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →