0Pricing
Mojo Academy · Урок

Добавление пакета Mojo

Установите Mojo через набор инструментов Modular.

«Добавление пакета Mojo» — бесплатный урок Mojo Academy на CoddyKit. Это урок 2 из 4. Ты можешь прочитать весь урок бесплатно ниже — а потом практиковать его прямо в браузере с встроенным редактором кода и ИИ-репетитором 24/7. Это часть пути обучения Mojo Academy, и твой прогресс синхронизируется между веб-версией и приложением CoddyKit. Курс Mojo Academy содержит 4 уроков всего.

Части этого урока еще не переведены и отображаются на английском.

The CLI Is Not Mojo Yet

Installing magic gave you the manager, not the language. Now you add Mojo itself into a project through that toolchain. 📦

Projects Hold Your Toolchain

With magic, Mojo lives inside a project folder. Each project gets its own pinned version, so different apps never clash.

Create a New Project

Start by making a project. The magic init command scaffolds a folder ready to hold Mojo and its dependencies.

magic init my-mojo-app

Step Into the Folder

Move into the new directory so the next commands run in the right place. This folder is your project root.

cd my-mojo-app

Add the Mojo Package

Pull Mojo into the project with magic add. This downloads the compiler and standard library as a package the project depends on.

magic add mojo

The Manifest File

Your dependencies are tracked in a pixi.toml manifest. Adding mojo records it there so the setup is reproducible later.

The Lock File

Alongside the manifest sits a lock file pinning exact versions. It guarantees teammates get the very same toolchain you have.

Enter the Environment

Activate the project so its tools are on your PATH. Inside a magic shell, the mojo command becomes available to you.

magic shell

Run Without Activating

Prefer not to enter a shell? Prefix any command with magic run to use the project's Mojo for just that one command.

magic run mojo --version

Mojo Is Now Local

Because Mojo lives in the project, deleting the folder removes it cleanly. Nothing is scattered globally across your system.

Share It with Others

Commit pixi.toml and the lock file to git. A teammate then runs magic install to recreate the exact same Mojo setup.

magic install

Quick Check

Recall the command that pulls Mojo into your project after you create it.

Recap

You ran magic init, then magic add mojo, and the package landed in pixi.toml. Enter it with magic shell to use mojo. 🎯

Часто задаваемые вопросы

Урок «Добавление пакета Mojo» бесплатный?

Да — полный текст урока «Добавление пакета Mojo» бесплатно доступен здесь в веб-версии. Чтобы практиковать его интерактивно (встроенный редактор кода и ИИ-репетитор 24/7) и разблокировать остальной курс Mojo Academy, подпишись на CoddyKit PRO. Курс Mojo Academy содержит 4 уроков всего.

Чему я научусь в уроке «Добавление пакета Mojo»?

Установите Mojo через набор инструментов Modular. Ты практикуешь Mojo Academy с помощью реального кода, который запускаешь прямо в браузере, и ИИ-репетитор 24/7 отвечает на твои вопросы во время урока.

Нужен ли мне опыт, чтобы начать Mojo Academy?

Предыдущий опыт не требуется. Mojo Academy на CoddyKit структурирован для всех уровней — от новичков до продвинутых, поэтому ты можешь начать отсюда или с самого начала и учиться в своем темпе. Это урок 2 из 4.

Сколько времени занимает урок «Добавление пакета Mojo»?

Большинство уроков CoddyKit занимают около 5–10 минут. Каждый из них компактный и интерактивный, поэтому ты постоянно делаешь прогресс и продолжаешь с того же места в веб-версии и приложении.

Можно ли писать и запускать код в этом уроке Mojo Academy?

Да. Каждый урок Mojo Academy включает встроенный редактор кода, поэтому ты пишешь и запускаешь реальный код прямо в браузере и получаешь моментальную обратную связь от AI — локальная установка не требуется.

Все уроки этого курса

  1. Установка Modular CLI
  2. Добавление пакета Mojo
  3. Проверка версии
  4. Настройка редактора для Mojo
← Назад к Mojo Academy