Skip to main content
Log in

Magic commands

This document contains the help content for the magic command-line program.

magic​

magic - A high level package management tool by Modular for developing with Mojo and MAX.

To get started, run magic init in your project directory.

To see all available commands, run magic --help or magic help.

Usage: magic [OPTIONS] <COMMAND>

Subcommands:​
  • init β€” Creates a new project
  • add β€” Adds dependencies to the project
  • remove β€” Removes dependencies from the project
  • install β€” Install all dependencies
  • update β€” Update dependencies as recorded in the local lock file
  • run β€” Runs task in project
  • shell β€” Start a shell in the magic environment of the project
  • shell-hook β€” Print the magic environment activation script
  • project β€” Modify the project configuration file through the command line
  • task β€” Interact with tasks in the project
  • list β€” List project's packages
  • tree β€” Show a tree of project dependencies
  • global β€” Subcommand for global package management actions
  • config β€” Configuration management
  • info β€” Information about the system, project and environments for the current machine
  • search β€” Search a conda package
  • self-update β€” Update magic to the latest or a specific version
  • clean β€” Clean the parts of your system which are touched by magic. Defaults to cleaning the environments and task cache. Use the cache subcommand to clean the cache
  • completion β€” Generates a completion script for a shell
  • telemetry β€” Configure how telemetry data is emitted from magic and Modular packages
Options:​
  • -v, --verbose β€” Increase logging verbosity

  • -q, --quiet β€” Decrease logging verbosity

  • --color <COLOR> β€” Whether the log needs to be colored

    Default value: auto

    Possible values: always, never, auto

  • --no-progress β€” Hide all progress bars

    Default value: false

magic init​

Creates a new project

Usage: magic init [OPTIONS] [PATH]

Arguments:​
  • <PATH> β€” Where to place the project (defaults to current path)

    Default value: .

Options:​
  • -c, --channel <channel> β€” Channels to use in the project

  • -p, --platform <platform> β€” Platforms that the project supports

  • -i, --import <ENV_FILE> β€” Environment.yml file to bootstrap the project

  • --format <FORMAT> β€” The manifest format to create

    Possible values: magic, pyproject, mojoproject

magic add​

Adds dependencies to the project

The dependencies should be defined as MatchSpec for conda package, or a PyPI requirement for the --pypi dependencies. If no specific version is provided, the latest version compatible with your project will be chosen automatically or a * will be used.

Example usage:

  • magic add python=3.9: This will select the latest minor version that complies with 3.9.*, i.e., python version 3.9.0, 3.9.1, 3.9.2, etc.
  • magic add python: In absence of a specified version, the latest version will be chosen. For instance, this could resolve to python version 3.11.3.* at the time of writing.

Adding multiple dependencies at once is also supported:

  • magic add python pytest: This will add both python and pytest to the project's dependencies.

The --platform and --build/--host flags make the dependency target specific.

  • magic add python --platform linux-64 --platform osx-arm64: Will add the latest version of python for linux-64 and osx-arm64 platforms.
  • magic add python --build: Will add the latest version of python for as a build dependency.

Mixing --platform and --build/--host flags is supported

The --pypi option will add the package as a pypi dependency. This can not be mixed with the conda dependencies

  • magic add --pypi boto3
  • `magic add --pypi "boto3==version"

If the project manifest is a pyproject.toml, adding a pypi dependency will add it to the native pyproject project.dependencies array or to the native project.optional-dependencies table if a feature is specified:

  • magic add --pypi boto3 will add boto3 to the project.dependencies array
  • magic add --pypi boto3 --feature aws will add boto3 to the project.dependencies.aws array

These dependencies will then be read by magic as if they had been added to the magic pypi-dependencies tables of the default or of a named feature.

Usage: magic add [OPTIONS] <SPECS>...

Arguments:​
  • <SPECS> β€” The dependencies as names, conda MatchSpecs or PyPi requirements
Options:​
  • --manifest-path <MANIFEST_PATH> β€” The path to 'pixi.toml' or 'pyproject.toml'

  • --host β€” The specified dependencies are host dependencies. Conflicts with build and pypi

  • --build β€” The specified dependencies are build dependencies. Conflicts with host and pypi

  • --pypi β€” The specified dependencies are pypi dependencies. Conflicts with host and build

  • -p, --platform <PLATFORM> β€” The platform(s) for which the dependency should be modified

  • -f, --feature <FEATURE> β€” The feature for which the dependency should be modified

  • --no-lockfile-update β€” Don't update lockfile, implies the no-install as well

  • --no-install β€” Don't modify the environment, only modify the lock-file

  • --tls-no-verify β€” Do not verify the TLS certificate of the server

  • --auth-file <AUTH_FILE> β€” Path to the file containing the authentication token

  • --pypi-keyring-provider <PYPI_KEYRING_PROVIDER> β€” Specifies if we want to use uv keyring provider

    Possible values: disabled, subprocess

  • --editable β€” Whether the pypi requirement should be editable

magic remove​

Removes dependencies from the project

If the project manifest is a pyproject.toml, removing a pypi dependency with the --pypi flag will remove it from either - the native pyproject project.dependencies array or, if a feature is specified, the native project.optional-dependencies table - magic pypi-dependencies tables of the default feature or, if a feature is specified, a named feature

Usage: magic remove [OPTIONS] <SPECS>...

Arguments:​
  • <SPECS> β€” The dependencies as names, conda MatchSpecs or PyPi requirements
Options:​
  • --manifest-path <MANIFEST_PATH> β€” The path to 'pixi.toml' or 'pyproject.toml'

  • --host β€” The specified dependencies are host dependencies. Conflicts with build and pypi

  • --build β€” The specified dependencies are build dependencies. Conflicts with host and pypi

  • --pypi β€” The specified dependencies are pypi dependencies. Conflicts with host and build

  • -p, --platform <PLATFORM> β€” The platform(s) for which the dependency should be modified

  • -f, --feature <FEATURE> β€” The feature for which the dependency should be modified

  • --no-lockfile-update β€” Don't update lockfile, implies the no-install as well

  • --no-install β€” Don't modify the environment, only modify the lock-file

  • --tls-no-verify β€” Do not verify the TLS certificate of the server

  • --auth-file <AUTH_FILE> β€” Path to the file containing the authentication token

  • --pypi-keyring-provider <PYPI_KEYRING_PROVIDER> β€” Specifies if we want to use uv keyring provider

    Possible values: disabled, subprocess

magic install​

Install all dependencies

Usage: magic install [OPTIONS]

Options:​
  • --manifest-path <MANIFEST_PATH> β€” The path to 'pixi.toml' or 'pyproject.toml'

  • --frozen β€” Install the environment as defined in the lockfile, doesn't update lockfile if it isn't up-to-date with the manifest file

  • --locked β€” Check if lockfile is up-to-date before installing the environment, aborts when lockfile isn't up-to-date with the manifest file

  • -e, --environment <ENVIRONMENT> β€” The environment to install

  • --tls-no-verify β€” Do not verify the TLS certificate of the server

  • --auth-file <AUTH_FILE> β€” Path to the file containing the authentication token

  • --pypi-keyring-provider <PYPI_KEYRING_PROVIDER> β€” Specifies if we want to use uv keyring provider

    Possible values: disabled, subprocess

  • -a, --all

magic update​

Update dependencies as recorded in the local lock file

Usage: magic update [OPTIONS] [PACKAGES]...

Arguments:​
  • <PACKAGES> β€” The packages to update
Options:​
  • --tls-no-verify β€” Do not verify the TLS certificate of the server

  • --auth-file <AUTH_FILE> β€” Path to the file containing the authentication token

  • --pypi-keyring-provider <PYPI_KEYRING_PROVIDER> β€” Specifies if we want to use uv keyring provider

    Possible values: disabled, subprocess

  • --manifest-path <MANIFEST_PATH> β€” The path to 'pixi.toml' or 'pyproject.toml'

  • --no-install β€” Don't install the (solve) environments needed for pypi-dependencies solving

  • -n, --dry-run β€” Don't actually write the lockfile or update any environment

  • -e, --environment <ENVIRONMENTS> β€” The environments to update. If none is specified, all environments are updated

  • -p, --platform <PLATFORMS> β€” The platforms to update. If none is specified, all platforms are updated

  • --json

magic run​

Runs task in project

Usage: magic run [OPTIONS] <TASK>...

Arguments:​
  • <TASK> β€” The magic task or a task shell command you want to run in the project's environment, which can be an executable in the environment's PATH
Options:​
  • --manifest-path <MANIFEST_PATH> β€” The path to 'pixi.toml' or 'pyproject.toml'

  • --frozen β€” Install the environment as defined in the lockfile, doesn't update lockfile if it isn't up-to-date with the manifest file

  • --locked β€” Check if lockfile is up-to-date before installing the environment, aborts when lockfile isn't up-to-date with the manifest file

  • -e, --environment <ENVIRONMENT> β€” The environment to run the task in

  • --tls-no-verify β€” Do not verify the TLS certificate of the server

  • --auth-file <AUTH_FILE> β€” Path to the file containing the authentication token

  • --pypi-keyring-provider <PYPI_KEYRING_PROVIDER> β€” Specifies if we want to use uv keyring provider

    Possible values: disabled, subprocess

  • --clean-env β€” Use a clean environment to run the task

    Using this flag will ignore your current shell environment and use bare minimum environment to activate the magic environment in.

magic shell​

Start a shell in the magic environment of the project

Usage: magic shell [OPTIONS]

Options:​
  • --manifest-path <MANIFEST_PATH> β€” The path to 'pixi.toml' or 'pyproject.toml'

  • --frozen β€” Install the environment as defined in the lockfile, doesn't update lockfile if it isn't up-to-date with the manifest file

  • --locked β€” Check if lockfile is up-to-date before installing the environment, aborts when lockfile isn't up-to-date with the manifest file

  • -e, --environment <ENVIRONMENT> β€” The environment to activate in the shell

  • --tls-no-verify β€” Do not verify the TLS certificate of the server

  • --auth-file <AUTH_FILE> β€” Path to the file containing the authentication token

  • --pypi-keyring-provider <PYPI_KEYRING_PROVIDER> β€” Specifies if we want to use uv keyring provider

    Possible values: disabled, subprocess

  • --change-ps1 <CHANGE_PS1> β€” Do not change the PS1 variable when starting a prompt

    Possible values: true, false

magic shell-hook​

Print the magic environment activation script.

You can source the script to activate the environment without needing magic itself.

Usage: magic shell-hook [OPTIONS]

Options:​
  • -s, --shell <SHELL> β€” Sets the shell, options: [bash, zsh, xonsh, cmd, powershell, fish, nushell]

  • --manifest-path <MANIFEST_PATH> β€” The path to 'pixi.toml' or 'pyproject.toml'

  • --frozen β€” Install the environment as defined in the lockfile, doesn't update lockfile if it isn't up-to-date with the manifest file

  • --locked β€” Check if lockfile is up-to-date before installing the environment, aborts when lockfile isn't up-to-date with the manifest file

  • -e, --environment <ENVIRONMENT> β€” The environment to activate in the script

  • --json β€” Emit the environment variables set by running the activation as JSON

    Default value: false

  • --tls-no-verify β€” Do not verify the TLS certificate of the server

  • --auth-file <AUTH_FILE> β€” Path to the file containing the authentication token

  • --pypi-keyring-provider <PYPI_KEYRING_PROVIDER> β€” Specifies if we want to use uv keyring provider

    Possible values: disabled, subprocess

  • --change-ps1 <CHANGE_PS1> β€” Do not change the PS1 variable when starting a prompt

    Possible values: true, false

magic project​

Modify the project configuration file through the command line

Usage: magic project [OPTIONS] <COMMAND>

Subcommands:​
  • channel β€” Commands to manage project channels
  • description β€” Commands to manage project description
  • platform β€” Commands to manage project platforms
  • version β€” Commands to manage project version
  • environment β€” Commands to manage project environments
Options:​
  • --manifest-path <MANIFEST_PATH> β€” The path to 'pixi.toml' or 'pyproject.toml'

magic project channel​

Commands to manage project channels

Usage: magic project channel [OPTIONS] <COMMAND>

Subcommands:​
  • add β€” Adds a channel to the project file and updates the lockfile
  • list β€” List the channels in the project file
  • remove β€” Remove channel(s) from the project file and updates the lockfile
Options:​
  • --manifest-path <MANIFEST_PATH> β€” The path to 'pixi.toml' or 'pyproject.toml'

magic project channel add​

Adds a channel to the project file and updates the lockfile

Usage: magic project channel add [OPTIONS] <CHANNEL>...

Arguments:​
  • <CHANNEL> β€” The channel name or URL
Options:​
  • --no-install β€” Don't update the environment, only modify the manifest and the lock-file
  • -f, --feature <FEATURE> β€” The name of the feature to modify

magic project channel list​

List the channels in the project file

Usage: magic project channel list [OPTIONS]

Options:​
  • --urls β€” Whether to display the channel's names or urls

magic project channel remove​

Remove channel(s) from the project file and updates the lockfile

Usage: magic project channel remove [OPTIONS] <CHANNEL>...

Arguments:​
  • <CHANNEL> β€” The channel name or URL
Options:​
  • --no-install β€” Don't update the environment, only modify the manifest and the lock-file
  • -f, --feature <FEATURE> β€” The name of the feature to modify

magic project description​

Commands to manage project description

Usage: magic project description [OPTIONS] <COMMAND>

Subcommands:​
  • get β€” Get the project description
  • set β€” Set the project description
Options:​
  • --manifest-path <MANIFEST_PATH> β€” The path to 'pixi.toml' or 'pyproject.toml'

magic project description get​

Get the project description

Usage: magic project description get

magic project description set​

Set the project description

Usage: magic project description set <DESCRIPTION>

Arguments:​
  • <DESCRIPTION> β€” The project description

magic project platform​

Commands to manage project platforms

Usage: magic project platform [OPTIONS] <COMMAND>

Subcommands:​
  • add β€” Adds a platform(s) to the project file and updates the lockfile
  • list β€” List the platforms in the project file
  • remove β€” Remove platform(s) from the project file and updates the lockfile
Options:​
  • --manifest-path <MANIFEST_PATH> β€” The path to 'pixi.toml' or 'pyproject.toml'

magic project platform add​

Adds a platform(s) to the project file and updates the lockfile

Usage: magic project platform add [OPTIONS] <PLATFORM>...

Arguments:​
  • <PLATFORM> β€” The platform name(s) to add
Options:​
  • --no-install β€” Don't update the environment, only add changed packages to the lock-file
  • -f, --feature <FEATURE> β€” The name of the feature to add the platform to

magic project platform list​

List the platforms in the project file

Usage: magic project platform list

magic project platform remove​

Remove platform(s) from the project file and updates the lockfile

Usage: magic project platform remove [OPTIONS] <PLATFORM>...

Arguments:​
  • <PLATFORM> β€” The platform name(s) to remove
Options:​
  • --no-install β€” Don't update the environment, only remove the platform(s) from the lock-file
  • -f, --feature <FEATURE> β€” The name of the feature to remove the platform from

magic project version​

Commands to manage project version

Usage: magic project version [OPTIONS] <COMMAND>

Subcommands:​
  • get β€” Get the project version
  • set β€” Set the project version
  • major β€” Bump the project version to MAJOR
  • minor β€” Bump the project version to MINOR
  • patch β€” Bump the project version to PATCH
Options:​
  • --manifest-path <MANIFEST_PATH> β€” The path to 'pixi.toml' or 'pyproject.toml'

magic project version get​

Get the project version

Usage: magic project version get

magic project version set​

Set the project version

Usage: magic project version set <VERSION>

Arguments:​
  • <VERSION> β€” The new project version

magic project version major​

Bump the project version to MAJOR

Usage: magic project version major

magic project version minor​

Bump the project version to MINOR

Usage: magic project version minor

magic project version patch​

Bump the project version to PATCH

Usage: magic project version patch

magic project environment​

Commands to manage project environments

Usage: magic project environment [OPTIONS] <COMMAND>

Subcommands:​
  • add β€” Adds an environment to the manifest file
  • list β€” List the environments in the manifest file
  • remove β€” Remove an environment from the manifest file
Options:​
  • --manifest-path <MANIFEST_PATH> β€” The path to 'pixi.toml' or 'pyproject.toml'

magic project environment add​

Adds an environment to the manifest file

Usage: magic project environment add [OPTIONS] <NAME>

Arguments:​
  • <NAME> β€” The name of the environment to add
Options:​
  • -f, --feature <FEATURES> β€” Features to add to the environment

  • --solve-group <SOLVE_GROUP> β€” The solve-group to add the environment to

  • --no-default-feature β€” Don't include the default feature in the environment

    Default value: false

  • --force β€” Update the manifest even if the environment already exists

    Default value: false

magic project environment list​

List the environments in the manifest file

Usage: magic project environment list

magic project environment remove​

Remove an environment from the manifest file

Usage: magic project environment remove <NAME>

Arguments:​
  • <NAME> β€” The name of the environment to remove

magic task​

Interact with tasks in the project

Usage: magic task [OPTIONS] <COMMAND>

Subcommands:​
  • add β€” Add a command to the project
  • remove β€” Remove a command from the project
  • alias β€” Alias another specific command
  • list β€” List all tasks in the project
Options:​
  • --manifest-path <MANIFEST_PATH> β€” The path to 'pixi.toml' or 'pyproject.toml'

magic task add​

Add a command to the project

Usage: magic task add [OPTIONS] <NAME> <COMMANDS>...

Arguments:​
  • <NAME> β€” Task name
  • <COMMANDS> β€” One or more commands to actually execute
Options:​
  • --depends-on <DEPENDS_ON> β€” Depends on these other commands
  • -p, --platform <PLATFORM> β€” The platform for which the task should be added
  • -f, --feature <FEATURE> β€” The feature for which the task should be added
  • --cwd <CWD> β€” The working directory relative to the root of the project
  • --env <ENV> β€” The environment variable to set, use --env key=value multiple times for more than one variable
  • --description <DESCRIPTION> β€” A description of the task to be added
  • --clean-env β€” Isolate the task from the shell environment, and only use the magic environment to run the task

magic task remove​

Remove a command from the project

Usage: magic task remove [OPTIONS] [NAMES]...

Arguments:​
  • <NAMES> β€” Task names to remove
Options:​
  • -p, --platform <PLATFORM> β€” The platform for which the task should be removed
  • -f, --feature <FEATURE> β€” The feature for which the task should be removed

magic task alias​

Alias another specific command

Usage: magic task alias [OPTIONS] <ALIAS> <DEPENDS_ON>...

Arguments:​
  • <ALIAS> β€” Alias name
  • <DEPENDS_ON> β€” Depends on these tasks to execute
Options:​
  • -p, --platform <PLATFORM> β€” The platform for which the alias should be added
  • --description <DESCRIPTION> β€” The description of the alias task

magic task list​

List all tasks in the project

Usage: magic task list [OPTIONS]

Options:​
  • -s, --summary β€” Tasks available for this machine per environment
  • -e, --environment <ENVIRONMENT> β€” The environment the list should be generated for. If not specified, the default environment is used

magic list​

List project's packages.

Highlighted packages are explicit dependencies.

Usage: magic list [OPTIONS] [REGEX]

Arguments:​
  • <REGEX> β€” List only packages matching a regular expression
Options:​
  • --platform <PLATFORM> β€” The platform to list packages for. Defaults to the current platform

  • --json β€” Whether to output in json format

  • --json-pretty β€” Whether to output in pretty json format

  • --sort-by <SORT_BY> β€” Sorting strategy

    Default value: name

    Possible values: size, name, kind

  • --manifest-path <MANIFEST_PATH> β€” The path to 'pixi.toml' or 'pyproject.toml'

  • --frozen β€” Install the environment as defined in the lockfile, doesn't update lockfile if it isn't up-to-date with the manifest file

  • --locked β€” Check if lockfile is up-to-date before installing the environment, aborts when lockfile isn't up-to-date with the manifest file

  • -e, --environment <ENVIRONMENT> β€” The environment to list packages for. Defaults to the default environment

  • --no-lockfile-update β€” Don't update lockfile, implies the no-install as well

  • --no-install β€” Don't modify the environment, only modify the lock-file

  • --tls-no-verify β€” Do not verify the TLS certificate of the server

  • --auth-file <AUTH_FILE> β€” Path to the file containing the authentication token

  • --pypi-keyring-provider <PYPI_KEYRING_PROVIDER> β€” Specifies if we want to use uv keyring provider

    Possible values: disabled, subprocess

  • -x, --explicit β€” Only list packages that are explicitly defined in the project

magic tree​

Show a tree of project dependencies

Dependency names highlighted in green are directly specified in the manifest. Yellow version numbers are conda packages, PyPI version numbers are blue.

Usage: magic tree [OPTIONS] [REGEX]

Arguments:​
  • <REGEX> β€” List only packages matching a regular expression
Options:​
  • -p, --platform <PLATFORM> β€” The platform to list packages for. Defaults to the current platform

  • --manifest-path <MANIFEST_PATH> β€” The path to 'pixi.toml' or 'pyproject.toml'

  • -e, --environment <ENVIRONMENT> β€” The environment to list packages for. Defaults to the default environment

  • --no-lockfile-update β€” Don't update lockfile, implies the no-install as well

  • --no-install β€” Don't modify the environment, only modify the lock-file

  • --tls-no-verify β€” Do not verify the TLS certificate of the server

  • --auth-file <AUTH_FILE> β€” Path to the file containing the authentication token

  • --pypi-keyring-provider <PYPI_KEYRING_PROVIDER> β€” Specifies if we want to use uv keyring provider

    Possible values: disabled, subprocess

  • -i, --invert β€” Invert tree and show what depends on given package in the regex argument

magic global​

Subcommand for global package management actions

Install packages on the user level. Example: magic global install my_package magic global remove my_package

Usage: magic global <COMMAND>

Subcommands:​
  • install β€” Installs the defined package in a global accessible location
  • remove β€” Removes a package previously installed into a globally accessible location via magic global install
  • list β€” Lists all packages previously installed into a globally accessible location via magic global install
  • upgrade β€” Upgrade specific package which is installed globally
  • upgrade-all β€” Upgrade all globally installed packages

magic global install​

Installs the defined package in a global accessible location

Usage: magic global install [OPTIONS] [PACKAGES]...

Arguments:​
  • <PACKAGES> β€” Specifies the packages that are to be installed
Options:​
  • -c, --channel <CHANNEL> β€” The channels to consider as a name or a url. Multiple channels can be specified by using this field multiple times.

    When specifying a channel, it is common that the selected channel also depends on the conda-forge channel.

    By default, if no channel is provided, conda-forge is used.

  • -p, --platform <PLATFORM>

    Default value: osx-arm64

  • --tls-no-verify β€” Do not verify the TLS certificate of the server

  • --auth-file <AUTH_FILE> β€” Path to the file containing the authentication token

  • --pypi-keyring-provider <PYPI_KEYRING_PROVIDER> β€” Specifies if we want to use uv keyring provider

    Possible values: disabled, subprocess

magic global remove​

Removes a package previously installed into a globally accessible location via magic global install

Usage: magic global remove [OPTIONS] [PACKAGES]...

Arguments:​
  • <PACKAGES> β€” Specifies the packages that are to be removed
Options:​
  • -v, --verbose β€” Increase logging verbosity
  • -q, --quiet β€” Decrease logging verbosity

magic global list​

Lists all packages previously installed into a globally accessible location via magic global install

Usage: magic global list

magic global upgrade​

Upgrade specific package which is installed globally

Usage: magic global upgrade [OPTIONS] <SPECS>...

Arguments:​
  • <SPECS> β€” Specifies the packages to upgrade
Options:​
  • -c, --channel <CHANNEL> β€” The channels to consider as a name or a url. Multiple channels can be specified by using this field multiple times.

    When specifying a channel, it is common that the selected channel also depends on the conda-forge channel.

    By default, if no channel is provided, conda-forge is used.

  • --platform <PLATFORM> β€” The platform to install the package for

    Default value: osx-arm64

magic global upgrade-all​

Upgrade all globally installed packages

Usage: magic global upgrade-all [OPTIONS]

Options:​
  • -c, --channel <CHANNEL> β€” The channels to consider as a name or a url. Multiple channels can be specified by using this field multiple times.

    When specifying a channel, it is common that the selected channel also depends on the conda-forge channel.

    By default, if no channel is provided, conda-forge is used.

  • --tls-no-verify β€” Do not verify the TLS certificate of the server

  • --auth-file <AUTH_FILE> β€” Path to the file containing the authentication token

  • --pypi-keyring-provider <PYPI_KEYRING_PROVIDER> β€” Specifies if we want to use uv keyring provider

    Possible values: disabled, subprocess

  • --platform <PLATFORM> β€” The platform to install the package for

    Default value: osx-arm64

magic config​

Configuration management

Usage: magic config <COMMAND>

Subcommands:​
  • edit β€” Edit the configuration file
  • list β€” List configuration values
  • prepend β€” Prepend a value to a list configuration key
  • append β€” Append a value to a list configuration key
  • set β€” Set a configuration value
  • unset β€” Unset a configuration value

magic config edit​

Edit the configuration file

Usage: magic config edit [OPTIONS]

Options:​
  • -l, --local β€” Operation on project-local configuration
  • -g, --global β€” Operation on global configuration
  • -s, --system β€” Operation on system configuration

magic config list​

List configuration values

Example: magic config list default-channels

Usage: magic config list [OPTIONS] [KEY]

Arguments:​
  • <KEY> β€” Configuration key to show (all if not provided)
Options:​
  • --json β€” Output in JSON format
  • -l, --local β€” Operation on project-local configuration
  • -g, --global β€” Operation on global configuration
  • -s, --system β€” Operation on system configuration

magic config prepend​

Prepend a value to a list configuration key

Example: magic config prepend default-channels bioconda

Usage: magic config prepend [OPTIONS] <KEY> <VALUE>

Arguments:​
  • <KEY> β€” Configuration key to set
  • <VALUE> β€” Configuration value to (pre|ap)pend
Options:​
  • -l, --local β€” Operation on project-local configuration
  • -g, --global β€” Operation on global configuration
  • -s, --system β€” Operation on system configuration

magic config append​

Append a value to a list configuration key

Example: magic config append default-channels bioconda

Usage: magic config append [OPTIONS] <KEY> <VALUE>

Arguments:​
  • <KEY> β€” Configuration key to set
  • <VALUE> β€” Configuration value to (pre|ap)pend
Options:​
  • -l, --local β€” Operation on project-local configuration
  • -g, --global β€” Operation on global configuration
  • -s, --system β€” Operation on system configuration

magic config set​

Set a configuration value

Example: magic config set default-channels '["conda-forge", "bioconda"]'

Usage: magic config set [OPTIONS] <KEY> [VALUE]

Arguments:​
  • <KEY> β€” Configuration key to set
  • <VALUE> β€” Configuration value to set (key will be unset if value not provided)
Options:​
  • -l, --local β€” Operation on project-local configuration
  • -g, --global β€” Operation on global configuration
  • -s, --system β€” Operation on system configuration

magic config unset​

Unset a configuration value

Example: magic config unset default-channels

Usage: magic config unset [OPTIONS] <KEY>

Arguments:​
  • <KEY> β€” Configuration key to unset
Options:​
  • -l, --local β€” Operation on project-local configuration
  • -g, --global β€” Operation on global configuration
  • -s, --system β€” Operation on system configuration

magic info​

Information about the system, project and environments for the current machine

Usage: magic info [OPTIONS]

Options:​
  • --extended β€” Show cache and environment size
  • --json β€” Whether to show the output as JSON or not
  • --manifest-path <MANIFEST_PATH> β€” The path to 'pixi.toml' or 'pyproject.toml'

Search a conda package

Its output will list the latest version of package.

Usage: magic search [OPTIONS] <PACKAGE>

Arguments:​
  • <PACKAGE> β€” Name of package to search
Options:​
  • -c, --channel <CHANNEL> β€” The channels to consider as a name or a url. Multiple channels can be specified by using this field multiple times.

    When specifying a channel, it is common that the selected channel also depends on the conda-forge channel.

    By default, if no channel is provided, conda-forge is used.

  • --manifest-path <MANIFEST_PATH> β€” The path to 'pixi.toml' or 'pyproject.toml'

  • -p, --platform <PLATFORM> β€” The platform to search for, defaults to current platform

    Default value: osx-arm64

  • -l, --limit <LIMIT> β€” Limit the number of search results

magic self-update​

Update magic to the latest or a specific version.

Note: If the magic binary is not found in the default location (e.g. ~/.modular/bin/magic), magic won't update to prevent breaking the current installation.

Usage: magic self-update [OPTIONS]

Options:​
  • --version <VERSION> β€” The version to downgrade or upgrade to. The latest version is used if not specified
  • --force β€” Force the update even if the magic binary is not found in the default location

magic clean​

Clean the parts of your system which are touched by magic. Defaults to cleaning the environments and task cache. Use the cache subcommand to clean the cache

Usage: magic clean [OPTIONS] [COMMAND]

Subcommands:​
  • cache β€” Clean the cache of your system which are touched by magic
Options:​
  • --manifest-path <MANIFEST_PATH> β€” The path to 'pixi.toml' or 'pyproject.toml'
  • -e, --environment <ENVIRONMENT> β€” The environment directory to remove

magic clean cache​

Clean the cache of your system which are touched by magic

Usage: magic clean cache [OPTIONS]

Options:​
  • --pypi β€” Clean only the pypi related cache
  • --conda β€” Clean only the conda related cache
  • --mapping β€” Clean only the mapping cache
  • --exec β€” Clean only exec cache
  • --repodata β€” Clean only the repodata cache
  • --yes β€” Answer yes to all questions

magic completion​

Generates a completion script for a shell

Usage: magic completion --shell <SHELL>

Options:​
  • -s, --shell <SHELL> β€” The shell to generate a completion script for

    Possible values:

    • bash: Bourne Again SHell (bash)
    • elvish: Elvish shell
    • fish: Friendly Interactive SHell (fish)
    • nushell: Nushell
    • powershell: PowerShell
    • zsh: Z SHell (zsh)

magic telemetry​

Configure how telemetry data is emitted from magic and Modular packages

Usage: magic telemetry [OPTIONS]

Options:​
  • --manifest-path <MANIFEST_PATH> β€” The path to 'pixi.toml' or 'pyproject.toml'
  • -e, --environment <ENVIRONMENT> β€” The environment to control telemetry for Modular packages (default environment, if unspecified)
  • --enable β€” Enable telemetry
  • --disable β€” Disable telemetry

Was this page helpful?