Skip to content

Conversation

@pankgeorg
Copy link
Member

Improve Julia credentials management and jh run command

This PR enhances the Julia integration with automatic credential management and a more
intuitive command structure.

Changes

Automatic Julia Credentials Management

  • Julia credentials (~/.julia/servers//auth.toml) are now automatically
    created/updated when:
    • Running jh auth login
    • Running jh auth refresh
    • Running jh run or jh run setup
    • Tokens are automatically refreshed via ensureValidToken()
  • Credentials use atomic file writes (temp file + rename) to prevent corruption

New Command Structure

  • jh run [-- julia-args...] - Runs Julia with JuliaHub configuration (previously only
    setup credentials)
    • Sets up credentials automatically before starting Julia
    • Arguments after -- are passed directly to Julia
    • Environment variables configured: JULIA_PKG_SERVER, JULIA_PKG_USE_CLI_GIT
  • jh run setup - New subcommand for credentials-only setup without starting Julia

Implementation

  • Extracted setupJuliaCredentials() as a reusable function called by:
    • jh run command (before starting Julia)
    • jh run setup command
    • jh auth login command (after successful login)
    • jh auth refresh command (after successful refresh)
  • Added updateJuliaCredentialsIfNeeded() function that automatically updates credentials
    during token refresh

Documentation

  • Updated CLAUDE.md with comprehensive Julia integration details
  • Updated README.md with Julia workflow examples
  • Updated command help text with correct usage patterns

Examples

  # Setup credentials only
  jh run setup

  # Start Julia REPL
  jh run

  # Run a Julia script
  jh run -- script.jl

  # Execute Julia code
  jh run -- -e "println(\"Hello from JuliaHub!\")"

  # Run with project and threads
  jh run -- --project=. --threads=4 script.jl

@pankgeorg pankgeorg requested a review from mortenpi October 25, 2025 20:33
@pankgeorg pankgeorg merged commit 2a07770 into main Oct 29, 2025
1 check passed
@pankgeorg pankgeorg deleted the pg/eagerly-move-credentials-to-depot branch October 29, 2025 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants