Gists are used to informally share work with others. You can use Guild AI to share runs in a similar way.
# Guild AI user config (e.g. ~/.guild/config.yml) remotes: shared-runs: type: gist user: <your GitHub user name> gist-name: <a name used to identify the gist>
Guild also supports inline remote specs for gists, letting you specify the gist details directly in a command without having to define anything in a config file.
guild push gist:<user>/<gist-name>
By default, you can read any public gist without credentials.
To create or modify a gist, you must provide your GitHub credentials or use a GitHub personal access token that has gist privileges. You specify the access token using the environment variable
GIST_ACCESS_TOKEN. For more information, see Security below.
Say you have some runs that you want feedback on. You can quickly publish them to a gist for others to access. The example below assumes the GitHub user
Run a few operations.
guild run hello msg=[Hello,Hi,Yo] -y
Publish the runs to a gist:
guild push gist:maria/sample-runs
With the runs published to the gist, others can access them this way:
guild pull gist:maria/sample-runs
Gists are created with public visibility. If you want to secure the runs, you must change the visibility on the gist yourself after Guild creates it. Guild does not modify the visibility on subsequent operations.
Gist remote commands use the following environment variables when available:
||User associated with the gist. If defined, you may omit the
||Personal access token used when creating or modifying gists. See Security below for more information.|
To create a gist to manage runs, you need a personal access token that has the gist privileges checked. For steps to obtain an access token, see Creating a personal access token
Once you have an access token, specify it using the environment variable
GIST_ACCESS_TOKEN. For POSIX shells, you can specify the value directly in a Guild command like this:
GIST_ACCESS_TOKEN=<token> guild push gist:<user>/<gist-name>
Keep an Access Token Secret
To avoid showing the access token in the command, you can define the value in a text file that you source.
# gist-credentials export GIST_USER=<user> export GIST_ACCESS_TOKEN=<token>
source <( gpg -d gist-credentials.gpg )
You can specify local environment variables when defining a gist remote in user config. Specify the path to the file containing the exported environment variables using the
local-env remote attribute.
# Guild AI user config (e.g. ~/.guild/config.yml) remotes: shared-runs: type: gist local-env: gist-credentials.gpg # or plain text, e.g. gist-credentials
Guild automatically decrypts files ending with
.gpg for local environments.
Gists created by Guild are public. To make the gist private, you must modify the gist visibility settings manually.