Skip to content

lucerna search

Search an indexed project with natural language or symbol names. Defaults to the current working directory.

Terminal window
lucerna search "authentication middleware"
lucerna search "authentication middleware" --dir /path/to/project
OptionDescription
--dir <path>Project root directory (default: current working directory)
--no-semanticDisable semantic search (BM25 only)
--limit <n>Max results (default: 10)
--format raw|json|pretty-jsonOutput format (default: raw)
--language <lang>Filter by language: typescript, javascript, json, markdown
--type <type>Filter by chunk type: function, class, method, interface, …
src/auth/middleware.ts:12-45 [function] verifyToken
export function verifyToken(token: string): JWTPayload {
const decoded = jwt.verify(token, process.env.JWT_SECRET!);
src/auth/AuthMiddleware.ts:20-35 [method] run className=AuthMiddleware
run(req: Request, res: Response, next: NextFunction) {
const token = req.headers.authorization?.split(' ')[1];
src/auth/guards.ts:8-22 [function] requireAuth
export function requireAuth(roles: Role[] = []): RequestHandler {
3 result(s)

Ideal for piping:

Terminal window
lucerna search "verifyToken" --format json | jq '.[0].id'
[{"id":"a3f9b2c1d4e5f6a7","file":"src/auth/middleware.ts:12-45","type":"function","name":"verifyToken","content":"export function verifyToken..."}]
[
{
"id": "a3f9b2c1d4e5f6a7",
"file": "src/auth/middleware.ts:12-45",
"type": "function",
"name": "verifyToken",
"content": "export function verifyToken(token: string): JWTPayload {\n ..."
}
]