Back to skills
SKILL.md
Scip Cli
ASecurityRead when needing symbol lookup or SQL health dashboards in code.
- 4 stars
- 0 votes
- 1 copy
- 5 views
- Added September 26, 2026
Works with
Security analysis
92/100- Installs packages at runtime which could introduce malicious dependencies
Pro scans all 20 files and shows the line behind each finding
npx -y skills add flesler/scip-cli --skill scip_cli --agent claude-codeAre you the author of Scip Cli?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/flesler-scip-cli)---
name: scip-cli
description: Read when needing symbol lookup or SQL health dashboards in code.
---
TypeScript/JavaScript, Python, Go, Rust — not GraphQL, CSS, or other files. Run from project root.
**Contributors:** `pip install -e ".[dev]"` so bare `scip-cli` on PATH is this checkout.
## Quick guide
|Question|Command|Output|
|---|---|---|
|Definition / body|`code X`|Snippet (default 80 lines/def; `members Class` for big types)|
|Usages|`refs X`|`file:line` refs|
|Symbols in file|`symbols file`|`start-end kind name` (bare filename ok)|
|Find by name|`search pattern`|Matching symbols|
|Who imports this file?|`rdeps file`|Importer paths|
|What does this use?|`deps target`|Outbound deps (symbol or file)|
|Class members|`members Class`|Methods/fields + line ranges|
|Health / risk|`analyze`|SQL dashboard — project, dir, file, or symbol|
|Raw SQL|`query "SELECT …"`|Rows from `index.db` (`--format tsv|csv|json`)|
Default `--limit` is **10** on query commands unless noted. Stdout = records; stderr = warnings/progress. Pipe with `--paths-only` / `--names-only`.
## Gotchas
- **Bare names** — functions, types, classes. Members need qualifiers: `code Widget.run`, `members pkg.MyClass`. Consts/vars are not indexed — use `rg`. Class methods: `members Class`, not bare `code method`.
- **Ambiguity** — `code`/`refs` return up to `--limit` matches; `members`/`analyze` pick first with stderr warning. Narrow with dotted names or query `--path`.
- **Stale index** — run `reindex` after substantive edits (no auto-invalidation).
- **Query `--path` ≠ reindex scope** — query `--path` filters results only. `reindex --path` / `--tsconfig` persist TS scope and replace cache; full `reindex` restores.
- **Monorepos** — walks `tsconfig*.json` (skips `node_modules`, `.git`). Dedupes nested projects. Extra roots: `.scip-cli.json` (README). Query scope: `--path packages/api`.
- **allowJs** — when tsconfig `allowJs: true`, matching `.js`/`.jsx` under `include`/`files` are indexed. No root `tsconfig.json`: `--infer-tsconfig`.
- **First run** may auto-index (parallel by default, `SCIP_CLI_INDEX_WORKERS`). >10 tsconfigs log progress. Prerequisites: Node (TS/Python), Go, or Rust toolchain; `scip` converter auto-downloads. `brew install scip` is the wrong package.
## Pipelines
|Goal|Pipeline|
|---|---|
|Blast radius|`scip-cli rdeps file.ts \|xargs -I{} scip-cli symbols {}`|
|Health briefing|`scip-cli analyze --limit 40 --per-check-limit 5`|
|Importer files|`scip-cli refs Foo --paths-only`|
|Symbols in importers|`scip-cli refs Foo --paths-only \|xargs -I{} scip-cli symbols {}`|
|Classes → members|`scip-cli search Handler --kind class --names-only \|xargs -I{} scip-cli members {}`|
|Members → defs|`scip-cli members Widget --names-only \|xargs -I{} scip-cli code Widget.{}`|
|Topic files|`scip-cli search Dynamo --paths-only`|
|Outbound files|`scip-cli deps file.ts --paths-only`|
`xargs` reopens the index each call — cap fan-out with `--limit` on the first command.
## Commands
### code
```bash
code [--kind KIND] [--limit N] [--max-lines N] [--offset N] [--full] [--path PATH] [--snippet] [--line-numbers] <symbol> [...]
```
`--kind`: `function`, `method`, `class`, `property`. Multiple symbols: each block prefixed on stdout. `--max-lines` per body (default 80; also 32k char cap unless `--full` or `--max-lines 0`). `--offset` is body-relative. `SCIP_CLI_MAX_DEF_LINES` overrides cap.
### refs
```bash
refs [--limit N] [--path PATH] [--paths-only] <symbol> [...]
```
`file:line` per ref (reads source for lines). Multi-symbol groups prefixed on stdout.
### search
```bash
search [--kind KIND] [--limit N] [--path PATH] [--names-only] [--paths-only] <pattern> [...]
```
`file:line kind name`. Patterns OR'd. Filters noisy symbols.
### symbols
```bash
symbols [--limit N] [--path PATH] <file>
```
### rdeps
```bash
rdeps [--limit N] [--path PATH] <file>
```
Bare importer paths on stdout.
### deps
```bash
deps [--limit N] [--path PATH] [--paths-only] <symbol|file>
```
Symbol: deps inside definition range. File: external symbols referenced. Format `file:line symbol`; `--paths-only` dedupes files.
### members
```bash
members [--limit N] [--path PATH] [--names-only] <symbol>
```
`start:end kind name`. Prefix match under parent; missing ranges filled from source when needed.
### query
```bash
query [--format tsv|csv|json] [--write] <sql> [...]
```
SQL against the cached project `index.db`. **Read-only by default** (`PRAGMA query_only`); `--write` allows mutations (commits after each statement). Default `--format` is **tsv** (header row + tab-separated values). `csv` and `json` (array of objects) are also supported. Prefer `reindex` over hand-editing the cache.
Introspect schema (SQLite catalog + `PRAGMA`):
```bash
query "SELECT name FROM sqlite_schema WHERE type='table' ORDER BY 1"
query "PRAGMA table_info(mentions)"
query "SELECT m.name AS table_name, p.name AS column_name, p.type FROM sqlite_schema m JOIN pragma_table_info(m.name) p WHERE m.type='table' AND m.name NOT LIKE 'sqlite_%' ORDER BY 1, p.cid"
```
### analyze
```bash
analyze [--list-checks] [--limit N] [--per-check-limit N] [--path PATH] [--include-tests] [--priority LEVEL] [--check NAME] [target]
```
**Check names:** `scip-cli analyze --list-checks` (scope + one-line summary; no index required). Glue/slop pass:
`scip-cli analyze --check dead_exports,dead_files,single_importer_files,one_line_exports --priority high,low --limit 40`
**Two “single place” checks:** `single_importer_files` (project) = whole file has one inbound importer. `single_use_imports` (file target only) = import binding imported once in that file and used once repo-wide.
|Target|Scope|
|---|---|
|_(omit)_|Project dashboards|
|directory|Dir dashboards + per-file sections (indexed files under dir)|
|file|File dashboards + top symbols by external consumers|
|symbol|Pressure, consumers, deps, affected|
Priority **high → medium → low**. `[high]` cycles, dead exports, dead files, stale types (project unreferenced omitted when dead exports runs; file unreferenced omitted when dead-in-file runs). `[medium]` same-file-only, change surface (file). `[low]` single-importer files (`[test-only]` tag), test-only consumers, coupling, bottlenecks, hotspots, `one_line_exports` (tiny exported call-through functions — verify before inlining). `--limit` = total finding rows (default 20); headers/truncation don't count. `--per-check-limit` caps each section. Agents: `--limit 40 --per-check-limit 5`. `--priority high` or `high,medium` (`1`/`2`/`3`) skips lower tiers. `--check NAME` (repeatable/comma) ANDs with priority.
**Easy wins:** cycles, dead exports, dead files (production). Stale types = types with no external refs. Dead = no cross-file refs in index, not `vulture`. Shebang plus manifest entrypoints (`package.json` main/bin/scripts, dist→src mapping; each Python package for pyproject/setup/setup.cfg) are never project-level dead files/exports. `single_importer_files` rows with only test importers are tagged `[test-only]`. File-scoped `analyze path/to/cli.ts` still reports unused symbols in that file. Empty `rdeps` on a hit is often a SCIP miss — verify with `rg -F STEM` (basename in `(...)`, same-file hits ignored).
### reindex
```bash
reindex [--path DIR ...] [--tsconfig GLOB ...] [--exclude [GLOB ...]] [--fresh] [--no-incremental] [--unversioned] [--with-external]
```
`--path` and `--tsconfig` are TS-only and mutually exclusive. `--tsconfig` globs expanded in-tool; one heap per file by default (`SCIP_CLI_TS_INDEX_BATCH_SIZE` overrides). Scope/exclude persist in `metadata.json`.
`--exclude GLOB` drops matching docs post-convert (repeatable; merges `.scip-cli.json` `excludeGlobs`). Bare `--exclude` clears list; `--exclude foo --exclude` keeps `foo`. No `/` = basename; with `/` = repo-relative.
`--fresh` clears persisted metadata (unless combined with scope flags on same command).
**Incremental by default** in git TypeScript repos: reuses `shards/manifest.json` (`git_commit` + per-shard `tsconfig_digest`); skips clean shards. Dirty: git delta ∪ importer closure → fork `--files` → upsert live `index.db`; deletions remove documents. `--no-incremental` or `--fresh` forces full reindex and clears the manifest. Non-git, `--unversioned`, or non-TypeScript projects always full-reindex.
Files in this skill
- SKILL.md
- __init__.py
- __main__.py
- analyze/__init__.py
- analyze/common.py
- analyze/file.py
- analyze/graph.py
- analyze/live.py
- analyze/project.py
- analyze/sections.py
- analyze/symbol.py
- analyze/targets.py
- cache.py
- cli_args.py
- commands/__init__.py
- commands/analyze.py
- commands/code.py
- commands/deps.py
- commands/members.py
- commands/rdeps.py
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.