https://github.com/joakimen/scriv
A CLI tool for detecting Git repositories.
https://github.com/joakimen/scriv
cobra-cli git go
Last synced: 3 months ago
JSON representation
A CLI tool for detecting Git repositories.
- Host: GitHub
- URL: https://github.com/joakimen/scriv
- Owner: joakimen
- License: mit
- Created: 2024-02-16T15:35:08.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-07T12:17:46.000Z (about 1 year ago)
- Last Synced: 2026-03-01T18:51:44.576Z (4 months ago)
- Topics: cobra-cli, git, go
- Language: Go
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# scriv
> "We found him wandering around, with a candle."
## Summary
[Scriv](https://kingkiller.fandom.com/wiki/Scriv) is a CLI tool that detects Git repositories.
## Description
Scriv detects Git repositories by searching recursively in one or more directories configured by the user, and returns a list of absolute paths to the discovered repositories.
A repository is defined here as a directory that contains a .git subdirectory.
Searching is done recursively, and with a depth specified on a per-path basis.
## Install
With Go:
```sh
go install github.com/joakimen/scriv@latest
```
## Usage
List repositories
```sh
$ scriv list
/Users/joakim/dev/github.com/joakimen/scriv
/Users/joakim/dev/github.com/joakimen/fzf.clj
...
```
Print resolved configuration
```sh
$ scriv config
{
"Paths": [
{
"Path": "~/dev/github.com",
"Depth": 2
},
{
"Path": "~/bin",
"Depth": 0
}
],
"Settings": {
"Ignore": [
"node_modules",
"vendor",
"dist",
"build",
"target"
]
},
"Logger": {}
}
```
## Configuration
Configuration is done by specifying one or more paths, along with their desired search depth.
### Example
```json
{
"paths": [
{ "path": "~/dev/github.com", "depth": 2 },
{ "path": "~/bin", "depth": 0 }
],
"settings": {
"ignore": ["node_modules", "target"]
}
}
```
### Configuration keys
#### `.paths[].path`
Required.
The root path under which to search for repos. The root path may itself be a repo.
#### `.paths[].depth`
Optional.
The search depth for the associated path.
Default: 0
Tune this according to your project layout, as this is the primary determining factor for the discovery performance.
##### Examples
###### Example 1: `~/dev/github.com + depth: 2`
- `~/dev/github.com/repo1` will be returned
- `~/dev/github.com/dir1/repo1` will be returned
- `~/dev/github.com/dir1/dir2/repo1` will **not** be returned
###### Example 2: `~/bin + depth: 0`
- `~/bin` will be returned
- `~/bin/repo1` will **not** be returned
#### `.settings.ignore`
Optional.
Paths to ignore during search.
Default: `"node_modules", "vendor", "dist", "build", "target"`