LinuxCommandLibrary

kaggle-config

Configure Kaggle CLI settings

TLDR

View current configuration values

$ kaggle config view
copy

Set a configuration value
$ kaggle config set [[-n|--name]] [configuration_parameter] [[-v|--value]] [parameter_value]
copy

Clear a configuration value
$ kaggle config unset [[-n|--name]] [configuration_parameter]
copy

SYNOPSIS

kaggle config SUBCOMMAND [OPTIONS]

PARAMETERS

path
    Prints path to the Kaggle config directory or file.

set
    Sets a configuration property like token or proxy.

view
    Displays current configuration values.

--global
    Targets global config (~/.kaggle) instead of local.

--help
    Shows help for config subcommand.

DESCRIPTION

The kaggle config command is a subcommand of the Kaggle CLI tool, part of the official Python kaggle package. It handles configuration for API authentication and preferences, primarily managing the kaggle.json token file downloaded from a user's Kaggle account.

Essential for CLI operations like downloading datasets (kaggle datasets download) or submitting notebooks, it locates, views, or sets config values. The default config directory is ~/.kaggle on Unix-like systems. Use it to check setup before scripting workflows.

Supports local project overrides via .kaggle/kaggle.json or global settings. Ensures secure handling of API tokens (username and key). Without proper config, API calls fail with authentication errors.

CAVEATS

Requires pip install kaggle. Config file needs chmod 600 permissions for security. No subcommand defaults to help.

SETUP STEPS

1. pip install kaggle
2. Download kaggle.json from Kaggle > Account > API.
3. mkdir -p ~/.kaggle && mv kaggle.json ~/.kaggle/
4. chmod 600 ~/.kaggle/kaggle.json
5. Verify: kaggle config path && kaggle config view

COMMON USE

Set proxy: kaggle config set -c proxy http://proxy:port
View token: kaggle config view (redacts key for safety).

HISTORY

Part of Kaggle API since 2017, evolved with v1.5+ for better config management. Maintained by Google (Kaggle owner) for data science CLI.

SEE ALSO

kaggle(1), pip(1), mkdir(1)

Copied to clipboard