|
1 | | -<h1 align="center">codeinput</h1> |
2 | | -<div align="center"> |
3 | | - <strong> |
4 | | - codeinput CLI |
5 | | - </strong> |
6 | | -</div> |
7 | | -<br/> |
| 1 | +# codeinput (ci) |
8 | 2 |
|
9 | | -[](https://github.com/CodeInputCorp/cli/blob/master/LICENSE) |
10 | | -[](https://github.com/CodeInputCorp/cli/actions/workflows/tests.yml) |
11 | | -[](https://github.com/CodeInputCorp/cli/actions/workflows/build.yml) |
| 3 | +`codeinput` is a command-line interface (CLI) tool designed for managing and analyzing `CODEOWNERS` files and other source code related tasks. It helps developers understand code ownership, track changes, and maintain codebase health. |
12 | 4 |
|
13 | | -`codeinput` is a CLI for [codeinput](https://codeinput.com). |
| 5 | +## Installation |
14 | 6 |
|
15 | | -<!-- START doctoc generated TOC please keep comment here to allow auto update --> |
16 | | -<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> |
17 | | -**Table of Contents** |
| 7 | +1. Clone the repository: |
| 8 | + ```bash |
| 9 | + git clone https://github.com/CodeInputCorp/cli.git |
| 10 | + cd cli |
| 11 | + ``` |
| 12 | +2. Build the project: |
| 13 | + ```bash |
| 14 | + cargo build --release |
| 15 | + ``` |
| 16 | + The executable `ci` will be available in `target/release/`. You may want to add this directory to your system's PATH or copy the executable to a directory in your PATH (e.g., `~/.local/bin` or `/usr/local/bin`). |
18 | 17 |
|
19 | | -- [About](#about) |
20 | | -- [How to Contribute](#how-to-contribute) |
21 | | - - [Versioning](#versioning) |
22 | | -- [License](#license) |
| 18 | +Alternatively, if the project were published to crates.io, you could install it with: |
| 19 | +```bash |
| 20 | +# cargo install codeinput # Uncomment if published |
| 21 | +``` |
23 | 22 |
|
24 | | -<!-- END doctoc generated TOC please keep comment here to allow auto update --> |
| 23 | +## Usage |
25 | 24 |
|
26 | | -## About |
| 25 | +The `ci` tool provides several commands to interact with your codebase. Here are some of the main commands: |
27 | 26 |
|
28 | | -`codeinput` is a CLI for [codeinput](https://codeinput.com). |
| 27 | +### General Commands |
| 28 | +* `ci --help`: Display help information and a list of all commands. |
| 29 | +* `ci <command> --help`: Display help for a specific command. |
| 30 | +* `ci config`: Show the current configuration being used by the CLI. |
29 | 31 |
|
30 | | -## How to Contribute |
| 32 | +### CODEOWNERS Management |
| 33 | +The `codeowners` subcommand provides tools for working with `CODEOWNERS` files: |
| 34 | +* `ci codeowners parse [--path <DIR_PATH>] [--cache-file <FILE_PATH>] [--format <json|bincode>]`: Parses `CODEOWNERS` files in the specified directory (default: current) and builds an ownership map, optionally caching it. |
| 35 | +* `ci codeowners list-files [--path <DIR_PATH>] [--tags <TAGS>] [--owners <OWNERS>] [--unowned] [--show-all] [--format <text|json|bincode>] [--cache-file <FILE_PATH>]`: Lists files and their owners, with various filtering options. |
| 36 | +* `ci codeowners list-owners [--path <DIR_PATH>] [--format <text|json|bincode>] [--cache-file <FILE_PATH>]`: Displays aggregated owner statistics. |
| 37 | +* `ci codeowners list-tags [--path <DIR_PATH>] [--format <text|json|bincode>] [--cache-file <FILE_PATH>]`: Analyzes and shows tag usage within `CODEOWNERS` files. |
31 | 38 |
|
32 | | -Details on how to contribute can be found in the [CONTRIBUTING.md](.github/CONTRIBUTING.md) file. |
| 39 | +Example: |
| 40 | +```bash |
| 41 | +# Parse CODEOWNERS in the current directory and save to default cache |
| 42 | +ci codeowners parse |
33 | 43 |
|
34 | | -### Versioning |
| 44 | +# List all files owned by @username or team/name |
| 45 | +ci codeowners list-files --owners "@username,team/name" |
35 | 46 |
|
36 | | -codeinput adheres to the [SemVer](https://semver.org/) Semantic Versioning. |
| 47 | +# List unowned files in JSON format |
| 48 | +ci codeowners list-files --unowned --format json |
| 49 | +``` |
| 50 | + |
| 51 | +### Shell Completion |
| 52 | +You can generate shell completion scripts for `bash`, `zsh`, or `fish`: |
| 53 | +* `ci completion bash`: Generate bash completion script. |
| 54 | +* `ci completion zsh`: Generate zsh completion script. |
| 55 | +* `ci completion fish`: Generate fish completion script. |
| 56 | + |
| 57 | +Example for bash: |
| 58 | +```bash |
| 59 | +ci completion bash > /etc/bash_completion.d/ci |
| 60 | +# or source it in your .bashrc |
| 61 | +# echo "source <(ci completion bash)" >> ~/.bashrc |
| 62 | +``` |
| 63 | + |
| 64 | +### Global Options |
| 65 | +* `--config <FILE>`: Use a custom configuration file. |
| 66 | +* `--log-level <LEVEL>`: Set the logging level (e.g., `debug`, `info`, `warn`, `error`). |
| 67 | +* `--debug`: Enable debug mode (provides more verbose output). |
| 68 | + |
| 69 | + |
| 70 | +## Contributing |
| 71 | + |
| 72 | +We welcome contributions! Please see our [Contributing Guidelines](.github/CONTRIBUTING.md) for more details on how to get involved. |
37 | 73 |
|
38 | 74 | ## License |
39 | 75 |
|
40 | | -`codeinput` is licensed under the MIT license. Please read the [LICENSE](LICENSE) file in this repository for more information. |
| 76 | +This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. |
0 commit comments