# code2prompt を Homebrew, Nix でインストール

code2prompt のインストール経路、実行ファイル、メタデータ、AI エージェント向けセキュリティノートを確認します。

## インストール

```sh
sudo av install brew:code2prompt
```

追加のインストールコマンド:

### macOS

- Homebrew (100%):

```sh
brew install code2prompt
```

  証拠: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#code2prompt
```

  証拠: nixpkgs package indexes: pkgs/by-name/co/code2prompt/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## パッケージ情報

- **パッケージキー:** brew:code2prompt
- **パッケージマネージャ:** Homebrew
- **パッケージマネージャページ:** <https://formulae.brew.sh/formula/code2prompt>
- **バージョン:** 4.2.0
- **ソース概要:** CLI tool to convert your codebase into a single LLM prompt
- **ホームページ:** <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
- **生成日時:** 2026-07-08T07:18:31+00:00

## 実行可能ファイル

- code2prompt (cli)
- code2prompt (エイリアス)

## 依存関係

- openssl@3

## ビルド依存関係

- pkgconf
- rust

## インストール挙動

- post-install フック: 未定義
- Bottle: 利用可能 対象 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## バージョンと鮮度

- ページ生成日: 2026-07-08
- マネージャ版: 4.2.0
- マネージャ更新日: 2026-06-22
- ローカルデータ: OK
- 上流リポジトリ: https://github.com/mufeedvh/code2prompt
- 検出された最新: v4.2.0 (最新)
## プロジェクトの歴史と使われ方

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.

### ソース

- <https://github.com/mufeedvh/code2prompt>
- <https://code2prompt.dev/docs/how_to/config/>


## セキュリティノート

narrow executable package without higher-risk signals.

- **Geiger リスク:** グリーン / 低
- narrow executable package without higher-risk signals


## 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

- Unix: .c2pconfig
## ソースデータベース詳細

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** code2prompt
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## 他のパッケージマネージャ記録

- Nix - code2prompt: normalized package name match | nixpkgs package indexes: pkgs/by-name/co/code2prompt/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## 関連リンク

- [MCP tool packages](https://www.automicvault.com/ja/pkg/mcp-tools/) - Mentions MCP or Model Context Protocol.
- [Terminal utility packages](https://www.automicvault.com/ja/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/ja/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/ja/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [openssl@3](https://www.automicvault.com/ja/pkg/brew/openssl-3/) - Runtime dependency declared by Homebrew.
- [pkgconf](https://www.automicvault.com/ja/pkg/brew/pkgconf/) - Build dependency declared by Homebrew.
- [rust](https://www.automicvault.com/ja/pkg/brew/rust/) - Build dependency declared by Homebrew.
- [context7-mcp](https://www.automicvault.com/ja/pkg/brew/context7-mcp/) - Shares av.db curated category or tags: cli, developer-tools, llm, mcp.
- [mcphost](https://www.automicvault.com/ja/pkg/brew/mcphost/) - Shares av.db curated category or tags: cli, developer-tools, llm, mcp.
- [oterm](https://www.automicvault.com/ja/pkg/brew/oterm/) - Shares av.db curated category or tags: cli, developer-tools, llm, mcp.
- [airtable-mcp-server](https://www.automicvault.com/ja/pkg/brew/airtable-mcp-server/) - Shares av.db curated category or tags: cli, developer-tools, mcp.
- [cai](https://www.automicvault.com/ja/pkg/brew/cai/) - Shares av.db curated category or tags: cli, developer-tools, llm.
- [chrome-devtools-mcp](https://www.automicvault.com/ja/pkg/brew/chrome-devtools-mcp/) - Shares av.db curated category or tags: cli, developer-tools, mcp.
- [claude-code-templates](https://www.automicvault.com/ja/pkg/brew/claude-code-templates/) - Shares av.db curated category or tags: cli, developer-tools, mcp.
- [codanna](https://www.automicvault.com/ja/pkg/brew/codanna/) - Shares av.db curated category or tags: cli, developer-tools, mcp.
- [yek](https://www.automicvault.com/ja/pkg/brew/yek/) - Local package facts share a topical domain. Shared terms: cli, developer, developer-tools, generation, llm.
- [cargo-generate](https://www.automicvault.com/ja/pkg/brew/cargo-generate/) - Local package facts share a topical domain. Shared terms: cli, code, developer, developer-tools, generation.

## Combined YAML source

View the package source record on GitHub. [combined/code2prompt.yml](https://github.com/automic-vault/db/blob/main/combined/code2prompt.yml)


## ソース

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