-
Notifications
You must be signed in to change notification settings - Fork 5
Add Bash/Shell parser support (.sh, .bash, .zsh) #135
Description
Problem
Ix does not currently parse .sh, .bash, or .zsh files. Shell scripts are treated as unrecognized and excluded from analysis, meaning automation logic, deployment scripts, and developer tooling written in shell are invisible to the system.
Proposed solution
Add a Bash/Shell parser that can identify and extract:
- Function definitions
- Variable declarations and exports
- Control flow (e.g.
if,for,while,case) - Command invocations and pipelines
- Source/import statements (e.g.
source,.) - Shebang lines (e.g.
#!/bin/bash,#!/usr/bin/env zsh) - Exit codes and error handling patterns (e.g.
set -e,trap)
Support the following file patterns: *.sh, *.bash, *.zsh
Why it matters
Shell scripts are the glue of most software projects — handling builds, deployments, environment setup, CI steps, and developer workflows. Without parsing them, Ix cannot reason about how automation is structured, what commands are invoked, or how scripts relate to the broader codebase. This gap is especially significant in infrastructure and DevOps-heavy repos where shell scripts are a primary operational artifact.
Merge requirements
Before this can be merged to main, the following must pass:
- Tested on 3 repos
- No regressions on existing parsers (
ix mapon a known TS/JS repo, verify counts unchanged) - Unit + smoke tests pass (
npm testinix-cli) - Function definitions ingested as entities
- Variable declarations and
exportstatements ingested -
sourceand.calls resolved and linked to target file where possible - Shebang lines parsed and reflected in file language metadata
- Error handling patterns (
set -e,trap) visible on their containing script - All three extensions ingested:
.sh,.bash,.zsh - CONTAINS chains correctly: file → function → nested logic
-
ix textreturns results withlanguage: bash -
ix containsreturns members for a known shell script