You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bf903e4
Browse filesBrowse the repository at this point in the historyBrowse files
@@ -71,3 +73,4 @@ _No pending tasks._ All commands implemented.
71
73
| 2026-06-18 |`repo --output json` now includes `repository.fileCount`, plucked from `coverage.numberTotalFiles` on the existing `getRepositoryWithAnalysis` response (present even without coverage data — no extra API call). Unlocks repo-size visibility for downstream consumers like the `configure-codacy-cloud` skill (1 new test, 373 total) |
72
74
| 2026-06-24 |`findings` and `finding` now surface the vulnerable dependency's import chain from the new `dependencyChains` field: Direct (`Update <pkg> to <fixed>`) vs Transitive (`<chain> (Fixed in <fixed>)`), with the middle collapsed to `... N more ...` for 4+ packages. List shows the first chain + `... and X more`; detail shows all chains aligned under a single label. New helpers in `utils/formatting.ts` (`formatDependencyChain`, `formatDependencyChainsLine`, `formatDependencyChainsBlock`); `dependencyChains` added to both JSON projections (17 new tests, 390 total) |
73
75
| 2026-06-30 | npm-style "update available" notice via `update-notifier@5`: one-time stderr hint when a newer version is published, gated to `--output table` (suppressed for `json`, when piped, in CI, under `npx`). Non-blocking daily background check; never auto-updates. New `src/version.ts` (single source of name/version) + `src/utils/update-check.ts` (`maybeNotifyUpdate`); `preAction` hook + `--no-update-notifier` flag wired in `index.ts`. Opt-outs: `CODACY_DISABLE_UPDATE_CHECK`, `NO_UPDATE_NOTIFIER`, `--no-update-notifier`. `package.json``overrides` pin transitive `got@^11.8.6`/`package-json@^7` (CVE-2022-33987) (7 new tests, 409 total) |
76
+
| 2026-07-07 |`ls` and `directories` commands: browse a repository's folders/files with quality metrics (Grade/Issues/Complexity/Duplication/Coverage). Auto-detect provider/org/repo and the cwd-relative path; `--path`/`--branch` options; `directories --plus-children` shows one extra level as a `└─` tree (header adds `, M subdirectories`). `--sort`/`--direction` (server-side; in `ls`, directories and files sorted independently), and `ls --search <term>` (files only; folds the path into the search as `<path>/%<term>` and shows full paths). Duplication uses `numberOfClones`; Complexity uses `complexity` (hotspots). Both fetch **all** pages (no pagination warning) via new `src/utils/repo-tree.ts` (path resolution + `resolveSort`/`resolveDirection` + `fetchAllDirectories`/`fetchAllFiles`). Row markers `▸` folder / dim `·` file (no emojis). Promoted `formatGrade` to `utils/formatting.ts` (now also colors E red) and added `formatCountCell`/`formatCoverageCell` (48 new tests, 457 total) |
List the immediate directories at a path in a repository, each with quality metrics — like `ls` but folders only. With `--plus-children`, also lists each directory's immediate sub-directories (one extra level) so you can see a bigger picture of the folder structure and its metrics.
8
+
9
+
## Usage
10
+
11
+
```
12
+
codacy directories # current directory's folders (auto-detected)
13
+
codacy directories --plus-children # also one more level of sub-folders
Cursor-paginated; **all pages are fetched** (`fetchAllDirectories` in `utils/repo-tree.ts`) with no pagination warning. `--plus-children` issues one additional (fully paginated) `listDirectories` call per directory, concurrently, listing that directory's `path`.
25
+
26
+
## Options
27
+
28
+
| Option | Short | Description |
29
+
|---|---|---|
30
+
|`--path <path>`|`-p`| Repository-relative folder to list (defaults to the cwd relative to the repo root) |
31
+
|`--branch <branch>`|`-b`| Branch name (defaults to the main branch) |
32
+
|`--plus-children`|`-c`| Also list each directory's immediate sub-directories |
33
+
|`--sort <field>`|`-S`| Sort by `name`, `issues`, `grade`, `duplication`, `complexity`, or `coverage`|
34
+
|`--direction <direction>`|`-d`|`asc`/`ascending` or `desc`/`descending`|
35
+
36
+
`--sort`/`--direction`, when given, are applied server-side to both the top-level listing and each `--plus-children` listing; otherwise directories are ordered by name.
37
+
38
+
## Output
39
+
40
+
Bold header `/<repo>/<path> — N directories` (with `--plus-children`, also `, M subdirectories` — the total children across all directories), then a columnar table (same columns as `ls`). Parent rows are prefixed `▸ <name>`; with `--plus-children`, each child is rendered on its own indented row ` └─ <name>` under its parent.
List the immediate directories **and** files at a path in a repository (like Unix `ls`), each with quality metrics. Repository is auto-detected from the git remote; the path is auto-detected from the current working directory relative to the repo root, or given via `--path`, or defaults to the repo root.
8
+
9
+
## Usage
10
+
11
+
```
12
+
codacy ls # current directory (auto-detected)
13
+
codacy ls --path src/website # a specific folder
14
+
codacy ls gh my-org my-repo # root of an explicit repository
15
+
codacy ls gh my-org my-repo --path src/website
16
+
codacy ls --sort issues --direction desc # worst files/folders first
17
+
codacy ls --path app/client --search config # search files under a path
Both endpoints are cursor-paginated. This command **fetches every page** (via `fetchAllDirectories` / `fetchAllFiles` in `utils/repo-tree.ts`) — it does **not** show a pagination warning. The `path` argument is always passed as an explicit string (`""` = repo root, non-recursive); it is never `undefined`, which would make `listFiles` recursive.
27
+
28
+
## Options
29
+
30
+
| Option | Short | Description |
31
+
|---|---|---|
32
+
|`--path <path>`|`-p`| Repository-relative folder to list (defaults to the cwd relative to the repo root) |
33
+
|`--branch <branch>`|`-b`| Branch name (defaults to the main branch) |
34
+
|`--search <term>`|`-s`| Search files (any depth) under the path instead of listing immediate children |
35
+
|`--sort <field>`|`-S`| Sort by `name`, `issues`, `grade`, `duplication`, `complexity`, or `coverage`|
36
+
|`--direction <direction>`|`-d`|`asc`/`ascending` or `desc`/`descending`|
37
+
38
+
**Sorting.** With no `--sort`/`--direction`, results are ordered by name client-side. When either is given, ordering is delegated to the API (`sort`/`direction` params) — directories and files are sorted **independently** (each fully paginated, then concatenated), never merged. The CLI `name` field maps to the API's `filename` for files.
39
+
40
+
**Search.**`--search` lists **files only** (the directories endpoint has no search). The folder scope is folded into the search term (`<path>/%<term>`, or just `<term>` at the root) and `path` is **not** sent, so matches are found at any depth under the path. Results show each file's full repository-relative path.
41
+
42
+
## Output
43
+
44
+
Bold header `/<repo>/<path> — N directories, M files`, then a columnar table with directories first (each sorted by name), then files.
45
+
46
+
| Column | Source (directory / file) | Notes |
47
+
|---|---|---|
48
+
| Name |`▸ <dir.name>` / `· <basename(file.path)>`|`▸` folder, dim `·` file (no emojis); in search mode the file's full path is shown |
49
+
| Grade |`gradeLetter`| A/B green, C yellow, D/E/F red |
50
+
| Issues |`totalIssues`| Abbreviated (`formatCount`, e.g. `1.2k`) |
51
+
| Complexity |`complexity`| Highest file complexity under the path (hotspots); files show the file value |
52
+
| Duplication |`numberOfClones`| Number of cloned code blocks (matches Codacy's UI, not duplicated lines) |
53
+
| Coverage |`coverageWithDecimals`| e.g. `76.3%`|
54
+
55
+
Missing metrics render as a dim `-`. Only the Grade letter is colored (directory/file items carry no goal thresholds). No pagination warning (all pages fetched). Empty result prints "Nothing found at …".
56
+
57
+
JSON output: `{ path, directories: [...], files: [...] }`, each item projected via `pickDeep`.
Copy file name to clipboardExpand all lines: src/commands/AGENTS.md
+59Lines changed: 59 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,6 +109,65 @@ Instead of a dedicated "Visibility" column (wastes horizontal space), public rep
109
109
-**`--reanalyze` mode** (`-R`): fetches HEAD commit SHA, calls `RepositoryService.reanalyzeCommitById`; early return
110
110
-**`--reanalyze-and-wait` mode** (`-w`): blocking variant — see "Reanalyze and wait" below. Baseline comes from `issuesOverview`; polling reads the repo's first commit via `listRepositoryCommits(limit=1)` analysis timestamps
111
111
112
+
## ls command (`ls.ts`) and directories command (`directories.ts`)
113
+
114
+
Repository-level "file browser" commands built on `RepositoryService.listFiles`
115
+
and `listDirectories`. `ls` lists directories **and** files at a path;
116
+
`directories` (alias `dirs`) lists folders only, with `-c, --plus-children` to
117
+
also pull each folder's immediate sub-folders (one extra level).
0 commit comments