Skip to content

Auto-generate SSH keys for GitHub access during upload #19

Closed

Description

@neuromechanist

Problem

When a user tries to upload a dataset, the CLI checks for GitHub SSH access as a prerequisite:

nemar dataset upload ./ds002680 --name "My Dataset"
Prerequisites check failed
  - GitHub SSH access not configured. Add your SSH key...

This requires users to:

  1. Generate an SSH key manually
  2. Add it to their GitHub account
  3. Configure SSH properly

This is a significant barrier for users who are not familiar with SSH or GitHub configuration. Many users use HTTPS for Git operations and have never set up SSH keys.

Proposed Solution

The CLI should automatically handle SSH key management:

  1. During nemar auth login or first upload:

    • Check if SSH access to GitHub works
    • If not, generate a dedicated SSH key pair for NEMAR (~/.ssh/nemar_ed25519)
    • Register the public key with GitHub via the API (using the user's GitHub PAT from backend)
    • Configure SSH to use this key for github.com (via ~/.ssh/config)
  2. Key characteristics:

    • Use Ed25519 algorithm (modern, secure, compact)
    • Store in ~/.ssh/nemar_ed25519 (separate from user's existing keys)
    • Add SSH config entry to use this key for GitHub
    • Backend can register the key via GitHub API on user's behalf
  3. User experience goal:
    Once a user has an API key, they should be able to upload immediately without any manual SSH/GitHub configuration.

Related Issues

Acceptance Criteria

  • CLI auto-generates SSH key if GitHub SSH access fails
  • SSH key is registered with GitHub automatically (via backend API)
  • SSH config is updated to use the NEMAR-specific key
  • User can upload dataset without manual SSH setup
  • Existing SSH configurations are not modified/broken

Activity

  1. neuromechanist commented on Jan 16, 2026

    @neuromechanist
    ContributorAuthor

    This issue will be partially implemented, with providing an SSH public key and guiding the user on how to add it to their GitHub account. The full implementation will be addressed in issue 20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions