npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@token-weather/cli

v0.6.0

Published

Token Weather — 로컬 AI 사용량 / 인증 상태 확인 CLI

Readme

agent

로컬 환경에서 AI 서비스 usage/quota 상태를 수집하고 CLI로 보여주는 패키지.

현재 구현 상태

현재 이 패키지는 설치형 CLI 에이전트의 초기 버전이다.

구현된 것:

  • CLI 엔트리포인트: bin/token-weather.js
  • 명령 라우팅 구조
  • 기본 설정 파일 생성 및 로딩
  • agent 전용 auth.json store 경로 해석 및 load/save 골격
  • account resolver: provider별 기본 계정 자동 선택 및 명시 선택
  • auth login codex CLI 골격
  • localhost callback 준비 코드 및 포트 fallback 뼈대
  • manual paste 입력 처리 — default 는 실제 OAuth, --mock 시 mock 계정 저장
  • Codex provider live usage 조회 결과 출력
  • 공통 snapshot 스키마 기반 출력 흐름

아직 미구현 또는 초기 상태:

  • inspect <provider> 상세 출력
  • sync 업로드 기능
  • 정식 formatter / table renderer
  • provider 측 revoke endpoint 호출 (logout은 로컬 제거만 수행)

현재 가능한 명령

  • token-weather status
    • 현재 설정과 Codex live usage 결과를 출력
  • token-weather usage
    • 현재는 status와 동일한 경로로 usage 요약 출력
  • token-weather doctor
    • auth/config/path/endpoint 진단용 명령 자리
  • token-weather config init
    • 기본 설정 파일 생성
  • token-weather auth login codex
    • default — authorize → localhost callback → code/state 수신 → token endpoint 에 POST → real token 저장
    • PKCE S256 적용됨, client_id 는 observed 값 (공식 확정 아님)
    • account 식별: id_token/access_token claims 기반 (email → preferred_username → sub), 불가 시 code prefix fallback
  • token-weather auth login codex --mock
    • 실제 token endpoint 호출 없이 mock 계정만 저장 (테스트/실험용)
  • token-weather auth login codex --manual
    • 브라우저에서 OAuth 완료 후 callback URL / code 를 stdin 에 paste
    • default 는 실제 token endpoint POST → real token 저장 (--manual 흐름도 default OAuth)
    • --mock 추가 시 placeholder 계정만 저장
  • token-weather auth list
    • 저장된 모든 provider의 인증 계정 목록 출력
    • provider, accountKey, email, source, authType, expiresAt, mock 여부, refresh 가능 여부 표시
  • token-weather auth list codex
    • 특정 provider 계정만 필터하여 출력
  • token-weather auth logout codex
    • 기본 선택 계정(single 또는 lastUsedAt 기준)을 로컬 저장소에서 제거
    • provider 측 revoke endpoint 호출은 아직 미구현
  • token-weather auth logout codex --account <email|accountKey>
    • 특정 계정을 지정하여 제거

로컬 개발 실행

프로젝트 루트에서:

npm run agent:status
npm run agent:usage
npm run agent:doctor
npm run agent:config:init

또는 직접 실행:

node packages/agent/bin/token-weather.js status

설정 파일

기본 설정 경로:

~/.config/token-weather/config.json

현재 기본 설정에는 아래 항목이 들어간다:

  • 출력 포맷
  • sync 사용 여부
  • provider 활성화 여부

현재 Codex 연동 방식

  • 기본 auth source는 agent 전용 auth.json store
  • real token이 있으면 agent-store를 우선 사용해 Codex usage endpoint를 bearer auth로 호출
  • agent-store에 usable token이 없을 때만 OpenClaw auth profile reader를 fallback으로 사용
  • 응답을 공통 snapshot 구조로 변환
  • 시간 필드는 ISO datetime string으로 정규화
  • provider 원본값은 snapshot의 raw에 보존

예정 명령

  • token-weather inspect <provider>
  • token-weather sync
  • token-weather doctor / doctor codex / doctor codex --refresh-live (인증 상태 진단)
  • token-weather auth import openclaw (기존 OpenClaw 마이그레이션)