getsops / getsops/sops

Editing file in-place with data from stdin

Open
#696 3 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/CLI enhancement
Dominant language
Go
Stars
23.1k
Forks
1.1k
Avg merge
1d 11h
Merged PRs (30d)
9

Description

I would like to be able to edit an already encrypted file in-place using the data from stdin so that I can use it as part of a script to modify a file. I am using a .sops.yaml file with pattern matching and multiple KMSs.

One option I found is to do -d | -e /dev/stdin, but that has the drawback that I need to specify the KMS to be used explicitly, although that is already configured in .sops.yaml.

Another possibility I could imagine is that the KMS pattern is taken from --output should that be specified.

What I don't get is why -i seems to open the editor in any case – can't it simply read from stdin if connected to a pipe? Or am I maybe missing something?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the CLI handles -i, stdin pipes, -d/-e, --output, and .sops.yaml pattern matching. Define and verify behavior for editing an encrypted file from piped input while reusing its configured KMS settings, including what should happen when --output is supplied.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.