Skip to content

Add Bash/Shell parser support (.sh, .bash, .zsh) #135

@josephismikhail

Description

@josephismikhail

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 map on a known TS/JS repo, verify counts unchanged)
  • Unit + smoke tests pass (npm test in ix-cli)
  • Function definitions ingested as entities
  • Variable declarations and export statements ingested
  • source and . 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 text returns results with language: bash
  • ix contains returns members for a known shell script

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions