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

cc-zone

v0.1.0

Published

A tiny CLI wrapper that runs Claude Code in a US timezone.

Readme

cc-zone

cc-zone 是一个用于在指定美国时区环境下启动 Claude Code 的轻量级命令行包装器。它通过为 Claude 子进程设置 TZ 环境变量实现时区切换,不会修改操作系统时区,也不会影响当前终端会话中的其他进程。

首次运行时,cc-zone 会从内置的美国 IANA 时区列表中随机选择一个时区并保存;后续运行将复用该时区,以保证 Claude Code 会话环境保持一致。用户也可以通过命令行参数或交互式设置菜单手动指定、查看或重置时区。

功能特性

  • 自动为 Claude Code 子进程设置美国时区
  • 首次运行随机选择时区,并在后续运行中保持一致
  • 支持手动指定、查看和重置时区
  • 支持通过 --settings 向 Claude 传入临时 settings 文件
  • 支持 zsh、bash、fish 与 PowerShell 的别名安装
  • 不修改系统时区,不影响当前 shell 的全局环境变量

安装

npm install -g cc-zone

安装完成后,默认会向当前 shell 配置文件写入 claude 快捷命令,使 claude 自动通过 cc-zone 启动:

alias claude='cc-zone claude'

PowerShell 环境中会写入:

function claude { cc-zone claude @args }

如不希望安装阶段自动写入别名,可设置环境变量:

CC_ZONE_SKIP_ALIAS=1 npm install -g cc-zone

使用方式

# 使用已保存或随机生成的美国时区启动 Claude Code
cc-zone

# 显式启动 Claude Code
cc-zone claude

# 向 Claude Code 透传参数
cc-zone claude --dangerously-skip-permissions

# 指定本次及后续运行使用的时区
cc-zone --zone America/New_York

# 仅预览将要执行的命令,不启动 Claude Code
cc-zone --dry-run

# 输出当前保存的时区;若尚未保存,则输出随机预览结果
cc-zone --print-zone

# 重新随机生成并保存一个受支持的时区
cc-zone --reset-zone

# 打开交互式设置菜单
cc-zone --settings

# 输出 shell 别名配置示例
cc-zone init

默认情况下,cc-zone 等同于 cc-zone claude。未被 cc-zone 识别的参数会原样传递给 Claude Code。

Shell 集成

全局安装时会自动安装 claude 别名,也可以手动查看并复制配置:

cc-zone init

输出示例:

# zsh / bash
alias claude='cc-zone claude'
# fish
alias claude 'cc-zone claude'
# PowerShell
function claude { cc-zone claude @args }

cc-zone 会从 PATH 中解析真实的 claude 可执行文件,并跳过指向自身的路径,避免别名递归。如果 Claude Code CLI 安装在自定义位置,可通过以下环境变量指定:

export CC_ZONE_CLAUDE=/完整/路径/claude

交互式设置

运行以下命令可打开设置菜单:

cc-zone --settings

设置菜单支持以下操作:

  • 修改当前保存的时区
  • 随机生成并保存新的时区
  • 安装或更新 Claude 快捷别名
  • 安装或更新 cc-zone 命令别名,例如 cz
  • 重置全部设置,包括已保存时区与由 cc-zone 写入的托管别名块

别名会写入当前 shell 的配置文件,例如 .zshrc.bashrc、fish 的 config.fish 或 PowerShell profile。新开终端后配置会自动生效;如需在当前终端立即生效,请执行菜单输出的重新加载命令。

支持的时区

cc-zone 当前仅允许使用以下美国时区:

America/New_York
America/Detroit
America/Kentucky/Louisville
America/Chicago
America/Indiana/Indianapolis
America/Denver
America/Phoenix
America/Boise
America/Los_Angeles
America/Anchorage
Pacific/Honolulu

传入列表之外的时区会返回错误,并输出完整的受支持时区列表。

实现说明

cc-zone 会通过两种方式向 Claude Code 提供时区信息,二者保持一致:

  1. 创建一个临时 settings.json 文件,内容形如 {"env":{"TZ":"<zone>"}},并通过 --settings 参数传递给 Claude Code;
  2. 启动 Claude Code 子进程时注入 TZ 环境变量。

临时 settings 文件使用 0600 权限创建,仅当前用户可读写,并在 Claude Code 进程退出后自动删除。Windows 环境下,cc-zone 会将 IANA 时区转换为平台可识别的 POSIX TZ 表达式,确保 settings 文件与子进程环境变量保持一致。

本地开发

npm install
npm run build
npm test
npm run lint

许可证

本项目基于 MIT License 发布。