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.
Table of Contents
- Advanced Parsing: Parse CODEOWNERS files recursively across directory structures
- Ownership Analysis: Analyze file ownership patterns and generate detailed reports
- Tag Support: Organize and query files using custom tags in CODEOWNERS
- High Performance: Efficient caching and parallel processing for large repositories
- Flexible Filtering: Filter files by owners, tags, or ownership status
- Multiple Output Formats: Support for text, JSON, and binary output formats
Latest Release: 0.0.1-beta
- Linux x86_64: Download
- Linux ARM64: Download
- Windows x86_64: Download
- macOS Intel: Download
- macOS Apple Silicon: Download
- Download the appropriate binary for your platform
- Rename the downloaded file to
ci
(Linux/macOS) orci.exe
(Windows) - Move the binary to your PATH:
mv ci /usr/local/bin/
(Linux/macOS) - Make it executable:
chmod +x /usr/local/bin/ci
(Linux/macOS)
codeinput - 0.0.1-beta
You can install the CLI using Cargo. Rust Toolchain required.
cargo install ci
git clone https://github.com/CodeInputCorp/cli.git
cd cli
cargo build --release --bin ci
sudo cp target/release/ci /usr/local/bin/
-
Parse your CODEOWNERS files to build the cache:
ci codeowners parse
-
List all files with their owners:
ci codeowners list-files
-
Find files owned by a specific team:
ci codeowners list-files --owners @frontend-team
-
Inspect ownership of a specific file:
ci codeowners inspect src/main.rs
Build a cache of parsed CODEOWNERS files for fast querying:
ci codeowners parse [PATH] [OPTIONS]
Options:
--cache-file <FILE>
: Custom cache file location (default:.codeowners.cache
)--format <FORMAT>
: Cache format -bincode
orjson
(default:bincode
)
Examples:
# Parse current directory
ci codeowners parse
# Parse specific directory with JSON cache
ci codeowners parse ./my-repo --format json
# Use custom cache location
ci codeowners parse --cache-file .custom-cache
Find and list files with their owners based on filter criteria:
ci codeowners list-files [PATH] [OPTIONS]
Options:
--tags <LIST>
: Filter by tags (comma-separated)--owners <LIST>
: Filter by owners (comma-separated)--unowned
: Show only unowned files--show-all
: Show all files including unowned/untagged--format <FORMAT>
: Output format -text
,json
, orbincode
Examples:
# List all owned files
ci codeowners list-files
# Find files with specific tags
ci codeowners list-files --tags security critical
# Find files owned by multiple teams
ci codeowners list-files --owners @backend-team @devops
# Show unowned files
ci codeowners list-files --unowned
# Output as JSON
ci codeowners list-files --format json
Display aggregated owner statistics and file associations:
ci codeowners list-owners [PATH] [OPTIONS]
Options:
--format <FORMAT>
: Output format -text
,json
, orbincode
Examples:
# Show all owners with file counts
ci codeowners list-owners
# Get owner data as JSON
ci codeowners list-owners --format json
Analyze tag usage across CODEOWNERS files:
ci codeowners list-tags [PATH] [OPTIONS]
Options:
--format <FORMAT>
: Output format -text
,json
, orbincode
Examples:
# Show all tags with usage statistics
ci codeowners list-tags
# Export tag data as JSON
ci codeowners list-tags --format json
Get detailed ownership and tag information for a specific file:
ci codeowners inspect <FILE_PATH> [OPTIONS]
Options:
--repo <PATH>
: Repository path (default: current directory)--format <FORMAT>
: Output format -text
,json
, orbincode
Examples:
# Inspect a specific file
ci codeowners inspect src/main.rs
# Inspect with different repo path
ci codeowners inspect src/main.rs --repo /path/to/repo
# Get inspection data as JSON
ci codeowners inspect src/main.rs --format json
View current configuration settings:
ci config
Generate shell completion scripts:
# For bash
ci completion bash > /etc/bash_completion.d/codeinput
# For zsh
ci completion zsh > ~/.zsh/completions/_codeinput
# For fish
ci completion fish > ~/.config/fish/completions/codeinput.fish
The tool supports two approaches for defining code ownership:
Standard CODEOWNERS syntax with additional tag support:
# Standard ownership
*.rs @rust-team
/docs/ @documentation-team
# With tags for categorization
*.security.rs @security-team #security #critical
/api/ @backend-team #api #core
# Multiple owners and tags
*.config @devops @security-team #config #infrastructure #security
# Special patterns
* @default-team #general
Pattern Matching Rules:
/path/to/dir/
- Matches all files and subdirectories recursively (GitHub compatible)/path/to/dir/*
- Matches direct files in the directory only/path/to/dir/**
- Matches all files and subdirectories recursively (explicit)*.ext
- Matches files with specific extensionpattern
- Relative path matching
Priority Rules:
- Closest CODEOWNERS file: Files in subdirectories take precedence over parent directories
- Last match wins: Later entries in the same CODEOWNERS file override earlier ones
- Inline declarations: Per-file inline ownership
For fine-grained control, declare ownership directly within individual files using the !!!CODEOWNERS
marker:
Rust Example:
// !!!CODEOWNERS @security-team @alice #security #critical
use std::crypto;
fn encrypt_data() {
// sensitive crypto code
}
JavaScript/TypeScript Example:
// !!!CODEOWNERS @frontend-team #ui #components
export const Button = () => {
return <button>Click me</button>;
};
HTML Example:
<!-- !!!CODEOWNERS @design-team #ui #templates -->
<div class="hero-section">
<h1>Welcome</h1>
</div>
CSS Example:
/* !!!CODEOWNERS @design-team #styles #branding */
.brand-colors {
--primary: #007bff;
--secondary: #6c757d;
}
Inline Format Rules:
- Must appear within the first 50 lines of the file
- Can be used in any comment style (
//
,#
,/**/
,<!-- -->
) - Takes highest priority over all CODEOWNERS file patterns
- Supports same owner and tag syntax as CODEOWNERS files
- Only one inline declaration per file (first one found is used)
Supported Owner Types:
- Users:
@username
- Teams:
@org/team-name
- Email:
user@example.com
Tag Format:
- Tags start with
#
and appear after owners - Multiple tags are supported:
#tag1 #tag2 #tag3
- Tags can contain letters, numbers, hyphens, and underscores
- Comments after tags are ignored (e.g.,
#tag1 # this is a comment
)
We welcome contributions! Please see our Contributing Guide for details.
This project is licensed under the MIT License - see the LICENSE file for details.