Skip to content

Commit dfe5a3c

Browse files
GautamKumarOfficalGautam Kumar
andauthored
fix: add Long descriptions and fix stale command name in docs examples (#47)
* feat: add detailed help text to CLI commands Adds Long descriptions to root, scan, and text commands providing usage examples and detailed explanations of what each command does. Closes #46 Signed-off-by: Gautam Kumar <gautamkumarofficial@users.noreply.github.com> * docs: add usage examples to scan, text, version commands and fix stale name Signed-off-by: Gautam Kumar <gautamkumarofficial@users.noreply.github.com> --------- Signed-off-by: Gautam Kumar <gautamkumarofficial@users.noreply.github.com> Co-authored-by: Gautam Kumar <gautamkumarofficial@users.noreply.github.com>
1 parent fa48015 commit dfe5a3c

1 file changed

Lines changed: 78 additions & 4 deletions

File tree

cmd/cmd.go

Lines changed: 78 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,18 @@ func Run(args []string, stdout, stderr io.Writer) int {
4545
rootCmd := &cobra.Command{
4646
Use: "disclosure",
4747
Short: "Detect AI-generated contributions",
48+
Long: `Disclosure is a standalone CLI tool that detects AI-generated contributions
49+
in git repositories. It works entirely from git-level data (commit emails,
50+
messages, trailers) with no platform API dependencies.
51+
52+
The tool detects when AI tools are disclosed in contributions — not whether
53+
AI was actually used. It checks for known AI bot emails, Co-Authored-By
54+
trailers, git-ai notes, and tool name mentions in commit messages and text.
55+
56+
Exit codes:
57+
0 No AI detected
58+
1 AI detected
59+
2 Error`,
4860
SilenceUsage: true,
4961
SilenceErrors: true,
5062
}
@@ -75,7 +87,38 @@ func scanCommand(stdout, stderr io.Writer, exitCode *int) *cobra.Command {
7587
cmd := &cobra.Command{
7688
Use: "scan [repo-path]",
7789
Short: "Scan commits for AI signals",
78-
Args: cobra.MaximumNArgs(1),
90+
Long: `Scan commits in a git repository for signals of AI tool usage.
91+
92+
Checks each commit for:
93+
- Known AI bot committer emails (Claude, Copilot, Cursor, etc.)
94+
- Co-Authored-By trailers with AI tool emails
95+
- git-ai authorship logs in git notes
96+
- AI session ID trailers
97+
- Commit message patterns (aider:, Generated with Claude Code, etc.)
98+
- Tool name mentions in commit messages
99+
100+
Examples:
101+
disclosure scan
102+
disclosure scan --range=abc123..def456 --format=json
103+
disclosure scan --min-confidence=high /path/to/repo
104+
disclosure scan --range=$BASE..HEAD --min-confidence=medium`,
105+
Example: ` # Scan current directory
106+
disclosure scan
107+
108+
# Scan a specific commit range with JSON output
109+
disclosure scan --range=abc123..def456 --format=json
110+
111+
# Only show high-confidence findings
112+
disclosure scan --min-confidence=high /path/to/repo
113+
114+
# Scan and use in CI pipeline
115+
if disclosure scan --range=$BASE..HEAD --min-confidence=medium; then
116+
echo "No AI detected"
117+
else
118+
echo "AI involvement detected"
119+
exit 1
120+
fi`,
121+
Args: cobra.MaximumNArgs(1),
79122
RunE: func(_ *cobra.Command, args []string) error {
80123
repoPath := "."
81124
if len(args) > 0 {
@@ -140,6 +183,30 @@ func textCommand(stdout, stderr io.Writer, exitCode *int) *cobra.Command {
140183
cmd := &cobra.Command{
141184
Use: "text",
142185
Short: "Scan text input for AI signals",
186+
Long: `Scan arbitrary text for AI tool name mentions and signals.
187+
188+
Useful for scanning PR descriptions, issue comments, or any text input
189+
for mentions of AI tools like Claude, Copilot, Cursor, ChatGPT, etc.
190+
191+
The text scanner uses word-boundary matching to find tool names and
192+
is the primary detector for non-commit text analysis.
193+
194+
Examples:
195+
echo "I used Claude to write this" | disclosure text --format=json
196+
disclosure text --input=pr-body.txt
197+
cat comment.txt | disclosure text --min-confidence=medium
198+
disclosure text --input=review.txt --format=json | jq '.findings'`,
199+
Example: ` # Scan text from stdin
200+
echo "I used Claude to write this" | disclosure text --format=json
201+
202+
# Scan a file
203+
disclosure text --input=pr-body.txt
204+
205+
# Scan with medium confidence threshold
206+
cat comment.txt | disclosure text --min-confidence=medium
207+
208+
# Use in a pipeline
209+
disclosure text --input=review.txt --format=json | jq '.findings'`,
143210
RunE: func(_ *cobra.Command, args []string) error {
144211
var textBytes []byte
145212
var err error
@@ -195,6 +262,13 @@ func versionCommand(stdout io.Writer, exitCode *int) *cobra.Command {
195262
return &cobra.Command{
196263
Use: "version",
197264
Short: "Print version",
265+
Long: `Print the disclosure version information.
266+
267+
Examples:
268+
disclosure version
269+
disclosure version --format=json`,
270+
Example: ` disclosure version
271+
disclosure version --format=json`,
198272
Run: func(_ *cobra.Command, _ []string) {
199273
fmt.Fprintf(stdout, "disclosure %s\n", Version)
200274
*exitCode = ExitNoAI
@@ -249,13 +323,13 @@ func generateDocs(exitCode *int) *cobra.Command {
249323
Use: "docs",
250324
Short: fmt.Sprintf("Build docs in %s formats", strings.Join(supportedFormats, ", ")),
251325
Example: fmt.Sprintf(` # simply build markdown docs at default output dir (%s)
252-
ai-detection-action docs
326+
disclosure docs
253327
254328
# build rest docs at default output dir
255-
ai-detection-action docs --format rest
329+
disclosure docs --format rest
256330
257331
# build manpages docs at a specific 'documentation' dir
258-
ai-detection-action docs --format manpages --out %s`, defaultOutputDir, exampleCustomDir),
332+
disclosure docs --format manpages --out %s`, defaultOutputDir, exampleCustomDir),
259333
Args: cobra.MaximumNArgs(0),
260334
RunE: func(cmd *cobra.Command, args []string) error {
261335
prepareError := func(err error) error {

0 commit comments

Comments
 (0)