메뉴
HN
Hacker News 47일 전

AI 코딩 에이전트용 자격 증명 관리 도구, Kontext CLI

IMP
7/10
핵심 요약

Kontext CLI는 AI 코딩 에이전트를 위한 오픈소스 명령줄 도구로, 개발자의 기존 워크플로우를 변경하지 않고도 기업급 자격 증명 관리를 제공합니다. 이 도구는 위험한 장기 API 키의 복사 붙여넣기를 대체하여 세션이 유지되는 동안만 단기 토큰을 주입하고 모든 도구 호출을 감사 로그로 남깁니다. 고어(Go) 언어 기반의 가벼운 바이너리로 실행되며 Claude Code 에이전트를 즉시 지원합니다.

번역된 본문

Kontext CLI: 자격 증명을 저장하고 런타임에 주입합니다. 에이전트는 키를 저장하지 않습니다.

Kontext CLI란 무엇입니까? Kontext CLI는 오픈소스 명령줄 도구로, 개발자의 작업 방식을 바꾸지 않으면서도 AI 코딩 에이전트에 기업급 신원 확인, 자격 증명 관리, 거버넌스를 래핑(Wrapping)하여 제공합니다.

제작 배경: AI 코딩 에이전트는 GitHub, Stripe, 데이터베이스 등 수십 개의 서비스에 접근해야 합니다. 오늘날 많은 팀에서는 장기 유효 API 키를 .env 파일에 복사하여 붙여넣고 문제가 없길 바랄 뿐입니다. Kontext는 이를 세션이 시작될 때 주입되고 세션이 종료되면 사라지는 단기 유효 범위 제한 자격 증명으로 대체합니다. 모든 도구 호출이 로그에 기록되며, 모든 비밀값의 출처를 추적할 수 있습니다.

작동 방식: 단일 .env.kontext 파일에 프로젝트에 필요한 자격 증명을 선언합니다. kontext start를 실행하면, CLI가 사용자를 인증하고 RFC 8693 토큰 교환을 통해 자리 표시자(Placeholder)를 단기 토큰으로 교환한 뒤, 해당 자격 증명이 주입된 상태로 에이전트를 실행합니다. 또한 모든 도구 호출을 Kontext 대시보드로 스트리밍하여 감사 및 거버넌스를 지원합니다. 세션이 종료되면 자격 증명은 자동으로 만료됩니다.

빠른 시작: brew install kontext-dev/tap/kontext

직접 바이너리를 설치하고 싶다면 최신 GitHub Release를 다운로드할 수 있습니다: tmpdir="$(mktemp -d)"
&& gh release download --repo kontext-dev/kontext-cli --pattern 'kontext_*darwin_arm64.tar.gz' --dir "$tmpdir"
&& archive="$(find "$tmpdir" -maxdepth 1 -name 'kontext
*_darwin_arm64.tar.gz' -print -quit)"
&& tar -xzf "$archive" -C "$tmpdir"
&& sudo install -m 0755 "$tmpdir/kontext" /usr/local/bin/kontext

그런 다음 Claude Code가 설치된 프로젝트 디렉토리에서 다음을 실행합니다: kontext start --agent claude

첫 실행 시 CLI가 로그인, 제공자 연결, 자격 증명 해결 등 모든 과정을 대화형으로 처리합니다. 언제든지 kontext logout을 실행하여 시스템 키링(Keyring)에 저장된 OIDC 세션을 지울 수 있습니다.

작동 상세 과정:

  • kontext start --agent claude 실행
  • 인증: OIDC 로그인을 위해 브라우저를 열고, 시스템 키링에 리프레시 토큰을 저장하며, 나중에 kontext logout으로 지울 수 있게 합니다.
  • 세션 생성: Kontext 백엔드에 등록되어 대시보드에서 볼 수 있습니다.
  • 자격 증명 해결: .env.kontext를 읽고 자리 표시자를 단기 토큰으로 교환합니다.
  • 에이전트 실행: 자격 증명이 환경 변수로 주입되고 거버넌스 훅(Hook)이 추가된 상태로 Claude Code를 실행합니다.
  • 훅 이벤트 캡처: PreToolUse, PostToolUse, UserPromptSubmit 이벤트를 백엔드로 스트리밍합니다.
  • 깔끔한 종료: 세션 종료, 자격 증명 만료, 임시 파일 삭제가 이루어집니다.

주요 기능:

  • 한 번의 명령으로 Claude Code 실행: kontext start --agent claude — 설정 파일, Docker, 설치 스크립트가 필요하지 않습니다.
  • 임시 자격 증명: 세션으로 범위가 제한된 단기 토큰으로, 종료 시 자동 만료됩니다. 더 이상 .env 파일에 장기 API 키를 둘 필요가 없습니다.
  • 선언적 자격 증명 템플릿: .env.kontext를 리포지토리에 커밋하면 팀의 모든 개발자가 비밀값을 공유하지 않고도 동일한 자격 증명 설정을 얻습니다.
  • 거버넌스 원격 측정(Telemetry): Claude 훅 이벤트가 사용자, 세션 및 조직 속성과 함께 백엔드로 스트리밍됩니다.
  • 기본 보안: OIDC 인증, 시스템 키링 저장, RFC 8693 토큰 교환, 저장 시 AES-256-GCM 암호화를 지원합니다.
  • 가벼운 런타임: 네이티브 고어(Go) 바이너리로, 로컬 데몬 설치나 Node/Python 런타임이 필요하지 않습니다.
  • 업데이트 알림: kontext start 시 백그라운드에서 공개 GitHub 릴리스 API를 쿼리합니다(24시간 캐시, 시작을 차단하지 않음). KONTEXT_NO_UPDATE_CHECK=1로 비활성화할 수 있습니다.

자격 증명 선언: .env.kontext 파일은 프로젝트에 필요한 자격 증명을 선언합니다: GITHUB_TOKEN={{kontext:github}} STRIPE_KEY={{kontext:stripe}} DATABASE_URL={{kontext:postgres/prod-readonly}} 이를 리포지토리에 커밋하세요. 팀 전체가 동일한 템플릿을 공유하게 되며, 비밀값은 소스 제어(Source Control)가 아닌 Kontext에만 머뭅니다.

지원 에이전트:

  • Claude Code: --agent claude (현재 활성화됨)
  • Cursor 및 Codex 지원은 계획 중이지만 아직 이 리포지토리에 포함되지는 않았습니다.

아키텍처: kontext start --agent claude │ ├── Auth: 키링에서 OIDC 리프레시 토큰 가져오기 ├── ConnectRPC: CreateS...

원문 보기
원문 보기 (영어)
Kontext CLI Store Credentials. Inject At Runtime. Agents Never Store The Keys. Website · Documentation · Discord What is Kontext CLI? Kontext CLI is an open-source command-line tool that wraps AI coding agents with enterprise-grade identity, credential management, and governance — without changing how developers work. Why we built it: AI coding agents need access to GitHub, Stripe, databases, and dozens of other services. Today, teams copy-paste long-lived API keys into .env files and hope for the best. Kontext replaces that with short-lived, scoped credentials that are injected at session start and gone when the session ends. Every tool call is logged. Every secret is accounted for. How it works: You declare what credentials your project needs in a single .env.kontext file. When you run kontext start , the CLI authenticates you, exchanges placeholders for short-lived tokens via RFC 8693 token exchange, launches your agent with those credentials injected, and streams every tool call to the Kontext dashboard for audit and governance. When the session ends, credentials expire automatically. Quick Start brew install kontext-dev/tap/kontext If you prefer a direct binary install, download the latest GitHub Release instead: tmpdir= " $( mktemp -d ) " \ && gh release download --repo kontext-dev/kontext-cli --pattern ' kontext_*_darwin_arm64.tar.gz ' --dir " $tmpdir " \ && archive= " $( find " $tmpdir " -maxdepth 1 -name ' kontext_*_darwin_arm64.tar.gz ' -print -quit ) " \ && tar -xzf " $archive " -C " $tmpdir " \ && sudo install -m 0755 " $tmpdir /kontext " /usr/local/bin/kontext Then, from any project directory with Claude Code installed: kontext start --agent claude That's it. On first run, the CLI handles everything interactively — login, provider connections, credential resolution. Run kontext logout any time to clear the stored OIDC session from your system keyring. How it Works kontext start --agent claude Authenticates — opens browser for OIDC login, stores refresh token in system keyring, and lets you clear it later with kontext logout Creates a session — registers with the Kontext backend, visible in the dashboard Resolves credentials — reads .env.kontext , exchanges placeholders for short-lived tokens Launches the agent — spawns Claude Code with credentials injected as env vars + governance hooks Captures hook events — PreToolUse, PostToolUse, and UserPromptSubmit events streamed to the backend Tears down cleanly — session ended, credentials expired, temp files removed Features One command to launch Claude Code: kontext start --agent claude — no config files, no Docker, no setup scripts Ephemeral credentials: short-lived tokens scoped to the session, automatically expired on exit. No more long-lived API keys in .env files Declarative credential templates: commit .env.kontext to your repo, and every developer on the team gets the same credential setup without sharing secrets Governance telemetry: Claude hook events are streamed to the backend with user, session, and org attribution Secure by default: OIDC authentication, system keyring storage, RFC 8693 token exchange, AES-256-GCM encryption at rest Lean runtime: native Go binary, no local daemon install, no Node/Python runtime required Update notifications: on kontext start , a background check queries the public GitHub releases API (cached for 24h, never blocks startup). Disable with KONTEXT_NO_UPDATE_CHECK=1 Declare Credentials The .env.kontext file declares what credentials the project needs: GITHUB_TOKEN={{kontext:github}} STRIPE_KEY={{kontext:stripe}} DATABASE_URL={{kontext:postgres/prod-readonly}} Commit this to your repo — the whole team shares the same template. Secrets stay in Kontext, never in source control. Supported Agents Agent Flag Status Claude Code --agent claude Active Cursor and Codex support are planned, but they are not shipped in this repo yet. Architecture kontext start --agent claude │ ├── Auth: OIDC refresh token from keyring ├── ConnectRPC: CreateSession → session in dashboard ├── Sidecar: Unix socket server (kontext.sock) │ └── Heartbeat loop (30s) ├── Hooks: settings.json → Claude Code --settings ├── Agent: spawn claude with injected env │ │ │ ├── [PreToolUse] → kontext hook → sidecar → backend │ ├── [PostToolUse] → kontext hook → sidecar → backend │ └── [UserPromptSubmit] → kontext hook → sidecar → backend │ └── On exit: EndSession → cleanup Go sidecar: A lightweight sidecar process runs alongside the agent and communicates over a Unix socket. Hook handlers send normalized events through the sidecar so the CLI can keep agent-specific logic out of the backend contract. Governance telemetry: Session lifecycle and hook events flow to the Kontext backend, powering the dashboard with sessions, traces, and audit history. The CLI captures what the agent tried to do and what happened, but never captures LLM reasoning, token usage, or conversation history. Development # Build go build -o bin/kontext ./cmd/kontext # Generate protobuf (requires buf + plugins) buf generate # Test go test ./... go test -race ./... go vet ./... gofmt -w ./cmd ./internal # Link for local use ln -sf $( pwd ) /bin/kontext ~ /.local/bin/kontext Protocol Service definitions: kontext-dev/proto agent.proto The CLI communicates with the Kontext backend exclusively via ConnectRPC. Hook handlers communicate with the sidecar over a Unix socket using length-prefixed JSON. License MIT Support See SUPPORT.md for the right support channel.