aidevops 2.52.1 → 2.53.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (334) hide show
  1. package/README.md +1 -1
  2. package/VERSION +1 -1
  3. package/aidevops.sh +15 -9
  4. package/package.json +4 -4
  5. package/scripts/npm-postinstall.js +6 -7
  6. package/setup.sh +1 -1
  7. package/templates/deploy-templates.sh +144 -0
  8. package/templates/home/.agent/README.md +33 -0
  9. package/templates/home/AGENTS.md +96 -0
  10. package/templates/home/git/.agent/README.md +48 -0
  11. package/templates/home/git/AGENTS.md +97 -0
  12. package/templates/standard-functions.sh +179 -0
  13. package/templates/wordpress-performance-workflow.md +217 -0
  14. package/.agent/AGENTS.md +0 -614
  15. package/.agent/accounts.md +0 -65
  16. package/.agent/aidevops/add-new-mcp-to-aidevops.md +0 -456
  17. package/.agent/aidevops/api-integrations.md +0 -335
  18. package/.agent/aidevops/architecture.md +0 -510
  19. package/.agent/aidevops/configs.md +0 -274
  20. package/.agent/aidevops/docs.md +0 -244
  21. package/.agent/aidevops/extension.md +0 -311
  22. package/.agent/aidevops/mcp-integrations.md +0 -340
  23. package/.agent/aidevops/mcp-troubleshooting.md +0 -162
  24. package/.agent/aidevops/memory-patterns.md +0 -172
  25. package/.agent/aidevops/providers.md +0 -217
  26. package/.agent/aidevops/recommendations.md +0 -321
  27. package/.agent/aidevops/requirements.md +0 -301
  28. package/.agent/aidevops/resources.md +0 -214
  29. package/.agent/aidevops/security-requirements.md +0 -174
  30. package/.agent/aidevops/security.md +0 -350
  31. package/.agent/aidevops/service-links.md +0 -400
  32. package/.agent/aidevops/services.md +0 -357
  33. package/.agent/aidevops/setup.md +0 -153
  34. package/.agent/aidevops/troubleshooting.md +0 -389
  35. package/.agent/aidevops.md +0 -124
  36. package/.agent/build-plus.md +0 -244
  37. package/.agent/content/guidelines.md +0 -109
  38. package/.agent/content.md +0 -87
  39. package/.agent/health.md +0 -59
  40. package/.agent/legal.md +0 -59
  41. package/.agent/loop-state/full-loop.local.md +0 -16
  42. package/.agent/loop-state/ralph-loop.local.md +0 -10
  43. package/.agent/marketing.md +0 -440
  44. package/.agent/memory/README.md +0 -260
  45. package/.agent/onboarding.md +0 -796
  46. package/.agent/plan-plus.md +0 -245
  47. package/.agent/research.md +0 -100
  48. package/.agent/sales.md +0 -333
  49. package/.agent/scripts/101domains-helper.sh +0 -701
  50. package/.agent/scripts/add-missing-returns.sh +0 -140
  51. package/.agent/scripts/agent-browser-helper.sh +0 -311
  52. package/.agent/scripts/agno-setup.sh +0 -712
  53. package/.agent/scripts/ahrefs-mcp-wrapper.js +0 -168
  54. package/.agent/scripts/aidevops-update-check.sh +0 -71
  55. package/.agent/scripts/ampcode-cli.sh +0 -522
  56. package/.agent/scripts/auto-version-bump.sh +0 -156
  57. package/.agent/scripts/autogen-helper.sh +0 -512
  58. package/.agent/scripts/beads-sync-helper.sh +0 -596
  59. package/.agent/scripts/closte-helper.sh +0 -5
  60. package/.agent/scripts/cloudron-helper.sh +0 -321
  61. package/.agent/scripts/codacy-cli-chunked.sh +0 -581
  62. package/.agent/scripts/codacy-cli.sh +0 -442
  63. package/.agent/scripts/code-audit-helper.sh +0 -5
  64. package/.agent/scripts/coderabbit-cli.sh +0 -417
  65. package/.agent/scripts/coderabbit-pro-analysis.sh +0 -238
  66. package/.agent/scripts/commands/code-simplifier.md +0 -86
  67. package/.agent/scripts/commands/full-loop.md +0 -246
  68. package/.agent/scripts/commands/postflight-loop.md +0 -103
  69. package/.agent/scripts/commands/recall.md +0 -182
  70. package/.agent/scripts/commands/remember.md +0 -132
  71. package/.agent/scripts/commands/save-todo.md +0 -175
  72. package/.agent/scripts/commands/session-review.md +0 -154
  73. package/.agent/scripts/comprehensive-quality-fix.sh +0 -106
  74. package/.agent/scripts/context-builder-helper.sh +0 -522
  75. package/.agent/scripts/coolify-cli-helper.sh +0 -674
  76. package/.agent/scripts/coolify-helper.sh +0 -380
  77. package/.agent/scripts/crawl4ai-examples.sh +0 -401
  78. package/.agent/scripts/crawl4ai-helper.sh +0 -1078
  79. package/.agent/scripts/crewai-helper.sh +0 -681
  80. package/.agent/scripts/dev-browser-helper.sh +0 -513
  81. package/.agent/scripts/dns-helper.sh +0 -396
  82. package/.agent/scripts/domain-research-helper.sh +0 -917
  83. package/.agent/scripts/dspy-helper.sh +0 -285
  84. package/.agent/scripts/dspyground-helper.sh +0 -291
  85. package/.agent/scripts/eeat-score-helper.sh +0 -1242
  86. package/.agent/scripts/efficient-return-fix.sh +0 -92
  87. package/.agent/scripts/extract-opencode-prompts.sh +0 -128
  88. package/.agent/scripts/find-missing-returns.sh +0 -113
  89. package/.agent/scripts/fix-auth-headers.sh +0 -104
  90. package/.agent/scripts/fix-common-strings.sh +0 -254
  91. package/.agent/scripts/fix-content-type.sh +0 -100
  92. package/.agent/scripts/fix-error-messages.sh +0 -130
  93. package/.agent/scripts/fix-misplaced-returns.sh +0 -74
  94. package/.agent/scripts/fix-remaining-literals.sh +0 -152
  95. package/.agent/scripts/fix-return-statements.sh +0 -41
  96. package/.agent/scripts/fix-s131-default-cases.sh +0 -249
  97. package/.agent/scripts/fix-sc2155-simple.sh +0 -102
  98. package/.agent/scripts/fix-shellcheck-critical.sh +0 -187
  99. package/.agent/scripts/fix-string-literals.sh +0 -273
  100. package/.agent/scripts/full-loop-helper.sh +0 -773
  101. package/.agent/scripts/generate-opencode-agents.sh +0 -497
  102. package/.agent/scripts/generate-opencode-commands.sh +0 -1629
  103. package/.agent/scripts/generate-skills.sh +0 -366
  104. package/.agent/scripts/git-platforms-helper.sh +0 -640
  105. package/.agent/scripts/gitea-cli-helper.sh +0 -743
  106. package/.agent/scripts/github-cli-helper.sh +0 -702
  107. package/.agent/scripts/gitlab-cli-helper.sh +0 -682
  108. package/.agent/scripts/gsc-add-user-helper.sh +0 -325
  109. package/.agent/scripts/gsc-sitemap-helper.sh +0 -678
  110. package/.agent/scripts/hetzner-helper.sh +0 -485
  111. package/.agent/scripts/hostinger-helper.sh +0 -229
  112. package/.agent/scripts/keyword-research-helper.sh +0 -1815
  113. package/.agent/scripts/langflow-helper.sh +0 -544
  114. package/.agent/scripts/linkedin-automation.py +0 -241
  115. package/.agent/scripts/linter-manager.sh +0 -599
  116. package/.agent/scripts/linters-local.sh +0 -434
  117. package/.agent/scripts/list-keys-helper.sh +0 -488
  118. package/.agent/scripts/local-browser-automation.py +0 -339
  119. package/.agent/scripts/localhost-helper.sh +0 -744
  120. package/.agent/scripts/loop-common.sh +0 -806
  121. package/.agent/scripts/mainwp-helper.sh +0 -728
  122. package/.agent/scripts/markdown-formatter.sh +0 -338
  123. package/.agent/scripts/markdown-lint-fix.sh +0 -311
  124. package/.agent/scripts/mass-fix-returns.sh +0 -58
  125. package/.agent/scripts/mcp-diagnose.sh +0 -167
  126. package/.agent/scripts/mcp-inspector-helper.sh +0 -449
  127. package/.agent/scripts/memory-helper.sh +0 -650
  128. package/.agent/scripts/monitor-code-review.sh +0 -255
  129. package/.agent/scripts/onboarding-helper.sh +0 -706
  130. package/.agent/scripts/opencode-github-setup-helper.sh +0 -797
  131. package/.agent/scripts/opencode-test-helper.sh +0 -213
  132. package/.agent/scripts/pagespeed-helper.sh +0 -464
  133. package/.agent/scripts/pandoc-helper.sh +0 -362
  134. package/.agent/scripts/postflight-check.sh +0 -555
  135. package/.agent/scripts/pre-commit-hook.sh +0 -259
  136. package/.agent/scripts/pre-edit-check.sh +0 -169
  137. package/.agent/scripts/qlty-cli.sh +0 -356
  138. package/.agent/scripts/quality-cli-manager.sh +0 -525
  139. package/.agent/scripts/quality-feedback-helper.sh +0 -462
  140. package/.agent/scripts/quality-fix.sh +0 -263
  141. package/.agent/scripts/quality-loop-helper.sh +0 -1108
  142. package/.agent/scripts/ralph-loop-helper.sh +0 -836
  143. package/.agent/scripts/ralph-upstream-check.sh +0 -341
  144. package/.agent/scripts/secretlint-helper.sh +0 -847
  145. package/.agent/scripts/servers-helper.sh +0 -241
  146. package/.agent/scripts/ses-helper.sh +0 -619
  147. package/.agent/scripts/session-review-helper.sh +0 -404
  148. package/.agent/scripts/setup-linters-wizard.sh +0 -379
  149. package/.agent/scripts/setup-local-api-keys.sh +0 -330
  150. package/.agent/scripts/setup-mcp-integrations.sh +0 -472
  151. package/.agent/scripts/shared-constants.sh +0 -246
  152. package/.agent/scripts/site-crawler-helper.sh +0 -1487
  153. package/.agent/scripts/snyk-helper.sh +0 -940
  154. package/.agent/scripts/sonarcloud-autofix.sh +0 -193
  155. package/.agent/scripts/sonarcloud-cli.sh +0 -191
  156. package/.agent/scripts/sonarscanner-cli.sh +0 -455
  157. package/.agent/scripts/spaceship-helper.sh +0 -747
  158. package/.agent/scripts/stagehand-helper.sh +0 -321
  159. package/.agent/scripts/stagehand-python-helper.sh +0 -321
  160. package/.agent/scripts/stagehand-python-setup.sh +0 -441
  161. package/.agent/scripts/stagehand-setup.sh +0 -439
  162. package/.agent/scripts/system-cleanup.sh +0 -340
  163. package/.agent/scripts/terminal-title-helper.sh +0 -388
  164. package/.agent/scripts/terminal-title-setup.sh +0 -549
  165. package/.agent/scripts/test-stagehand-both-integration.sh +0 -317
  166. package/.agent/scripts/test-stagehand-integration.sh +0 -309
  167. package/.agent/scripts/test-stagehand-python-integration.sh +0 -341
  168. package/.agent/scripts/todo-ready.sh +0 -263
  169. package/.agent/scripts/tool-version-check.sh +0 -362
  170. package/.agent/scripts/toon-helper.sh +0 -469
  171. package/.agent/scripts/twilio-helper.sh +0 -917
  172. package/.agent/scripts/updown-helper.sh +0 -279
  173. package/.agent/scripts/validate-mcp-integrations.sh +0 -250
  174. package/.agent/scripts/validate-version-consistency.sh +0 -131
  175. package/.agent/scripts/vaultwarden-helper.sh +0 -597
  176. package/.agent/scripts/vercel-cli-helper.sh +0 -816
  177. package/.agent/scripts/verify-mirrors.sh +0 -169
  178. package/.agent/scripts/version-manager.sh +0 -831
  179. package/.agent/scripts/webhosting-helper.sh +0 -471
  180. package/.agent/scripts/webhosting-verify.sh +0 -238
  181. package/.agent/scripts/wordpress-mcp-helper.sh +0 -508
  182. package/.agent/scripts/worktree-helper.sh +0 -595
  183. package/.agent/scripts/worktree-sessions.sh +0 -577
  184. package/.agent/seo/dataforseo.md +0 -215
  185. package/.agent/seo/domain-research.md +0 -532
  186. package/.agent/seo/eeat-score.md +0 -659
  187. package/.agent/seo/google-search-console.md +0 -366
  188. package/.agent/seo/gsc-sitemaps.md +0 -282
  189. package/.agent/seo/keyword-research.md +0 -521
  190. package/.agent/seo/serper.md +0 -278
  191. package/.agent/seo/site-crawler.md +0 -387
  192. package/.agent/seo.md +0 -236
  193. package/.agent/services/accounting/quickfile.md +0 -159
  194. package/.agent/services/communications/telfon.md +0 -470
  195. package/.agent/services/communications/twilio.md +0 -569
  196. package/.agent/services/crm/fluentcrm.md +0 -449
  197. package/.agent/services/email/ses.md +0 -399
  198. package/.agent/services/hosting/101domains.md +0 -378
  199. package/.agent/services/hosting/closte.md +0 -177
  200. package/.agent/services/hosting/cloudflare.md +0 -251
  201. package/.agent/services/hosting/cloudron.md +0 -478
  202. package/.agent/services/hosting/dns-providers.md +0 -335
  203. package/.agent/services/hosting/domain-purchasing.md +0 -344
  204. package/.agent/services/hosting/hetzner.md +0 -327
  205. package/.agent/services/hosting/hostinger.md +0 -287
  206. package/.agent/services/hosting/localhost.md +0 -419
  207. package/.agent/services/hosting/spaceship.md +0 -353
  208. package/.agent/services/hosting/webhosting.md +0 -330
  209. package/.agent/social-media.md +0 -69
  210. package/.agent/templates/plans-template.md +0 -114
  211. package/.agent/templates/prd-template.md +0 -129
  212. package/.agent/templates/tasks-template.md +0 -108
  213. package/.agent/templates/todo-template.md +0 -89
  214. package/.agent/tools/ai-assistants/agno.md +0 -471
  215. package/.agent/tools/ai-assistants/capsolver.md +0 -326
  216. package/.agent/tools/ai-assistants/configuration.md +0 -221
  217. package/.agent/tools/ai-assistants/overview.md +0 -209
  218. package/.agent/tools/ai-assistants/status.md +0 -171
  219. package/.agent/tools/ai-assistants/windsurf.md +0 -193
  220. package/.agent/tools/ai-orchestration/autogen.md +0 -406
  221. package/.agent/tools/ai-orchestration/crewai.md +0 -445
  222. package/.agent/tools/ai-orchestration/langflow.md +0 -405
  223. package/.agent/tools/ai-orchestration/openprose.md +0 -487
  224. package/.agent/tools/ai-orchestration/overview.md +0 -362
  225. package/.agent/tools/ai-orchestration/packaging.md +0 -647
  226. package/.agent/tools/browser/agent-browser.md +0 -464
  227. package/.agent/tools/browser/browser-automation.md +0 -400
  228. package/.agent/tools/browser/chrome-devtools.md +0 -282
  229. package/.agent/tools/browser/crawl4ai-integration.md +0 -422
  230. package/.agent/tools/browser/crawl4ai-resources.md +0 -277
  231. package/.agent/tools/browser/crawl4ai-usage.md +0 -416
  232. package/.agent/tools/browser/crawl4ai.md +0 -585
  233. package/.agent/tools/browser/dev-browser.md +0 -341
  234. package/.agent/tools/browser/pagespeed.md +0 -260
  235. package/.agent/tools/browser/playwright.md +0 -266
  236. package/.agent/tools/browser/playwriter.md +0 -310
  237. package/.agent/tools/browser/stagehand-examples.md +0 -456
  238. package/.agent/tools/browser/stagehand-python.md +0 -483
  239. package/.agent/tools/browser/stagehand.md +0 -421
  240. package/.agent/tools/build-agent/agent-review.md +0 -224
  241. package/.agent/tools/build-agent/build-agent.md +0 -784
  242. package/.agent/tools/build-mcp/aidevops-plugin.md +0 -476
  243. package/.agent/tools/build-mcp/api-wrapper.md +0 -445
  244. package/.agent/tools/build-mcp/build-mcp.md +0 -240
  245. package/.agent/tools/build-mcp/deployment.md +0 -401
  246. package/.agent/tools/build-mcp/server-patterns.md +0 -632
  247. package/.agent/tools/build-mcp/transports.md +0 -366
  248. package/.agent/tools/code-review/auditing.md +0 -383
  249. package/.agent/tools/code-review/automation.md +0 -219
  250. package/.agent/tools/code-review/best-practices.md +0 -203
  251. package/.agent/tools/code-review/codacy.md +0 -151
  252. package/.agent/tools/code-review/code-simplifier.md +0 -174
  253. package/.agent/tools/code-review/code-standards.md +0 -309
  254. package/.agent/tools/code-review/coderabbit.md +0 -101
  255. package/.agent/tools/code-review/management.md +0 -155
  256. package/.agent/tools/code-review/qlty.md +0 -248
  257. package/.agent/tools/code-review/secretlint.md +0 -565
  258. package/.agent/tools/code-review/setup.md +0 -250
  259. package/.agent/tools/code-review/snyk.md +0 -563
  260. package/.agent/tools/code-review/tools.md +0 -230
  261. package/.agent/tools/content/summarize.md +0 -353
  262. package/.agent/tools/context/augment-context-engine.md +0 -468
  263. package/.agent/tools/context/context-builder-agent.md +0 -76
  264. package/.agent/tools/context/context-builder.md +0 -375
  265. package/.agent/tools/context/context7.md +0 -371
  266. package/.agent/tools/context/dspy.md +0 -302
  267. package/.agent/tools/context/dspyground.md +0 -374
  268. package/.agent/tools/context/llm-tldr.md +0 -219
  269. package/.agent/tools/context/osgrep.md +0 -488
  270. package/.agent/tools/context/prompt-optimization.md +0 -338
  271. package/.agent/tools/context/toon.md +0 -292
  272. package/.agent/tools/conversion/pandoc.md +0 -304
  273. package/.agent/tools/credentials/api-key-management.md +0 -154
  274. package/.agent/tools/credentials/api-key-setup.md +0 -224
  275. package/.agent/tools/credentials/environment-variables.md +0 -180
  276. package/.agent/tools/credentials/vaultwarden.md +0 -382
  277. package/.agent/tools/data-extraction/outscraper.md +0 -974
  278. package/.agent/tools/deployment/coolify-cli.md +0 -388
  279. package/.agent/tools/deployment/coolify-setup.md +0 -353
  280. package/.agent/tools/deployment/coolify.md +0 -345
  281. package/.agent/tools/deployment/vercel.md +0 -390
  282. package/.agent/tools/git/authentication.md +0 -132
  283. package/.agent/tools/git/gitea-cli.md +0 -193
  284. package/.agent/tools/git/github-actions.md +0 -207
  285. package/.agent/tools/git/github-cli.md +0 -223
  286. package/.agent/tools/git/gitlab-cli.md +0 -190
  287. package/.agent/tools/git/opencode-github-security.md +0 -350
  288. package/.agent/tools/git/opencode-github.md +0 -328
  289. package/.agent/tools/git/opencode-gitlab.md +0 -252
  290. package/.agent/tools/git/security.md +0 -196
  291. package/.agent/tools/git.md +0 -207
  292. package/.agent/tools/opencode/oh-my-opencode.md +0 -375
  293. package/.agent/tools/opencode/opencode-anthropic-auth.md +0 -446
  294. package/.agent/tools/opencode/opencode.md +0 -651
  295. package/.agent/tools/social-media/bird.md +0 -437
  296. package/.agent/tools/task-management/beads.md +0 -336
  297. package/.agent/tools/terminal/terminal-title.md +0 -251
  298. package/.agent/tools/ui/shadcn.md +0 -196
  299. package/.agent/tools/ui/ui-skills.md +0 -115
  300. package/.agent/tools/wordpress/localwp.md +0 -311
  301. package/.agent/tools/wordpress/mainwp.md +0 -391
  302. package/.agent/tools/wordpress/scf.md +0 -527
  303. package/.agent/tools/wordpress/wp-admin.md +0 -729
  304. package/.agent/tools/wordpress/wp-dev.md +0 -940
  305. package/.agent/tools/wordpress/wp-preferred.md +0 -398
  306. package/.agent/tools/wordpress.md +0 -95
  307. package/.agent/workflows/branch/bugfix.md +0 -63
  308. package/.agent/workflows/branch/chore.md +0 -95
  309. package/.agent/workflows/branch/experiment.md +0 -115
  310. package/.agent/workflows/branch/feature.md +0 -59
  311. package/.agent/workflows/branch/hotfix.md +0 -98
  312. package/.agent/workflows/branch/refactor.md +0 -92
  313. package/.agent/workflows/branch/release.md +0 -96
  314. package/.agent/workflows/branch.md +0 -347
  315. package/.agent/workflows/bug-fixing.md +0 -267
  316. package/.agent/workflows/changelog.md +0 -129
  317. package/.agent/workflows/code-audit-remote.md +0 -279
  318. package/.agent/workflows/conversation-starter.md +0 -69
  319. package/.agent/workflows/error-feedback.md +0 -578
  320. package/.agent/workflows/feature-development.md +0 -355
  321. package/.agent/workflows/git-workflow.md +0 -702
  322. package/.agent/workflows/multi-repo-workspace.md +0 -268
  323. package/.agent/workflows/plans.md +0 -709
  324. package/.agent/workflows/postflight.md +0 -604
  325. package/.agent/workflows/pr.md +0 -571
  326. package/.agent/workflows/preflight.md +0 -278
  327. package/.agent/workflows/ralph-loop.md +0 -773
  328. package/.agent/workflows/release.md +0 -498
  329. package/.agent/workflows/session-manager.md +0 -254
  330. package/.agent/workflows/session-review.md +0 -311
  331. package/.agent/workflows/sql-migrations.md +0 -631
  332. package/.agent/workflows/version-bump.md +0 -283
  333. package/.agent/workflows/wiki-update.md +0 -333
  334. package/.agent/workflows/worktree.md +0 -477
@@ -1,847 +0,0 @@
1
- #!/bin/bash
2
- # shellcheck disable=SC2034,SC2155,SC2317,SC2329,SC2016,SC2181,SC1091,SC2154,SC2015,SC2086,SC2129,SC2030,SC2031,SC2119,SC2120,SC2001,SC2162,SC2088,SC2089,SC2090,SC2029,SC2006,SC2153
3
-
4
- # Secretlint Integration Script
5
- # Pluggable linting tool to prevent committing credentials and secrets
6
- #
7
- # Usage: ./secretlint-helper.sh [command] [options]
8
- # Commands:
9
- # install - Install Secretlint and recommended rules
10
- # init - Initialize project configuration
11
- # scan - Scan for secrets (alias for lint)
12
- # lint - Lint files for secrets
13
- # mask - Mask secrets in a file
14
- # status - Check installation and configuration
15
- # fix - Mask secrets and fix files in place
16
- # quick - Quick scan without installation (npx)
17
- # docker - Run scan via Docker
18
- # help - Show this help message
19
- #
20
- # Author: AI DevOps Framework
21
- # Version: 1.0.0
22
- # License: MIT
23
- # Reference: https://github.com/secretlint/secretlint
24
-
25
- # Colors for output
26
- readonly GREEN='\033[0;32m'
27
- readonly BLUE='\033[0;34m'
28
- readonly YELLOW='\033[1;33m'
29
- readonly RED='\033[0;31m'
30
- readonly PURPLE='\033[0;35m'
31
- readonly CYAN='\033[0;36m'
32
- readonly NC='\033[0m' # No Color
33
-
34
- # Common constants
35
- readonly ERROR_UNKNOWN_COMMAND="Unknown command:"
36
- readonly SECRETLINT_CONFIG_FILE=".secretlintrc.json"
37
- readonly SECRETLINT_IGNORE_FILE=".secretlintignore"
38
- readonly DEFAULT_GLOB_PATTERN="**/*"
39
-
40
- # Print functions
41
- print_success() {
42
- local message="$1"
43
- echo -e "${GREEN}✅ $message${NC}"
44
- return 0
45
- }
46
-
47
- print_info() {
48
- local message="$1"
49
- echo -e "${BLUE}ℹ️ $message${NC}"
50
- return 0
51
- }
52
-
53
- print_warning() {
54
- local message="$1"
55
- echo -e "${YELLOW}⚠️ $message${NC}"
56
- return 0
57
- }
58
-
59
- print_error() {
60
- local message="$1"
61
- echo -e "${RED}❌ $message${NC}" >&2
62
- return 0
63
- }
64
-
65
- print_header() {
66
- local message="$1"
67
- echo -e "${PURPLE}🔐 $message${NC}"
68
- return 0
69
- }
70
-
71
- print_secret() {
72
- local message="$1"
73
- echo -e "${CYAN}🛡️ $message${NC}"
74
- return 0
75
- }
76
-
77
- # Check if Secretlint is installed
78
- check_secretlint_installed() {
79
- if command -v secretlint &> /dev/null; then
80
- local version
81
- version=$(secretlint --version 2>/dev/null || echo "unknown")
82
- print_success "Secretlint installed: v$version"
83
- return 0
84
- elif [[ -f "node_modules/.bin/secretlint" ]]; then
85
- local version
86
- version=$(./node_modules/.bin/secretlint --version 2>/dev/null || echo "unknown")
87
- print_success "Secretlint installed (local): v$version"
88
- return 0
89
- else
90
- print_warning "Secretlint not found"
91
- return 1
92
- fi
93
- }
94
-
95
- # Check if Docker is available
96
- check_docker_available() {
97
- if command -v docker &> /dev/null; then
98
- print_success "Docker available"
99
- return 0
100
- else
101
- print_warning "Docker not found"
102
- return 1
103
- fi
104
- }
105
-
106
- # Get secretlint command (global or local)
107
- get_secretlint_cmd() {
108
- if command -v secretlint &> /dev/null; then
109
- echo "secretlint"
110
- elif [[ -f "node_modules/.bin/secretlint" ]]; then
111
- echo "./node_modules/.bin/secretlint"
112
- else
113
- echo "npx secretlint"
114
- fi
115
- return 0
116
- }
117
-
118
- # Install Secretlint and recommended rules
119
- install_secretlint() {
120
- local install_type="${1:-local}"
121
-
122
- print_header "Installing Secretlint"
123
-
124
- # Check for Node.js
125
- if ! command -v node &> /dev/null; then
126
- print_error "Node.js is required. Please install Node.js 20+ first."
127
- print_info "Alternatively, use Docker: $0 docker scan"
128
- return 1
129
- fi
130
-
131
- local node_version
132
- node_version=$(node -v | sed 's/v//' | cut -d. -f1)
133
- if [[ $node_version -lt 18 ]]; then
134
- print_warning "Node.js 20+ recommended. Current version: $(node -v)"
135
- fi
136
-
137
- case "$install_type" in
138
- "global")
139
- print_info "Installing Secretlint globally..."
140
- npm install -g secretlint @secretlint/secretlint-rule-preset-recommend
141
- ;;
142
- "local"|*)
143
- print_info "Installing Secretlint locally..."
144
- npm install --save-dev secretlint @secretlint/secretlint-rule-preset-recommend
145
- ;;
146
- esac
147
-
148
- if [[ $? -eq 0 ]]; then
149
- print_success "Secretlint installed successfully"
150
-
151
- # Initialize if config doesn't exist
152
- if [[ ! -f "$SECRETLINT_CONFIG_FILE" ]]; then
153
- print_info "Initializing configuration..."
154
- init_secretlint_config
155
- fi
156
-
157
- return 0
158
- else
159
- print_error "Installation failed"
160
- return 1
161
- fi
162
- }
163
-
164
- # Install additional rules
165
- install_additional_rules() {
166
- local rules="${1:-pattern}"
167
-
168
- print_header "Installing Additional Secretlint Rules"
169
-
170
- local npm_cmd="npm install --save-dev"
171
- if command -v secretlint &> /dev/null; then
172
- npm_cmd="npm install -g"
173
- fi
174
-
175
- case "$rules" in
176
- "pattern")
177
- print_info "Installing custom pattern rule..."
178
- $npm_cmd @secretlint/secretlint-rule-pattern
179
- ;;
180
- "sarif")
181
- print_info "Installing SARIF formatter..."
182
- $npm_cmd @secretlint/secretlint-formatter-sarif
183
- ;;
184
- "all")
185
- print_info "Installing all recommended additional rules..."
186
- $npm_cmd @secretlint/secretlint-rule-pattern \
187
- @secretlint/secretlint-rule-no-k8s-kind-secret \
188
- @secretlint/secretlint-rule-no-homedir \
189
- @secretlint/secretlint-rule-no-dotenv \
190
- @secretlint/secretlint-formatter-sarif
191
- ;;
192
- *)
193
- print_info "Installing rule: $rules"
194
- $npm_cmd "$rules"
195
- ;;
196
- esac
197
-
198
- if [[ $? -eq 0 ]]; then
199
- print_success "Additional rules installed"
200
- return 0
201
- else
202
- print_error "Failed to install rules"
203
- return 1
204
- fi
205
- }
206
-
207
- # Initialize Secretlint configuration
208
- init_secretlint_config() {
209
- print_header "Initializing Secretlint Configuration"
210
-
211
- local cmd
212
- cmd=$(get_secretlint_cmd)
213
-
214
- if [[ -f "$SECRETLINT_CONFIG_FILE" ]]; then
215
- print_warning "Configuration already exists: $SECRETLINT_CONFIG_FILE"
216
- print_info "Use 'secretlint --init' to overwrite"
217
- return 0
218
- fi
219
-
220
- # Try to use secretlint --init
221
- if $cmd --init &>/dev/null; then
222
- print_success "Configuration initialized: $SECRETLINT_CONFIG_FILE"
223
- else
224
- # Manually create comprehensive config
225
- print_info "Creating comprehensive configuration..."
226
- create_comprehensive_config
227
- fi
228
-
229
- # Create ignore file if it doesn't exist
230
- if [[ ! -f "$SECRETLINT_IGNORE_FILE" ]]; then
231
- create_ignore_file
232
- fi
233
-
234
- return 0
235
- }
236
-
237
- # Create comprehensive configuration
238
- create_comprehensive_config() {
239
- cat > "$SECRETLINT_CONFIG_FILE" << 'EOF'
240
- {
241
- "rules": [
242
- {
243
- "id": "@secretlint/secretlint-rule-preset-recommend",
244
- "rules": [
245
- {
246
- "id": "@secretlint/secretlint-rule-aws",
247
- "options": {
248
- "allows": []
249
- }
250
- },
251
- {
252
- "id": "@secretlint/secretlint-rule-github",
253
- "options": {
254
- "allows": []
255
- }
256
- },
257
- {
258
- "id": "@secretlint/secretlint-rule-privatekey"
259
- },
260
- {
261
- "id": "@secretlint/secretlint-rule-basicauth"
262
- },
263
- {
264
- "id": "@secretlint/secretlint-rule-slack"
265
- },
266
- {
267
- "id": "@secretlint/secretlint-rule-sendgrid"
268
- },
269
- {
270
- "id": "@secretlint/secretlint-rule-openai"
271
- },
272
- {
273
- "id": "@secretlint/secretlint-rule-anthropic"
274
- },
275
- {
276
- "id": "@secretlint/secretlint-rule-gcp"
277
- },
278
- {
279
- "id": "@secretlint/secretlint-rule-npm"
280
- },
281
- {
282
- "id": "@secretlint/secretlint-rule-shopify"
283
- },
284
- {
285
- "id": "@secretlint/secretlint-rule-linear"
286
- },
287
- {
288
- "id": "@secretlint/secretlint-rule-1password"
289
- },
290
- {
291
- "id": "@secretlint/secretlint-rule-database-connection-string"
292
- }
293
- ]
294
- }
295
- ]
296
- }
297
- EOF
298
- print_success "Created comprehensive configuration: $SECRETLINT_CONFIG_FILE"
299
- return 0
300
- }
301
-
302
- # Create ignore file
303
- create_ignore_file() {
304
- cat > "$SECRETLINT_IGNORE_FILE" << 'EOF'
305
- # Secretlint Ignore File
306
- # Uses .gitignore syntax
307
-
308
- # Dependencies
309
- **/node_modules/**
310
- **/vendor/**
311
- **/.venv/**
312
- **/venv/**
313
-
314
- # Build outputs
315
- **/dist/**
316
- **/build/**
317
- **/.next/**
318
- **/out/**
319
-
320
- # IDE and editor
321
- **/.idea/**
322
- **/.vscode/**
323
- **/.vs/**
324
- *.swp
325
- *.swo
326
-
327
- # Git
328
- **/.git/**
329
-
330
- # Test fixtures (may contain fake secrets for testing)
331
- **/test/fixtures/**
332
- **/tests/fixtures/**
333
- **/__tests__/fixtures/**
334
- **/testdata/**
335
-
336
- # Generated files
337
- **/*.min.js
338
- **/*.min.css
339
- **/package-lock.json
340
- **/pnpm-lock.yaml
341
- **/yarn.lock
342
- **/composer.lock
343
- **/Gemfile.lock
344
- **/Cargo.lock
345
- **/poetry.lock
346
-
347
- # Documentation and examples (review manually if needed)
348
- **/docs/**
349
- **/examples/**
350
-
351
- # Binary files
352
- **/*.png
353
- **/*.jpg
354
- **/*.jpeg
355
- **/*.gif
356
- **/*.ico
357
- **/*.svg
358
- **/*.woff
359
- **/*.woff2
360
- **/*.ttf
361
- **/*.eot
362
- **/*.pdf
363
- **/*.zip
364
- **/*.tar
365
- **/*.gz
366
- **/*.rar
367
-
368
- # Logs
369
- **/*.log
370
- **/logs/**
371
-
372
- # Coverage reports
373
- **/coverage/**
374
- **/.nyc_output/**
375
-
376
- # Cache
377
- **/.cache/**
378
- **/.tmp/**
379
- **/tmp/**
380
- EOF
381
- print_success "Created ignore file: $SECRETLINT_IGNORE_FILE"
382
- return 0
383
- }
384
-
385
- # Run Secretlint scan
386
- run_secretlint_scan() {
387
- local target="${1:-$DEFAULT_GLOB_PATTERN}"
388
- local format="${2:-stylish}"
389
- local output_file="$3"
390
- local extra_args="$4"
391
-
392
- print_header "Running Secretlint Scan"
393
-
394
- # Validate target pattern for dangerous characters
395
- if [[ "$target" == *";"* ]] || [[ "$target" == *"|"* ]] || [[ "$target" == *"&"* ]] || [[ "$target" == *"\`"* ]]; then
396
- print_error "Invalid target pattern: contains forbidden characters"
397
- return 1
398
- fi
399
-
400
- local cmd
401
- cmd=$(get_secretlint_cmd)
402
-
403
- # Check if configuration exists
404
- if [[ ! -f "$SECRETLINT_CONFIG_FILE" ]]; then
405
- print_warning "No configuration found. Initializing..."
406
- init_secretlint_config
407
- fi
408
-
409
- # Build command array for safe execution
410
- local -a cmd_array
411
- read -ra cmd_array <<< "$cmd"
412
- cmd_array+=("$target" "--format" "$format")
413
-
414
- if [[ -n "$output_file" ]]; then
415
- cmd_array+=("--output" "$output_file")
416
- fi
417
-
418
- # Handle extra_args safely by splitting on spaces (limited use case)
419
- if [[ -n "$extra_args" ]]; then
420
- read -ra extra_array <<< "$extra_args"
421
- cmd_array+=("${extra_array[@]}")
422
- fi
423
-
424
- print_info "Scanning: $target"
425
- print_info "Format: $format"
426
- print_info "Command: ${cmd_array[*]}"
427
- echo ""
428
-
429
- # Execute scan using array (safe from injection)
430
- "${cmd_array[@]}"
431
- local exit_code=$?
432
-
433
- echo ""
434
- if [[ $exit_code -eq 0 ]]; then
435
- print_success "No secrets detected! Your code is clean."
436
- elif [[ $exit_code -eq 1 ]]; then
437
- print_error "Secrets detected! Please review and remove/rotate exposed credentials."
438
- print_info "Tip: Use 'secretlint-disable-line' comments to ignore false positives"
439
- else
440
- print_error "Scan failed with error code: $exit_code"
441
- fi
442
-
443
- return $exit_code
444
- }
445
-
446
- # Run quick scan via npx (no installation)
447
- run_quick_scan() {
448
- local target="${1:-$DEFAULT_GLOB_PATTERN}"
449
-
450
- # Validate target pattern for dangerous characters
451
- if [[ "$target" == *";"* ]] || [[ "$target" == *"|"* ]] || [[ "$target" == *"&"* ]] || [[ "$target" == *"\`"* ]]; then
452
- print_error "Invalid target pattern: contains forbidden characters"
453
- return 1
454
- fi
455
-
456
- print_header "Quick Secretlint Scan (via npx)"
457
- print_info "This requires no installation"
458
-
459
- npx @secretlint/quick-start "$target"
460
- }
461
-
462
- # Run scan via Docker
463
- run_docker_scan() {
464
- local target="${1:-$DEFAULT_GLOB_PATTERN}"
465
- local extra_args="$2"
466
-
467
- print_header "Running Secretlint via Docker"
468
-
469
- # Validate target pattern for dangerous characters
470
- if [[ "$target" == *";"* ]] || [[ "$target" == *"|"* ]] || [[ "$target" == *"&"* ]] || [[ "$target" == *"\`"* ]]; then
471
- print_error "Invalid target pattern: contains forbidden characters"
472
- return 1
473
- fi
474
-
475
- if ! check_docker_available; then
476
- print_error "Docker is required for this command"
477
- return 1
478
- fi
479
-
480
- local current_dir
481
- current_dir=$(pwd)
482
-
483
- # Build command array for safe execution
484
- local -a cmd_array=(
485
- "docker" "run"
486
- "-v" "${current_dir}:${current_dir}"
487
- "-w" "$current_dir"
488
- "--rm" "-it"
489
- "secretlint/secretlint"
490
- "secretlint" "$target"
491
- )
492
-
493
- # Handle extra_args safely
494
- if [[ -n "$extra_args" ]]; then
495
- read -ra extra_array <<< "$extra_args"
496
- cmd_array+=("${extra_array[@]}")
497
- fi
498
-
499
- print_info "Command: ${cmd_array[*]}"
500
- echo ""
501
-
502
- # Execute using array (safe from injection)
503
- "${cmd_array[@]}"
504
- }
505
-
506
- # Mask secrets in a file
507
- mask_secrets() {
508
- local input_file="$1"
509
- local output_file="${2:-$input_file}"
510
-
511
- print_header "Masking Secrets"
512
-
513
- if [[ -z "$input_file" ]]; then
514
- print_error "Input file required"
515
- print_info "Usage: $0 mask <input-file> [output-file]"
516
- return 1
517
- fi
518
-
519
- if [[ ! -f "$input_file" ]]; then
520
- print_error "File not found: $input_file"
521
- return 1
522
- fi
523
-
524
- local cmd
525
- cmd=$(get_secretlint_cmd)
526
-
527
- print_info "Input: $input_file"
528
- print_info "Output: $output_file"
529
-
530
- $cmd "$input_file" --format=mask-result --output="$output_file"
531
-
532
- if [[ $? -eq 0 ]]; then
533
- print_success "Secrets masked successfully"
534
- return 0
535
- else
536
- print_error "Failed to mask secrets"
537
- return 1
538
- fi
539
- }
540
-
541
- # Show status
542
- show_status() {
543
- print_header "Secretlint Status"
544
- echo ""
545
-
546
- # Check installation
547
- print_info "Installation:"
548
- check_secretlint_installed
549
- check_docker_available
550
- echo ""
551
-
552
- # Check Node.js
553
- print_info "Node.js:"
554
- if command -v node &> /dev/null; then
555
- print_success "Node.js: $(node -v)"
556
- else
557
- print_warning "Node.js: Not installed"
558
- fi
559
- echo ""
560
-
561
- # Check configuration
562
- print_info "Configuration:"
563
- if [[ -f "$SECRETLINT_CONFIG_FILE" ]]; then
564
- print_success "Config file: $SECRETLINT_CONFIG_FILE"
565
-
566
- # Count rules
567
- if command -v jq &> /dev/null; then
568
- local rules_count
569
- rules_count=$(jq -r '.rules | length' "$SECRETLINT_CONFIG_FILE" 2>/dev/null || echo "unknown")
570
- print_info "Configured rule presets: $rules_count"
571
- fi
572
- else
573
- print_warning "Config file: Not found"
574
- print_info "Run: $0 init"
575
- fi
576
-
577
- if [[ -f "$SECRETLINT_IGNORE_FILE" ]]; then
578
- print_success "Ignore file: $SECRETLINT_IGNORE_FILE"
579
- local ignore_count
580
- ignore_count=$(grep -cv '^#\|^$' "$SECRETLINT_IGNORE_FILE" 2>/dev/null || echo "0")
581
- print_info "Ignore patterns: $ignore_count"
582
- else
583
- print_warning "Ignore file: Not found"
584
- fi
585
- echo ""
586
-
587
- # Show available rules in preset
588
- print_info "Recommended Rules (preset-recommend):"
589
- echo " - AWS credentials (Access Key, Secret Key, Account ID)"
590
- echo " - GCP credentials"
591
- echo " - GitHub tokens (PAT, OAuth, App)"
592
- echo " - npm tokens"
593
- echo " - Private keys (RSA, DSA, EC, OpenSSH)"
594
- echo " - Basic auth in URLs"
595
- echo " - Slack tokens and webhooks"
596
- echo " - SendGrid API keys"
597
- echo " - Shopify API keys"
598
- echo " - OpenAI API keys"
599
- echo " - Anthropic/Claude API keys"
600
- echo " - Linear API keys"
601
- echo " - 1Password service account tokens"
602
- echo " - Database connection strings"
603
- echo ""
604
-
605
- return 0
606
- }
607
-
608
- # Generate SARIF output
609
- generate_sarif() {
610
- local target="${1:-$DEFAULT_GLOB_PATTERN}"
611
- local output_file="${2:-secretlint-results.sarif}"
612
-
613
- print_header "Generating SARIF Output"
614
-
615
- # Check if SARIF formatter is installed
616
- if ! npm list @secretlint/secretlint-formatter-sarif &>/dev/null; then
617
- print_info "Installing SARIF formatter..."
618
- npm install --save-dev @secretlint/secretlint-formatter-sarif
619
- fi
620
-
621
- local cmd
622
- cmd=$(get_secretlint_cmd)
623
-
624
- $cmd "$target" --format @secretlint/secretlint-formatter-sarif > "$output_file"
625
-
626
- if [[ $? -eq 0 ]]; then
627
- print_success "SARIF output saved: $output_file"
628
- return 0
629
- else
630
- print_error "Failed to generate SARIF output"
631
- return 1
632
- fi
633
- }
634
-
635
- # Pre-commit hook setup
636
- setup_precommit_hook() {
637
- print_header "Setting Up Pre-commit Hook"
638
-
639
- local hook_file=".git/hooks/pre-commit"
640
- local hook_dir=".git/hooks"
641
-
642
- if [[ ! -d ".git" ]]; then
643
- print_error "Not a git repository"
644
- return 1
645
- fi
646
-
647
- mkdir -p "$hook_dir"
648
-
649
- # Check if hook already exists
650
- if [[ -f "$hook_file" ]]; then
651
- if grep -q "secretlint" "$hook_file"; then
652
- print_warning "Secretlint hook already configured"
653
- return 0
654
- else
655
- print_warning "Pre-commit hook exists. Adding Secretlint..."
656
- # Append to existing hook
657
- cat >> "$hook_file" << 'EOF'
658
-
659
- # Secretlint - Secret Detection
660
- FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g')
661
- [ -z "$FILES" ] && exit 0
662
-
663
- echo "Running Secretlint..."
664
- echo "$FILES" | xargs npx secretlint
665
- RET=$?
666
- if [ $RET -ne 0 ]; then
667
- echo "Secretlint found potential secrets. Please review before committing."
668
- exit 1
669
- fi
670
- EOF
671
- fi
672
- else
673
- # Create new hook
674
- cat > "$hook_file" << 'EOF'
675
- #!/bin/sh
676
- # Pre-commit hook with Secretlint integration
677
-
678
- # Secretlint - Secret Detection
679
- FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g')
680
- [ -z "$FILES" ] && exit 0
681
-
682
- echo "Running Secretlint..."
683
- echo "$FILES" | xargs npx secretlint
684
- RET=$?
685
- if [ $RET -ne 0 ]; then
686
- echo "Secretlint found potential secrets. Please review before committing."
687
- exit 1
688
- fi
689
-
690
- exit 0
691
- EOF
692
- fi
693
-
694
- chmod +x "$hook_file"
695
- print_success "Pre-commit hook configured: $hook_file"
696
-
697
- return 0
698
- }
699
-
700
- # Setup with Husky + lint-staged
701
- setup_husky_integration() {
702
- print_header "Setting Up Husky + lint-staged Integration"
703
-
704
- if [[ ! -f "package.json" ]]; then
705
- print_error "package.json not found. Initialize npm project first."
706
- return 1
707
- fi
708
-
709
- print_info "Installing Husky and lint-staged..."
710
- npx husky-init 2>/dev/null || npm install husky --save-dev
711
- npm install lint-staged --save-dev
712
-
713
- # Initialize Husky
714
- npx husky install
715
-
716
- # Add pre-commit hook
717
- npx husky add .husky/pre-commit "npx --no-install lint-staged"
718
-
719
- # Update package.json with lint-staged config
720
- print_info "Adding lint-staged configuration to package.json..."
721
-
722
- if command -v jq &> /dev/null; then
723
- local tmp_file
724
- tmp_file=$(mktemp)
725
- jq '. + {"lint-staged": {"*": ["secretlint"]}}' package.json > "$tmp_file" && mv "$tmp_file" package.json
726
- print_success "Added lint-staged configuration"
727
- else
728
- print_warning "jq not available. Please add manually to package.json:"
729
- echo ' "lint-staged": {'
730
- echo ' "*": ["secretlint"]'
731
- echo ' }'
732
- fi
733
-
734
- print_success "Husky + lint-staged configured"
735
-
736
- return 0
737
- }
738
-
739
- # Show help
740
- show_help() {
741
- print_header "Secretlint Helper - Secret Detection Tool"
742
- echo ""
743
- echo "Usage: $0 <command> [options]"
744
- echo ""
745
- echo "Commands:"
746
- echo " install [local|global] - Install Secretlint and recommended rules"
747
- echo " install-rules [rule] - Install additional rules (pattern|sarif|all|<pkg>)"
748
- echo " init - Initialize project configuration"
749
- echo " scan [target] [format] - Scan files for secrets"
750
- echo " lint [target] [format] - Alias for scan"
751
- echo " quick [target] - Quick scan via npx (no install)"
752
- echo " docker [target] - Scan via Docker"
753
- echo " mask <file> [output] - Mask secrets in a file"
754
- echo " sarif [target] [output] - Generate SARIF output"
755
- echo " hook - Setup git pre-commit hook"
756
- echo " husky - Setup Husky + lint-staged"
757
- echo " status - Show installation and configuration status"
758
- echo " help - Show this help message"
759
- echo ""
760
- echo "Formats: stylish (default), json, compact, table, sarif, mask-result"
761
- echo ""
762
- echo "Examples:"
763
- echo " $0 install # Install locally"
764
- echo " $0 init # Initialize configuration"
765
- echo " $0 scan # Scan all files"
766
- echo " $0 scan \"src/**/*\" # Scan specific directory"
767
- echo " $0 scan . json # Output as JSON"
768
- echo " $0 quick # Quick scan (no install)"
769
- echo " $0 docker # Scan via Docker"
770
- echo " $0 mask .env.example # Mask secrets in file"
771
- echo " $0 sarif # Generate SARIF for CI/CD"
772
- echo " $0 hook # Setup pre-commit hook"
773
- echo ""
774
- echo "Environment Variables:"
775
- echo " None required - Secretlint works offline"
776
- echo ""
777
- echo "Detected Secret Types:"
778
- echo " - AWS credentials (Access Key, Secret Key)"
779
- echo " - GCP service account keys"
780
- echo " - GitHub tokens (PAT, OAuth, App, Actions)"
781
- echo " - OpenAI/Anthropic API keys"
782
- echo " - Private keys (RSA, DSA, EC, OpenSSH)"
783
- echo " - Database connection strings"
784
- echo " - Slack tokens and webhooks"
785
- echo " - npm tokens"
786
- echo " - And many more..."
787
- echo ""
788
- echo "Reference: https://github.com/secretlint/secretlint"
789
- return 0
790
- }
791
-
792
- # Main function
793
- main() {
794
- local command="${1:-help}"
795
- local arg2="${2:-}"
796
- local arg3="${3:-}"
797
- local arg4="${4:-}"
798
-
799
- case "$command" in
800
- "install")
801
- install_secretlint "$arg2"
802
- ;;
803
- "install-rules")
804
- install_additional_rules "$arg2"
805
- ;;
806
- "init")
807
- init_secretlint_config
808
- ;;
809
- "scan"|"lint")
810
- run_secretlint_scan "$arg2" "$arg3" "$arg4"
811
- ;;
812
- "quick")
813
- run_quick_scan "$arg2"
814
- ;;
815
- "docker")
816
- run_docker_scan "$arg2" "$arg3"
817
- ;;
818
- "mask"|"fix")
819
- mask_secrets "$arg2" "$arg3"
820
- ;;
821
- "sarif")
822
- generate_sarif "$arg2" "$arg3"
823
- ;;
824
- "hook")
825
- setup_precommit_hook
826
- ;;
827
- "husky")
828
- setup_husky_integration
829
- ;;
830
- "status")
831
- show_status
832
- ;;
833
- "help"|"--help"|"-h")
834
- show_help
835
- ;;
836
- *)
837
- print_error "$ERROR_UNKNOWN_COMMAND $command"
838
- echo ""
839
- show_help
840
- return 1
841
- ;;
842
- esac
843
- return $?
844
- }
845
-
846
- # Execute main function with all arguments
847
- main "$@"