{"id":15787133,"url":"https://github.com/kenmick/z-cli","last_synced_at":"2025-04-01T16:31:04.562Z","repository":{"id":149795899,"uuid":"621803473","full_name":"kenmick/z-cli","owner":"kenmick","description":"An interactive ChatGPT-powered command line tool that generates commands using natural language. z-cli 是一个基于 ChatGPT 的交互式命令行工具，支持用户输入自然语言来生成可执行的命令。","archived":false,"fork":false,"pushed_at":"2023-04-11T10:34:31.000Z","size":120,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-29T23:25:24.278Z","etag":null,"topics":["chatgpt","cli","command-line-tool","interactive","openai"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@kenmick/z-cli","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kenmick.png","metadata":{"files":{"readme":"README-CN.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-31T12:23:44.000Z","updated_at":"2023-12-01T10:27:33.000Z","dependencies_parsed_at":"2023-06-02T16:15:33.303Z","dependency_job_id":null,"html_url":"https://github.com/kenmick/z-cli","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenmick%2Fz-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenmick%2Fz-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenmick%2Fz-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenmick%2Fz-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kenmick","download_url":"https://codeload.github.com/kenmick/z-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246620668,"owners_count":20806818,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatgpt","cli","command-line-tool","interactive","openai"],"created_at":"2024-10-04T21:05:32.002Z","updated_at":"2025-04-01T16:31:04.309Z","avatar_url":"https://github.com/kenmick.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# z-cli\n\nz-cli 是一个基于 ChatGPT 的交互式命令行工具，支持用户输入自然语言来生成可执行的命令。\n\n## 🚀 特点\n\n- **自然语言查询**：根据用户输入的自然语言生成可执行的命令。\n- **运行时检测**：检测用户的 shell（例如 PowerShell、zsh、bash 等）和操作系统（例如 Windows、Linux 和 Mac），以确保更准确的命令生成。\n- **上下文感知**：允许用户分步骤多次输入，以细化生成命令的需求。\n- **命令编辑**：允许用户在执行命令之前手动编辑生成的命令。\n- **命令复制**：允许用户将生成的命令复制到剪贴板。\n\n## 🕹️ 示例\n\n- zsh: 查找指定条件下的文件，并显示每个文件的行数。\n\n![find](https://user-images.githubusercontent.com/10039224/230420856-51ab0ddc-63ac-40a3-8470-96cb1f9f4af7.gif)\n\n- PowerShell: 请求 API 并以指定格式返回响应。\n\n![request_api](https://user-images.githubusercontent.com/10039224/230420901-eb9d188c-8ae0-4618-b98b-dd6c926a08fc.gif)\n\n## 📦 安装\n\n您可以通过运行以下命令来安装 z-cli：\n\n```bash\nnpm install -g @kenmick/z-cli\n```\n\n## 🛠️ 配置\n\n在使用 z-cli 之前，您需要配置环境变量 `OPENAI_API_KEY`。\n\n```bash\n# Linux and Mac\nexport OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n```\n\n```powershell\n# Windows\n$env:OPENAI_API_KEY=\"sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n```\n\n您可以从 [OpenAI](https://platform.openai.com/account/api-keys/) 获取自己的 API KEY。\n\n## 📖 使用\n\n要使用 z-cli，只需运行命令，后面输入您想要查询的内容。例如：\n\n```bash\nz-cli 'list js files'\n```\n\n然后您将收到以下输出：\n\n```bash\nls *.js\n```\n\n您可以运行 `z-cli --help` 来查看更多用法。\n\n```bash\nz-cli v0.2.0\n\nUsage:\n  z-cli [flags...] \u003cquery\u003e\n\nFlags:\n      --debug                 Enable debug mode\n  -h, --help                  Show help\n  -p, --proxy \u003cstring\u003e        Proxy url. e.g. http://localhost:1080\n      --version               Show version\n```\n\n## 📌 为什么取名为 \"z-cli\"\n\n命名为 `z-cli` 是为了纪念一位叫 `ZCL` 的对我而言**非常重要**的人。🌷\n\n## 🤝 贡献\n\n欢迎贡献！如果您有任何建议或遇到任何问题，请创建新的 issue 或 PR。\n\n## 📜 License\n\nz-cli 的 License 是 GPL-3.0。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenmick%2Fz-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkenmick%2Fz-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenmick%2Fz-cli/lists"}