Skip to content

feat(cmd): Allow line ranges in opencode run file attachments#14186

Open
ewired wants to merge 1 commit intoanomalyco:devfrom
ewired:cmd-line-range
Open

feat(cmd): Allow line ranges in opencode run file attachments#14186
ewired wants to merge 1 commit intoanomalyco:devfrom
ewired:cmd-line-range

Conversation

@ewired
Copy link
Contributor

@ewired ewired commented Feb 18, 2026

What does this PR do?

Allows specifying line range for the opencode run CLI file attachment option -f. e.g. opencode run "Tell me the exact contents of this line range" -f path/to/file.js:59-66. It will verify whether there is a file with that exact name (for whatever strange reason someone might have that syntax in their filenames) before extracting the line number/range.

How did you verify your code works?

cd packages/opencode && bun dev run "Repeat the exact contents of the attached files" -f README.md:12 -f bunfig.toml -f package.json:11-15

It successfully repeated the given snippets and whole files.

Closes #14193

@github-actions
Copy link
Contributor

Hey! Your PR title Allow line ranges in opencode run file attachments doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@ewired ewired changed the title Allow line ranges in opencode run file attachments feat(cmd): Allow line ranges in opencode run file attachments Feb 18, 2026
@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Pass line numbers/ranges to file attachment argument in opencode run

1 participant

Comments