ast-search-python 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/AGENTS.md +3 -1
  2. package/README.md +3 -1
  3. package/package.json +1 -1
package/AGENTS.md CHANGED
@@ -14,8 +14,10 @@ ast-search <query> --plugin ast-search-python [--dir <path>] [--format text|json
14
14
  |------|-------|---------|-------------|
15
15
  | `--plugin` | `-p` | — | Must be `ast-search-python` to activate Python support |
16
16
  | `--dir` | `-d` | `cwd` | Root directory to search |
17
- | `--format` | `-f` | `text` | Output format: `text`, `json`, or `files` |
17
+ | `--format` | `-f` | `text` | Output format: `text`, `json`, `files`, or `count` |
18
18
  | `--lang` | `-l` | all | Pass `python` to restrict to Python files only |
19
+ | `--context` | `-C` | `0` | Show N lines of context around each match (like `grep -C`) |
20
+ | `--ast` | — | off | Print Python AST for a snippet or `--file`; requires `--lang python` |
19
21
 
20
22
  **Exit codes:** `0` = matches found · `1` = no matches · `2` = error (invalid selector, etc.)
21
23
 
package/README.md CHANGED
@@ -35,9 +35,11 @@ ast-search <query> --plugin ast-search-python [--dir <path>] [--format <fmt>] [-
35
35
  | -------------- | -------------------------------------------------------------- | ----------- |
36
36
  | `<query>` | Shorthand or tree-sitter S-expression (see Query Syntax below) | required |
37
37
  | `-d, --dir` | Root directory to search | current dir |
38
- | `-f, --format` | Output format: `text`, `json`, or `files` | `text` |
38
+ | `-f, --format` | Output format: `text`, `json`, `files`, or `count` | `text` |
39
39
  | `-l, --lang` | Restrict search to `python` only (useful in mixed-language repos) | all languages |
40
40
  | `-p, --plugin` | `ast-search-python` | required |
41
+ | `-C, --context` | Show N lines of context around each match (like `grep -C`) | `0` |
42
+ | `--ast` | Print AST for a code snippet or `--file`; use with `--lang python` for Python ASTs | off |
41
43
 
42
44
  ## Example
43
45
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ast-search-python",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "Python language plugin for ast-search",
5
5
  "type": "module",
6
6
  "main": "./build/index.js",