1DOLLY 72PACKAGE secretenv3REQUIRES HOST runtime@045# secretenv NAME PROMPT COMMAND [ARG...] discards earlier input, shows PROMPT,6# reads a line from the terminal without showing it and runs COMMAND with NAME7# set to it, in that environment only; an empty line leaves NAME unset, Ctrl+C8# is status 130.9FROM /v0.1.4/Dollyfile-system-build 7997c05ba08220831088b2aa713c86dbf0ded0229bbfa84f411476f00269d9fc10REQUIRES HEADER libc11REQUIRES TOOL cc12REQUIRES TOOL rm1314FILE /tmp/secretenv/secretenv.c15    #include <spawn.h>16    #include <stdlib.h>17    #include <string.h>18    #include <sys/wait.h>19    #include <termios.h>20    #include <unistd.h>21    extern char **environ;22    int main(int argc, char **argv) {23      struct termios cooked, raw;24      if (argc < 4 || tcgetattr(0, &cooked) != 0) return 2;25      raw = cooked;26      raw.c_lflag &= ~(ICANON | ECHO | ISIG);27      raw.c_cc[VMIN] = 1;28      raw.c_cc[VTIME] = 0;29      if (tcsetattr(0, TCSAFLUSH, &raw) != 0) return 1;30      write(2, argv[2], strlen(argv[2]));31      char secret[512], byte = 0;32      size_t length = 0;33      while (read(0, &byte, 1) == 1 && byte != '\r' && byte != '\n' && byte != 3) {34        if (byte == 127 || byte == '\b') length -= length > 0;35        else if (byte > ' ' && length + 1 < sizeof(secret)) secret[length++] = byte;36      }37      secret[length] = '\0';38      tcsetattr(0, TCSANOW, &cooked);39      write(2, "\n", 1);40      if (byte == 3) return 130;41      if (length > 0 && setenv(argv[1], secret, 1) != 0) return 1;42      pid_t child;43      int status;44      if (posix_spawnp(&child, argv[3], NULL, NULL, argv + 3, environ) != 0) return 127;45      if (waitpid(child, &status, 0) != child) return 1;46      return WIFEXITED(status) ? WEXITSTATUS(status) : 128 + WTERMSIG(status);47    }48SLOP cc -O1 /tmp/secretenv/secretenv.c -o /usr/bin/secretenv49EXPORTS TOOL secretenv50SLOP rm -rf /tmp/secretenv51FILE /usr/share/man/cat1/secretenv.152    secretenv NAME PROMPT COMMAND [ARG...]: shows PROMPT, reads a line from the53    terminal without showing it and runs COMMAND with the environment variable54    NAME set to it, in that one process's environment. An empty line leaves NAME55    unset; Ctrl+C is status 130. Earlier input is discarded.56      secretenv ANTHROPIC_API_KEY 'Key (not shown): ' claude57