Installation

Step-by-step guide to installing the Divekit CLI and required dependencies.

Prerequisites

Before installing Divekit, ensure your system meets the following requirements:

System Requirements

  • Operating System: Linux, macOS, or Windows
  • GitLab: Access to a GitLab instance with API permissions

GitLab Setup

  1. Access to a GitLab instance
  2. Admin rights to create groups and repositories
  3. Personal Access Token with api scope

Creating a Personal Access Token

  1. Create one here

or

  1. Navigate to your GitLab profile settings
  2. Go to “Access Tokens”
  3. Create a new token with required scopes
  4. Save the token securely - you’ll need it during installation

Storage Requirements

  • Minimum 1GB free disk space
  • Additional space for repositories (varies by project size)

Network Requirements

  • Stable internet connection
  • Access to GitLab API endpoints
  • No blocking firewalls for HTTP requests

Optional Requirements

  • Docker: For running tests in containers
  • Maven/Gradle: For Java project support
  • IDE: Any Git-compatible IDE for development

Installation

  1. Download the latest release:

  2. Install Divekit:
    Navigate to the download directory and run the installation script:

./divekit.exe install  # On Windows
./divekit install      # On Linux/macOS

Environment Setup

After installation, you need to configure your GitLab token in your system’s environment variables. There are two methods available:

Windows
  1. Open System Properties > Advanced > Environment Variables
  2. Add a new User Variable:
    • Variable name: GITLAB_TOKEN
    • Variable value: <YOUR_TOKEN>
  3. Restart your terminal
Linux

Add to your ~/.bashrc or ~/.zshrc:

export GITLAB_TOKEN="<YOUR_TOKEN>"

Then run:

source ~/.bashrc  # or source ~/.zshrc
macOS

Add to your ~/.zshrc:

export GITLAB_TOKEN="<YOUR_TOKEN>"

Then run:

source ~/.zshrc

You can store the token in a .env file in the Divekit configuration directory:

# In ~/.divekit/.env
GITLAB_TOKEN=<YOUR_TOKEN>

⚠️ Warning: This method is not recommended as the token is stored unencrypted and poses a potential security risk. Prefer using system environment variables instead.

To improve security when using this method:

# Restrict file permissions (Linux/macOS)
chmod 600 ~/.divekit/.env

This ensures only the file owner of your account (you) can read and write the file.

Verify Installation

Run the doctor command to verify your setup:

divekit doctor

This will check if:

  • Divekit is properly installed
  • Required environment variables are set
  • System requirements are met

Troubleshooting

If you encounter any issues:

  1. Check if the GitLab token is correctly set in your environment variables
  2. Run divekit doctor for detailed diagnostics
  3. 🚧 Check the logs in ~/.divekit/logs
  4. Ensure you have the correct permissions for the installation directory

First Steps After Installation

Create Your First Assignment

  1. Create and navigate to a new directory:
mkdir my-assignment
cd my-assignment
  1. Initialize a new Divekit project:
divekit init

Assignment Content Creation

  1. Add your assignment files to the repository
  2. Mark solution parts in your code:
public class Example {
    //unsup
    return actualSolution;
    //unsup
}
  1. Add variables for individualization:
public class $EntityClass$ {
    // ...
}

Assignment Distribution

  1. Verify your setup:
divekit doctor
  1. Distribute the repositories:
divekit distribute

Next Steps

For more detailed information, please refer to:

  • Configuration options in the Configuration section
  • Detailed system requirements in the Prerequisites section
Last modified January 17, 2025: refactor for cli rewrite (dfb706b)