PHPackages                             coquibot/coqui-toolkit-code-search - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. coquibot/coqui-toolkit-code-search

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

coquibot/coqui-toolkit-code-search
==================================

Code search toolkit for Coqui — text search via ripgrep, symbol indexing via ctags, incremental SQLite index

v0.1.0(1mo ago)00MITPHPPHP ^8.4CI passing

Since Mar 17Pushed 1mo agoCompare

[ Source](https://github.com/carmelosantana/coqui-toolkit-code-search)[ Packagist](https://packagist.org/packages/coquibot/coqui-toolkit-code-search)[ RSS](/packages/coquibot-coqui-toolkit-code-search/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Coqui Toolkit: Code Search
==========================

[](#coqui-toolkit-code-search)

A code search toolkit for [Coqui](https://github.com/coquibot/coqui) that provides fast full-text search, symbol lookup, and file discovery powered by [ripgrep](https://github.com/BurntSushi/ripgrep) and [universal-ctags](https://github.com/universal-ctags/ctags).

Requirements
------------

[](#requirements)

DependencyVersionPurposePHP8.4+Runtimeripgrep (`rg`)AnyText/regex searchuniversal-ctags (`ctags`)AnySymbol extraction### Installing System Dependencies

[](#installing-system-dependencies)

**Debian / Ubuntu:**

```
sudo apt install ripgrep universal-ctags
```

**macOS (Homebrew):**

```
brew install ripgrep universal-ctags
```

**Arch Linux:**

```
sudo pacman -S ripgrep ctags
```

Installation
------------

[](#installation)

```
composer require coquibot/coqui-toolkit-code-search
```

Coqui discovers the toolkit automatically via `extra.php-agents.toolkits` in `composer.json`. No manual registration needed.

Tools
-----

[](#tools)

### `code_search`

[](#code_search)

Full-text search through file contents using ripgrep. Ideal for finding specific strings, patterns, or code snippets.

ParameterTypeRequiredDefaultDescription`query`stringYes—Search pattern (text or regex)`path`stringNoworkspaceDirectory or file to search within`file_type`stringNo—Restrict to file type (e.g. `php`, `js`, `python`)`is_regex`booleanNo`false`Treat query as a regex pattern`context_lines`integerNo`2`Lines of context around matches (0-10)`max_results`integerNo`50`Maximum matches to return (1-200)`case_sensitive`booleanNo`false`Enable case-sensitive matching`word_match`booleanNo`false`Match whole words only`include_hidden`booleanNo`false`Include hidden files/directories`glob`stringNo—File glob pattern (e.g. `*.php`, `src/**/*.ts`)### `symbol_search`

[](#symbol_search)

Search the symbol index for classes, functions, methods, constants, and other named entities across all indexed languages.

ParameterTypeRequiredDefaultDescription`name`stringYes—Symbol name to search for`kind`stringNo—Filter by kind: `class`, `function`, `method`, `variable`, `constant`, `interface`, `trait`, `enum`, `property`, `namespace``language`stringNo—Filter by language (e.g. `PHP`, `JavaScript`)`scope`stringNo—Parent scope (e.g. class name for methods)`exact`booleanNo`false`Require exact name match`limit`integerNo`30`Maximum results (1-100)### `file_structure`

[](#file_structure)

Display the symbol outline of a file — classes, methods, functions, properties — organized hierarchically. Useful for understanding file organization before reading it.

ParameterTypeRequiredDefaultDescription`path`stringYes—File path (relative to workspace)`kind`stringNo—Filter to specific symbol kind### `search_files`

[](#search_files)

Find files by name pattern. Uses ripgrep's `--files` mode for fast filesystem traversal.

ParameterTypeRequiredDefaultDescription`pattern`stringYes—Glob pattern (e.g. `*.php`, `Test*.js`)`file_type`stringNo—Restrict to file type`path`stringNoworkspaceDirectory to search within`max_results`integerNo`50`Maximum files to return (1-200)### `code_index`

[](#code_index)

Manage the persistent symbol index. Build, update, clear, or check status. Supports multiple search roots.

ParameterTypeRequiredDefaultDescription`action`enumYes—One of: `build`, `update`, `status`, `clear`, `add_root`, `remove_root`, `list_roots``path`stringNo—Required for `add_root` and `remove_root` actionsIndex Management
----------------

[](#index-management)

The toolkit maintains a SQLite index at `{workspace}/code-search/index.db` for fast symbol lookups. The index is built lazily on the first `symbol_search` or `file_structure` call.

### Index Actions

[](#index-actions)

- **`build`** — Full rebuild: scans all files, extracts symbols with ctags, stores in SQLite.
- **`update`** — Incremental: only re-indexes files that changed since the last build (based on mtime comparison).
- **`status`** — Show index statistics: file count, symbol count, languages, search roots.
- **`clear`** — Delete all index data.
- **`add_root`** — Add a directory to the search roots for indexing.
- **`remove_root`** — Remove a directory from search roots.
- **`list_roots`** — Show all configured search roots.

### Multi-Root Support

[](#multi-root-support)

By default, the workspace directory is the only search root. Additional directories can be added:

```
code_index(action: "add_root", path: "/path/to/project")
code_index(action: "update")

```

Indexed paths use the format `{root}::{relative_path}` internally to disambiguate files across roots.

Architecture
------------

[](#architecture)

```
src/
├── CodeSearchToolkit.php           # Main toolkit — tools() + guidelines()
├── Contract/
│   ├── ChangeSet.php               # Added/modified/deleted file lists
│   ├── IndexStats.php              # Index statistics value object
│   └── TagEntry.php                # Symbol entry from ctags
├── Exception/
│   ├── BinaryNotFoundException.php # Missing rg/ctags
│   └── IndexException.php         # SQLite/indexing errors
├── Index/
│   ├── CodeIndex.php               # Orchestrates indexing + search
│   └── IncrementalIndexer.php      # Filesystem change detection
├── Runtime/
│   ├── BinaryResolver.php          # Locates rg/ctags binaries
│   ├── CtagsRunner.php             # Runs ctags, parses JSON output
│   ├── ProcessResult.php           # Process execution result VO
│   └── RipgrepRunner.php           # Runs rg, parses JSON output
├── Storage/
│   └── IndexDatabase.php           # SQLite schema + queries
└── Tool/
    ├── CodeIndexTool.php           # code_index tool
    ├── CodeSearchTool.php          # code_search tool
    ├── FileStructureTool.php       # file_structure tool
    ├── SearchFilesTool.php         # search_files tool
    └── SymbolSearchTool.php        # symbol_search tool

```

Supported Languages
-------------------

[](#supported-languages)

The index recognizes 30+ file extensions including PHP, JavaScript, TypeScript, Python, Ruby, Go, Rust, Java, C/C++, C#, Swift, Kotlin, Scala, Shell, Lua, Perl, R, SQL, CSS/SCSS, HTML, Vue, Svelte, JSON, YAML, TOML, XML, Markdown, GraphQL, and Protobuf.

ctags itself supports 100+ languages — any file type ctags recognizes will have its symbols extracted.

Development
-----------

[](#development)

```
# Install dependencies
composer install

# Run tests
composer test

# Static analysis
vendor/bin/phpstan analyse
```

License
-------

[](#license)

MIT

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance89

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

55d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/597820?v=4)[Carmelo Santana](/maintainers/carmelosantana)[@carmelosantana](https://github.com/carmelosantana)

---

Top Contributors

[![carmelosantana](https://avatars.githubusercontent.com/u/597820?v=4)](https://github.com/carmelosantana "carmelosantana (1 commits)")

---

Tags

toolkitctagsphp-agentscoquicode-searchripgrepsymbol-index

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/coquibot-coqui-toolkit-code-search/health.svg)

```
[![Health](https://phpackages.com/badges/coquibot-coqui-toolkit-code-search/health.svg)](https://phpackages.com/packages/coquibot-coqui-toolkit-code-search)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
