|
1 | | -<h1 align="center">codeinput</h1> |
| 1 | +<h1 align="center">Code Input CLI</h1> |
2 | 2 | <div align="center"> |
3 | 3 | <strong> |
4 | | - codeinput CLI |
| 4 | + Advanced CODEOWNERS file management and analysis toolkit |
5 | 5 | </strong> |
6 | 6 | </div> |
7 | 7 | <br/> |
|
10 | 10 | [](https://github.com/CodeInputCorp/cli/actions/workflows/tests.yml) |
11 | 11 | [](https://github.com/CodeInputCorp/cli/actions/workflows/build.yml) |
12 | 12 |
|
13 | | -`codeinput` is a CLI for [codeinput](https://codeinput.com). |
| 13 | +`codeinput` is a powerful CLI tool for parsing, analyzing, and managing CODEOWNERS files across your repositories. It provides advanced querying capabilities, ownership analysis, and tag-based file organization. |
14 | 14 |
|
15 | 15 | <!-- START doctoc generated TOC please keep comment here to allow auto update --> |
16 | 16 | <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> |
17 | | -**Table of Contents** |
18 | 17 |
|
19 | | -- [About](#about) |
20 | | -- [How to Contribute](#how-to-contribute) |
21 | | - - [Versioning](#versioning) |
22 | | -- [License](#license) |
23 | 18 |
|
24 | 19 | <!-- END doctoc generated TOC please keep comment here to allow auto update --> |
25 | 20 |
|
26 | | -## About |
| 21 | +## Features |
27 | 22 |
|
28 | | -`codeinput` is a CLI for [codeinput](https://codeinput.com). |
| 23 | +### CodeOwners |
| 24 | +- **Advanced Parsing**: Parse CODEOWNERS files recursively across directory structures |
| 25 | +- **Ownership Analysis**: Analyze file ownership patterns and generate detailed reports |
| 26 | +- **Tag Support**: Organize and query files using custom tags in CODEOWNERS |
| 27 | +- **High Performance**: Efficient caching and parallel processing for large repositories |
| 28 | +- **Flexible Filtering**: Filter files by owners, tags, or ownership status |
| 29 | +- **Multiple Output Formats**: Support for text, JSON, and binary output formats |
29 | 30 |
|
30 | | -## How to Contribute |
| 31 | +## Installation |
| 32 | + |
| 33 | +### From Release |
| 34 | +Binaries coming soon... |
| 35 | + |
| 36 | +### From Cargo |
| 37 | + |
| 38 | +You can install the CLI using Cargo. Rust Toolchain required. |
| 39 | + |
| 40 | +```bash |
| 41 | +cargo install ci |
| 42 | +``` |
| 43 | + |
| 44 | +### From Source |
| 45 | +```bash |
| 46 | +git clone https://github.com/CodeInputCorp/cli.git |
| 47 | +cd cli |
| 48 | +cargo build --release --bin ci |
| 49 | +sudo cp target/release/ci /usr/local/bin/ |
| 50 | +``` |
| 51 | + |
| 52 | +## Quick Start |
| 53 | + |
| 54 | +1. **Parse your CODEOWNERS files** to build the cache: |
| 55 | + ```bash |
| 56 | + ci codeowners parse |
| 57 | + ``` |
| 58 | + |
| 59 | +2. **List all files with their owners**: |
| 60 | + ```bash |
| 61 | + ci codeowners list-files |
| 62 | + ``` |
| 63 | + |
| 64 | +3. **Find files owned by a specific team**: |
| 65 | + ```bash |
| 66 | + ci codeowners list-files --owners @frontend-team |
| 67 | + ``` |
| 68 | + |
| 69 | +4. **Inspect ownership of a specific file**: |
| 70 | + ```bash |
| 71 | + ci codeowners inspect src/main.rs |
| 72 | + ``` |
| 73 | + |
| 74 | +## Commands |
| 75 | + |
| 76 | +### CodeOwners |
| 77 | + |
| 78 | +#### Parse CODEOWNERS |
| 79 | + |
| 80 | +Build a cache of parsed CODEOWNERS files for fast querying: |
| 81 | + |
| 82 | +```bash |
| 83 | +ci codeowners parse [PATH] [OPTIONS] |
| 84 | +``` |
| 85 | + |
| 86 | +**Options:** |
| 87 | +- `--cache-file <FILE>`: Custom cache file location (default: `.codeowners.cache`) |
| 88 | +- `--format <FORMAT>`: Cache format - `bincode` or `json` (default: `bincode`) |
| 89 | + |
| 90 | +**Examples:** |
| 91 | +```bash |
| 92 | +# Parse current directory |
| 93 | +ci codeowners parse |
| 94 | + |
| 95 | +# Parse specific directory with JSON cache |
| 96 | +ci codeowners parse ./my-repo --format json |
| 97 | + |
| 98 | +# Use custom cache location |
| 99 | +ci codeowners parse --cache-file .custom-cache |
| 100 | +``` |
| 101 | + |
| 102 | +### List Files |
| 103 | + |
| 104 | +Find and list files with their owners based on filter criteria: |
| 105 | + |
| 106 | +```bash |
| 107 | +ci codeowners list-files [PATH] [OPTIONS] |
| 108 | +``` |
| 109 | + |
| 110 | +**Options:** |
| 111 | +- `--tags <LIST>`: Filter by tags (comma-separated) |
| 112 | +- `--owners <LIST>`: Filter by owners (comma-separated) |
| 113 | +- `--unowned`: Show only unowned files |
| 114 | +- `--show-all`: Show all files including unowned/untagged |
| 115 | +- `--format <FORMAT>`: Output format - `text`, `json`, or `bincode` |
| 116 | + |
| 117 | +**Examples:** |
| 118 | +```bash |
| 119 | +# List all owned files |
| 120 | +ci codeowners list-files |
| 121 | + |
| 122 | +# Find files with specific tags |
| 123 | +ci codeowners list-files --tags security critical |
| 124 | + |
| 125 | +# Find files owned by multiple teams |
| 126 | +ci codeowners list-files --owners @backend-team @devops |
| 127 | + |
| 128 | +# Show unowned files |
| 129 | +ci codeowners list-files --unowned |
| 130 | + |
| 131 | +# Output as JSON |
| 132 | +ci codeowners list-files --format json |
| 133 | +``` |
| 134 | + |
| 135 | +### List Owners |
| 136 | + |
| 137 | +Display aggregated owner statistics and file associations: |
| 138 | + |
| 139 | +```bash |
| 140 | +ci codeowners list-owners [PATH] [OPTIONS] |
| 141 | +``` |
31 | 142 |
|
32 | | -Details on how to contribute can be found in the [CONTRIBUTING.md](.github/CONTRIBUTING.md) file. |
| 143 | +**Options:** |
| 144 | +- `--format <FORMAT>`: Output format - `text`, `json`, or `bincode` |
33 | 145 |
|
34 | | -### Versioning |
| 146 | +**Examples:** |
| 147 | +```bash |
| 148 | +# Show all owners with file counts |
| 149 | +ci codeowners list-owners |
| 150 | + |
| 151 | +# Get owner data as JSON |
| 152 | +ci codeowners list-owners --format json |
| 153 | +``` |
| 154 | + |
| 155 | +### List Tags |
| 156 | + |
| 157 | +Analyze tag usage across CODEOWNERS files: |
| 158 | + |
| 159 | +```bash |
| 160 | +ci codeowners list-tags [PATH] [OPTIONS] |
| 161 | +``` |
| 162 | + |
| 163 | +**Options:** |
| 164 | +- `--format <FORMAT>`: Output format - `text`, `json`, or `bincode` |
| 165 | + |
| 166 | +**Examples:** |
| 167 | +```bash |
| 168 | +# Show all tags with usage statistics |
| 169 | +ci codeowners list-tags |
| 170 | + |
| 171 | +# Export tag data as JSON |
| 172 | +ci codeowners list-tags --format json |
| 173 | +``` |
| 174 | + |
| 175 | +### Inspect Files |
| 176 | + |
| 177 | +Get detailed ownership and tag information for a specific file: |
| 178 | + |
| 179 | +```bash |
| 180 | +ci codeowners inspect <FILE_PATH> [OPTIONS] |
| 181 | +``` |
| 182 | + |
| 183 | +**Options:** |
| 184 | +- `--repo <PATH>`: Repository path (default: current directory) |
| 185 | +- `--format <FORMAT>`: Output format - `text`, `json`, or `bincode` |
| 186 | + |
| 187 | +**Examples:** |
| 188 | +```bash |
| 189 | +# Inspect a specific file |
| 190 | +ci codeowners inspect src/main.rs |
| 191 | + |
| 192 | +# Inspect with different repo path |
| 193 | +ci codeowners inspect src/main.rs --repo /path/to/repo |
| 194 | + |
| 195 | +# Get inspection data as JSON |
| 196 | +ci codeowners inspect src/main.rs --format json |
| 197 | +``` |
| 198 | + |
| 199 | +### Configuration |
| 200 | + |
| 201 | +View current configuration settings: |
| 202 | + |
| 203 | +```bash |
| 204 | +ci config |
| 205 | +``` |
| 206 | + |
| 207 | +### Shell Completion |
| 208 | + |
| 209 | +Generate shell completion scripts: |
| 210 | + |
| 211 | +```bash |
| 212 | +# For bash |
| 213 | +ci completion bash > /etc/bash_completion.d/codeinput |
| 214 | + |
| 215 | +# For zsh |
| 216 | +ci completion zsh > ~/.zsh/completions/_codeinput |
| 217 | + |
| 218 | +# For fish |
| 219 | +ci completion fish > ~/.config/fish/completions/codeinput.fish |
| 220 | +``` |
| 221 | + |
| 222 | +## CODEOWNERS Format |
| 223 | + |
| 224 | +The tool supports standard CODEOWNERS syntax with additional tag support: |
| 225 | + |
| 226 | +``` |
| 227 | +# Standard ownership |
| 228 | +*.rs @rust-team |
| 229 | +/docs/ @documentation-team |
| 230 | +
|
| 231 | +# With tags for categorization |
| 232 | +*.security.rs @security-team #security #critical |
| 233 | +/api/ @backend-team #api #core |
| 234 | +
|
| 235 | +# Multiple owners and tags |
| 236 | +*.config @devops @security-team #config #infrastructure #security |
| 237 | +
|
| 238 | +# Special patterns |
| 239 | +* @default-team #general |
| 240 | +``` |
| 241 | + |
| 242 | +**Supported Owner Types:** |
| 243 | +- **Users**: `@username` |
| 244 | +- **Teams**: `@org/team-name` |
| 245 | +- **Email**: `user@example.com` |
| 246 | +- **Unowned**: `NOOWNER` (case-insensitive) |
| 247 | + |
| 248 | +**Tag Format:** |
| 249 | +- Tags start with `#` and appear after owners |
| 250 | +- Multiple tags are supported: `#tag1 #tag2 #tag3` |
| 251 | +- Tags can contain letters, numbers, hyphens, and underscores |
| 252 | + |
| 253 | +## How to Contribute |
35 | 254 |
|
36 | | -codeinput adheres to the [SemVer](https://semver.org/) Semantic Versioning. |
| 255 | +We welcome contributions! Please see our [Contributing Guide](.github/CONTRIBUTING.md) for details. |
37 | 256 |
|
38 | 257 | ## License |
39 | 258 |
|
40 | | -`codeinput` is licensed under the MIT license. Please read the [LICENSE](LICENSE) file in this repository for more information. |
| 259 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
0 commit comments