Automic VaultAutomic Vault

brew

使用 Homebrew, Nix 安装 code2prompt

查看 code2prompt 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

安装

其他安装命令

macOS

Homebrew已验证 · 100%
brew install code2prompt

local Homebrew formula metadata

Linux

Nix已验证 · 92%
nix profile install nixpkgs#code2prompt

nixpkgs package indexes · pkgs/by-name/co/code2prompt/package.nix · 来源: api.github.com

概览

软件包摘要

CLI tool to convert your codebase into a single LLM prompt

命令和别名

  • code2prompt

历史

项目历史与用法

Code2Prompt is a Rust-based CLI and companion ecosystem for turning a source tree into structured context for large language models. Its niche is the practical developer workflow of packaging repository files, source trees, token counts, templates, and git context into one promptable artifact.

项目历史

The public GitHub repository was created on 2024-03-09, and the first tagged 1.0.0 release followed on 2024-03-16. The official README describes the project as a CLI for converting a codebase into a single LLM prompt, while later project materials frame it as a broader context-engineering tool with a Rust core library, CLI/TUI, Python SDK, and MCP server.

By the 2025 release line, the project had moved beyond a single command into a small tooling family around local code ingestion: respecting ignore rules, generating source trees, applying Handlebars templates, counting tokens, reading formats such as notebooks and CSV, and including git diffs or logs.

采用历史

The official README documents Cargo, Homebrew, binary-release, and Python SDK installation paths, and the input package facts also list Homebrew and Nix packaging. That distribution pattern is typical for Rust CLIs that serve both terminal users and automation workflows.

The repository metadata gathered from GitHub showed several thousand stars and hundreds of forks by the enrichment date, which is notable for a project started in 2024 and consistent with the rapid spread of LLM-context utilities among developers.

使用方式

Typical use is running `code2prompt .` against a project directory, optionally writing to a file or clipboard, filtering paths, using a `.c2pconfig` TOML file, and selecting output formats or tokenizers. The official docs state that Code2Prompt looks for `.c2pconfig` in the current working directory and applies its rules automatically.

The project also targets agentic and programmatic usage: the README describes a Python SDK and local MCP server alongside the human-oriented CLI and TUI.

为什么软件包爱好者会关心

Code2Prompt is a representative package from the post-2023 wave of small, fast CLIs built to bridge traditional repositories and LLM context windows. Package maintainers care about it because it sits at the intersection of Rust CLI distribution, language-model workflow automation, and cross-registry publishing through Cargo, Homebrew, Nix, PyPI bindings, and binary releases.

Its significance is less about a long legacy and more about crystallizing a new packaging pattern: a native CLI with a core library, optional SDK bindings, and editor or agent-adjacent surfaces.

时间线

  • 2024-03-09: Public GitHub repository created.
  • 2024-03-16: v1.0.0 release published.
  • 2024: Homebrew and Cargo installation documented in the official README.
  • 2025: v3 and v4 release lines published, reflecting continued active development.

Related projects

  • Related tools include other repository-to-prompt utilities, code ingestion CLIs, and agent-context servers. Within the project itself, related components include `code2prompt-core`, the `code2prompt` CLI/TUI, the `code2prompt-rs` Python SDK, and the MCP server described in the official README.

安全态势

风险级别:绿色

narrow executable package without higher-risk signals.

风险分类器

绿色 风险 · 低 置信度 · appliance

原因

  • narrow executable package without higher-risk signals

信号

  • metadata:no-higher-risk-signals

安装行为

  • formula 元数据中未记录 Homebrew post-install 钩子。
  • Homebrew bottle 元数据适用于 6 个平台目标。
  • 安装时包含 1 个运行时依赖。
  • 构建元数据列出 2 个构建依赖。

建议审查

在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。

local files

Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.

Configuration files

Config paths the tool may read or write during local use.

Unix
.c2pconfig

可执行文件

已安装的可执行文件

命令类型暴露范围备注
code2promptcli全局可执行文件

新鲜度

版本和新鲜度

这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。

页面生成时间2026-07-08
管理器版本4.2.0
管理器更新时间2026-06-22
本地数据OK
上游当前
检测到的最新版本v4.2.0

https://github.com/mufeedvh/code2prompt

  • OK没有生成新鲜度警告。

安装元数据

软件包元数据

软件包键brew:code2prompt
版本4.2.0
软件包管理器Homebrew
软件包管理器页面https://formulae.brew.sh/formula/code2prompt
主页https://code2prompt.dev/
仓库https://github.com/mufeedvh/code2prompt
上游文档https://code2prompt.dev/docs/how_to/cli
许可证MIT
源码归档https://github.com/mufeedvh/code2prompt/archive/refs/tags/v4.2.0.tar.gz
最后更新2026-06-22T14:03:03-07:00
Pulseupdated
依赖openssl@3
构建依赖pkgconf, rust
Bottle可用 (于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux)
Homebrew post-install未定义
服务未声明

注册表事实

源数据库详情

Source DatabaseHomebrew formula API
Taphomebrew/core
Full Namecode2prompt
Version Scheme0
Revision0
Head VersionHEAD
Bottle Stable Root URLhttps://ghcr.io/v2/homebrew/core
Deprecatedno
Disabledno
Keg Onlyno
URL Keys
  • head
  • stable

源数据库匹配

其他软件包管理器记录

匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。

Nix95%

code2prompt

nix profile install nixpkgs#code2prompt
  • normalized package name match
  • 匹配方式:Code2prompt
nixpkgs package indexes · api.github.com · nixpkgs package indexes: pkgs/by-name/co/code2prompt/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

来源线索

由仓库数据生成

此页面由 av-webscripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。

使用的来源

  • Geiger risk classifier
  • Nucleus package database
  • av.db category and tag curation
  • cross-ecosystem install command graph
  • curated configuration and credential file locations
  • curated package history
  • external package-manager database matches
  • package relationship graph
  • package version freshness
  • package-page enrichment