Skip to content

Commit d052aa6

Browse files
committed
feat(glab): add ci and release subcommand filtering
Add token-optimized filtering for two more glab subcommand groups: CI/CD pipelines: - `glab ci list`: Compact pipeline listing with status icons (~90% savings) - `glab ci trace`: Strip ANSI codes, section markers, runner boilerplate, git fetch noise, and artifact upload details. Keep commands, build output, warnings, errors, and job result. Releases: - `glab release list`: Passthrough (already compact text output) - `glab release view`: Strip SOURCES block (archive URLs are noise), filter markdown noise (HTML comments, images, horizontal rules) Also: - Add lazy_static regex for CI section markers and bare ANSI codes - Update discover rules pattern and savings estimates - Add test fixtures and unit tests for all new filters
1 parent 2af7033 commit d052aa6

6 files changed

Lines changed: 704 additions & 3 deletions

File tree

src/discover/rules.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub struct RtkRule {
1515
pub const PATTERNS: &[&str] = &[
1616
r"^git\s+(?:-[Cc]\s+\S+\s+)*(status|log|diff|show|add|commit|push|pull|branch|fetch|stash|worktree)",
1717
r"^gh\s+(pr|issue|run|repo|api|release)",
18-
r"^glab\s+(mr|issue|api|pipeline|release|repo)",
18+
r"^glab\s+(mr|issue|ci|release|api|pipeline|repo)",
1919
r"^cargo\s+(build|test|clippy|check|fmt|install)",
2020
r"^pnpm\s+(list|ls|outdated|install)",
2121
r"^npm\s+(run|exec)",
@@ -116,7 +116,12 @@ pub const RULES: &[RtkRule] = &[
116116
rewrite_prefixes: &["glab"],
117117
category: "GitLab",
118118
savings_pct: 82.0,
119-
subcmd_savings: &[("mr", 85.0), ("issue", 80.0)],
119+
subcmd_savings: &[
120+
("mr", 85.0),
121+
("issue", 80.0),
122+
("ci", 80.0),
123+
("release", 40.0),
124+
],
120125
subcmd_status: &[],
121126
},
122127
RtkRule {

0 commit comments

Comments
 (0)