Skip to content

LLMTooling/universal-ctags-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

universal-ctags-node

Node.js wrapper for universal-ctags binaries for cross-platform code indexing

License: MIT Node Version Platform Support

Core Capabilities

Capability Description
Automatic Binary Management Downloads and configures platform-specific ctags binaries during npm install with zero configuration required.
Cross-Platform Support Native binaries for Windows (x64/x86), macOS (Intel/Apple Silicon), and Linux (x64/ARM64).
MCP Ready Purpose-built for Model Context Protocol servers requiring universal-ctags functionality.

Installation

This package is published to GitHub Packages and requires authentication to install.

Step Instructions
1. Create GitHub Personal Access Token Navigate to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
Generate new token with read:packages scope
Copy the generated token
2. Configure npm Authentication
# Create .npmrc in project root or home directory
echo "@LLMTooling:registry=https://npm.pkg.github.com" > .npmrc
echo "//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN" >> .npmrc
3. Install the Package
npm install @LLMTooling/universal-ctags-node

Usage

Usage Pattern Code Example
Basic Usage
const { ctagsPath } = require('@LLMTooling/universal-ctags-node');

console.log('ctags binary location:', ctagsPath); // Use ctagsPath with child_process to run ctags commands

With execSync
const { execSync } = require('child_process');
const { ctagsPath } = require('@LLMTooling/universal-ctags-node');

// Get ctags version const version = execSync("${ctagsPath}" --version, { encoding: 'utf8' }); console.log(version);

// Generate tags for a project execSync("${ctagsPath}" -R --fields=+nKz --extras=+q ., { cwd: '/path/to/project' });

With spawn
const { spawn } = require('child_process');
const { ctagsPath } = require('@LLMTooling/universal-ctags-node');

const ctags = spawn(ctagsPath, ['--version']);

ctags.stdout.on('data', (data) => { console.log(stdout: ${data}); });

ctags.stderr.on('data', (data) => { console.error(stderr: ${data}); });

Platform Support

Platform Architecture Binary Source
Windows x64, x86 ctags-win32
macOS x64 (Intel), ARM64 (Apple Silicon) ctags-nightly-build
Linux x64, ARM64 ctags-nightly-build

Architecture

File Tree
code-search-mcp-universal-ctags/
├── lib/
│   ├── index.js          # Main entry point
│   ├── postinstall.js    # Download and setup logic
│   └── util.js           # Helper functions
├── test/
│   └── basic.test.js     # Test suite
├── bin/                  # Created during install (git-ignored)
│   └── ctags(.exe)       # Platform-specific binary
└── package.json

Configuration

Variable Purpose Default
GITHUB_TOKEN GitHub API authentication to avoid rate limits None
SKIP_POSTINSTALL Skip automatic binary download during installation false

Acknowledgments

Project Contribution
Universal Ctags Core ctags implementation
ctags-win32 Windows binary distribution
ctags-nightly-build Unix binary distribution
vscode-ripgrep Package structure inspiration

Built for the Model Context Protocol ecosystem

About

An updated Node.js wrapper for universal-ctags

Topics

Resources

License

Stars

Watchers

Forks

Packages