Datalad credentials

From nipreps/skills-comm · View interactive version

Datalad credentials is an AI agent skill from the GitHub repository nipreps/skills-comm. Auto-invoke when the user needs to set up credentials for a DataLad remote, gets an authentication error pushing to GitHub/OSF/S3/Figshare, or asks how to store tokens for DataLad siblings. Trigger on "set up credentials", "configure token", "authentication error", "credential error", "how do I auth

How to use this skill

Skill file

Skill: datalad-credentials

Configure credentials that DataLad needs to authenticate with remote storage (GitHub,

OSF, S3, WebDAV, HTTP). Credentials are stored in the system keyring and retrieved

automatically during datalad push, datalad get, and sibling operations.

Steps

Identifying the needed credential

  1. Determine the remote type from the error or user's description:

Generate a key with ssh-keygen and add the public key to your GIN account at

gin.g-node.org → Settings → SSH Keys. DataLad uses the SSH key automatically —

no datalad credentials set step is needed for GIN.

  1. Check existing credentials — list what is already stored:

```bash

datalad credentials

```

Storing a credential

  1. Set a credential by name:

```bash

datalad credentials set <credential-name>

```

DataLad prompts interactively for the secret. Use a descriptive name, e.g.:

For S3 credentials (requires both key and secret):

```bash

datalad credentials set s3-mybucket --field key_id=<access-key-id>

# DataLad then prompts for the secret key

```

  1. Environment variable alternative — for CI/CD or temporary use, credentials can

be passed via environment variables without storing in the keyring:

```bash

DATALAD_CREDENTIAL_<NAME>_TOKEN=<value> datalad push --to <sibling>

```

The variable name is uppercase with underscores. For S3:

```bash

DATALAD_CREDENTIAL_S3_MYBUCKET_KEY_ID=<id>

DATALAD_CREDENTIAL_S3_MYBUCKET_SECRET_ID=<secret>

```

Verifying and removing credentials

  1. Get/verify a stored credential:

```bash

datalad credentials get <credential-name>

```

  1. Remove a credential:

```bash

datalad credentials remove <credential-name>

```

Linking credentials to a sibling

After storing a credential, tell the sibling to use it:

datalad siblings configure --name <sibling-name> --set-property credential <credential-name>

Common authentication errors and fixes

| Error | Likely cause | Fix |

|-------|--------------|-----|

| 403 Forbidden on push | PAT lacks write permission | Regenerate token with repo scope |

| Authentication failed | Wrong credential name | Run datalad credentials to check stored names |

| credential not found | Credential not set | Run datalad credentials set <name> |

| git-annex: S3 error | Missing S3 credential | Set both key_id and secret via datalad credentials set |

Constraints

to verify a credential exists, not to echo the secret to the terminal.

to .datalad/config, .git/config, or any tracked file.

it is simpler to configure with datalad credentials set.

the credential may already exist under a different name.

via rclone config, not datalad credentials — these are entirely separate systems.

Direct the user to rclone config for rclone remote authentication.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.