Das Mojo-Paket hinzufügen
Installieren Sie Mojo über die Modular-Toolchain.
Das Mojo-Paket hinzufügen ist eine kostenlose Mojo Academy-Lektion auf CoddyKit. Dies ist Lektion 2 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des Mojo Academy-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der Mojo Academy-Kurs umfasst insgesamt 4 Lektionen.
Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.
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-appStep 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-appAdd 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 mojoThe 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 shellRun 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 --versionMojo 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 installQuick 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. 🎯
Häufig gestellte Fragen
Ist die Lektion „Das Mojo-Paket hinzufügen“ kostenlos?
Ja — der vollständige Text von „Das Mojo-Paket hinzufügen“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des Mojo Academy-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der Mojo Academy-Kurs umfasst insgesamt 4 Lektionen.
Was lerne ich in „Das Mojo-Paket hinzufügen“?
Installieren Sie Mojo über die Modular-Toolchain. Du übst Mojo Academy mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.
Brauche ich Erfahrung, um Mojo Academy zu starten?
Keine Vorkenntnisse erforderlich. Mojo Academy auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 2 von 4.
Wie lange dauert die Lektion „Das Mojo-Paket hinzufügen“?
Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.
Kann ich in dieser Mojo Academy-Lektion Code schreiben und ausführen?
Ja. Jede Mojo Academy-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.
Alle Lektionen in diesem Kurs
- Die Modular CLI installieren
- Das Mojo-Paket hinzufügen
- Ihre Version überprüfen
- Ihre Editor-Einrichtung für Mojo