Jump to content

Any way to access bash/zsh env vars

Recommended Posts

Desired Outcome: Being able to access zsh env vars in `Script`s in workflows (i.e. `$__TRELLO-TOKEN`), so that I can pass it to scripts (e.g. php)


Rationale: Currently, my `Alfred.alfredpreferences` are tracked in my dotfiles repository. Because of that, I don't want to push any access tokens to GitHub. Since most workflows that touch third-party APIs require you to enter credentials that end up somewhere in source code, I want to put them in my `.zshrc__private` file and then access them in scripts (i.e. for the Trello workflow here: https://github.com/MikoMagni/Trello-Workflow-for-Alfred)


Background: Initially, my Alfred preferences went into my dotfiles because I worked for an enterprise that disallowed Dropbox. I could move back to a Dropbox strategy at some point, but to be honest sometimes the version control is kind of nice (and simplifies things for me, as I don't have to bring in Dropbox as a dependency).


Is there any way to do this?

Link to comment

Alfred does not provide a direct way to access the environment.

But you can have a workaround like this.


1. add run script ,like echo $HOME which is env environment

2. add arg and vars, set echo ouput as a variable

3. then you can use it at will.








Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...