set readonly and not ignore permissions #2017

Closed
opened 2026-02-16 17:33:45 -05:00 by yindo · 5 comments
Owner

Originally created by @wojons on GitHub (Oct 9, 2025).

Originally assigned to: @rekram1-node on GitHub.

When using opencode with things you would not want in a repo you would add to .gitignore but if you want to use @ to flag a file it will not let you having a file if its just .opencodenotignore or a more complex config file would allow for users still not have the file sent to the code repo but still be able to reference it when using opencode.

A readonly permission to allow the model to read important docs specs etc but not be allowed to edit them

Originally created by @wojons on GitHub (Oct 9, 2025). Originally assigned to: @rekram1-node on GitHub. When using opencode with things you would not want in a repo you would add to .gitignore but if you want to use @ to flag a file it will not let you having a file if its just .opencodenotignore or a more complex config file would allow for users still not have the file sent to the code repo but still be able to reference it when using opencode. A readonly permission to allow the model to read important docs specs etc but not be allowed to edit them
yindo closed this issue 2026-02-16 17:33:45 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 9, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #1535: Requests ability to include gitignored files in file search, similar to your request for files that wouldn't normally be in a repo but should be accessible to opencode
  • #2517: Requests a way to disable .gitignore-based filtering for the list tool, addressing similar use case of needing files that are gitignored but still accessible to opencode
  • #539: Discusses security concerns about file access and proposes .opencodeignore file for controlling file visibility, which relates to your config file idea for controlling permissions
  • #2792: Requests per-tool permissions (though closed), similar to your readonly permission concept

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Oct 9, 2025): This issue might be a duplicate of existing issues. Please check: - #1535: Requests ability to include gitignored files in file search, similar to your request for files that wouldn't normally be in a repo but should be accessible to opencode - #2517: Requests a way to disable .gitignore-based filtering for the list tool, addressing similar use case of needing files that are gitignored but still accessible to opencode - #539: Discusses security concerns about file access and proposes .opencodeignore file for controlling file visibility, which relates to your config file idea for controlling permissions - #2792: Requests per-tool permissions (though closed), similar to your readonly permission concept Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Oct 9, 2025):

@wojons opencode uses ripgrep so you can make a:

.ignore
.rgignore

and specify the rules you want opencode to respect.

Example:

local.txt is in gitignore but I want to be able to @ reference it

in .ignore or .rgignore put:
!local.txt

and then it will respect that

@rekram1-node commented on GitHub (Oct 9, 2025): @wojons opencode uses ripgrep so you can make a: .ignore .rgignore and specify the rules you want opencode to respect. Example: local.txt is in gitignore but I want to be able to @ reference it in .ignore or .rgignore put: !local.txt and then it will respect that
Author
Owner

@wojons commented on GitHub (Oct 9, 2025):

This is great :) it worked exactly how do we add this to the docs so that others can get access to this information

@wojons commented on GitHub (Oct 9, 2025): This is great :) it worked exactly how do we add this to the docs so that others can get access to this information
Author
Owner

@rekram1-node commented on GitHub (Oct 9, 2025):

https://opencode.ai/docs/tools/#ignore-patterns << this was added today

@rekram1-node commented on GitHub (Oct 9, 2025): https://opencode.ai/docs/tools/#ignore-patterns << this was added today
Author
Owner

@rekram1-node commented on GitHub (Oct 14, 2025):

going to close I think we solved your issue, if you want an agent to be able to only read files but not edit you can try using permissions: https://opencode.ai/docs/permissions/#_top

The plan agent could prolly also get used out of the box for that as well

@rekram1-node commented on GitHub (Oct 14, 2025): going to close I think we solved your issue, if you want an agent to be able to only read files but not edit you can try using permissions: https://opencode.ai/docs/permissions/#_top The plan agent could prolly also get used out of the box for that as well
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2017