Repository navigation
Tutorial 1 Your first task
Install malac, add a provider, have it fix a bug, and review what it did.
In this tutorial you install malac, connect it to a model, let it fix a small bug while you approve each step, and then review the change and the session.
-
Install malac.
curl -fsSL https://raw.githubusercontent.com/lobirus/malac/main/install.sh | shThe script ends with the installed version and the next steps:
Installed malac 1.1.1 to /Users/you/.local/binIf it says
~/.local/binis not on yourPATH, add theexportline it prints to your shell profile and open a new terminal. Other ways to install are on the Installation page. -
Add a provider. If
ANTHROPIC_API_KEYorOPENAI_API_KEYis set in your environment, malac already works; skip to the next step. Otherwise add your provider. This example uses an OpenAI-compatible gateway; see Configure a provider for others.printf '%s' "$LORA_API_KEY" | malac provider add lora \ --base-url https://lora.example.com/v1 --model default --api-key-stdin --set-default
saved provider `lora` to /Users/you/.malac/config.toml stored its API key in /Users/you/.malac/credentials.toml -
Check the connection.
malac provider list
anthropic (anthropic) https://api.anthropic.com · no key lora (openai) https://lora.example.com/v1 · key set openai (openai) https://api.openai.com/v1 · no key default model: lora/defaultThe built-in
anthropicandopenaiproviders are always listed.malac modelsasks every provider which models it serves.
-
Make a small project with a bug.
mkdir calc && cd calc && git init -q cat > calc.py <<'EOF' def add(a, b): return a - b EOF git add calc.py && git commit -qm "Add calc"
-
Ask malac to fix it. This tutorial uses the line mode (
--plain) so the output can be shown here; without it, the same run happens in the full-screen terminal UI, with dialogs instead of inline prompts.malac --plain calc.py has a bug in add, fix it and verify with a python one-linermalac reads the file without asking, because reading is always allowed. Then it wants to edit it:
● read calc.py ⎿ 1 def add(a, b): (+1 lines) ? edit calc.py [y] allow [a] always [n] deny -
Approve the edit. Press y. malac edits the file and then asks to run the check:
? edit calc.py [y] allow [a] always [n] deny allowed ● edit calc.py ⎿ Edited calc.py: (+2 lines) ? bash python3 -c "import calc; assert calc.add(2,3)==5; assert calc.add(-1,1)==0; print('ok')" [y] allow [a] always [n] deny -
Approve the command. Press y again. The check passes and malac reports:
● bash python3 -c "import calc; assert calc.add(2,3)==5; assert calc.add(-1,1)==0; print('ok')" ⎿ ok Fixed `calc.py:2`: `add` returned `a - b`, now returns `a + b`. Verified with `python3 -c "..."` → `ok`. ─ lora/default · 3.3k context · 366 out · $0.0024 · 2.2sThe last line is the turn summary: model, context size, output tokens, cost (when the provider reports it) and time.
-
Leave the session. In the line mode, malac stays interactive after the first prompt. Type
/costto see the session's usage, then/exit(or press Ctrl+D).› /cost input 3312 · cached 0 · output 366 · $0.0024 › /exit the session keeps running in the daemon; `malac --plain` returns to itInteractive sessions live in the malac daemon, which started by itself the first time. The session is a tab in your workspace; see Workspaces, tabs and the daemon.
Your wording and steps will differ: models phrase things differently and may check their work another way. What matters is the pattern: read freely, ask before changing anything, verify, report.
-
Look at the change.
git diff
--- a/calc.py +++ b/calc.py @@ -1,2 +1,2 @@ def add(a, b): - return a - b + return a + b
-
Find the session. Every session is saved as a transcript.
malac sessions
019a1f3c-… 2026-10-25 14:02 /Users/you/calc calc.py has a bug in add, fix it and verify with a python one-liner -
Read the transcript.
malac sessions show 019a1f3c-…
It shows your prompt (
›), every tool call (●) with its input, the first line of each result (⎿), the answer, and the session's token totals. Use the full id from the list. -
Continue where you left off.
-ccontinues the most recent session in this directory, with its context:malac --plain -c add a unittest for add in test_calc.py and run it
malac remembers the fix, writes the test, asks to run
python3 -m unittest, and reports the result.
Now that you have seen each step, let malac do the same without asking. Put the bug back first:
git checkout calc.py
malac -y -p calc.py has a bug in add, fix it and verify with a python one-liner● read calc.py
⎿ 1 def add(a, b): (+1 lines)
● edit calc.py
⎿ Edited calc.py: (+2 lines)
● bash python3 -c "import calc; assert calc.add(2,3)==5; assert calc.add(-1,1)==0; print('ok')"
⎿ ok
Fixed `calc.py:2`: `add` returned `a - b`, now returns `a + b`. Verified with `python3 -c "..."` → `ok`.
─ lora/default · 3.3k context · 366 out · $0.0024 · 2.2s
With -y, nothing asks, and -p prints the result and exits instead of staying interactive. Deny rules still apply; Permissions and autopilot explains them, and tutorial 5 sets them up for unattended runs.
-
malac <prompt>starts working right away;--plainuses the line mode, and the default is the full-screen UI. - Reading is free; edits and commands ask in
askmode, and-yturns asking off. - Every session is saved, can be shown with
malac sessions show, and continued with-c.
Next: Delegating to subagents.
Getting started
Tutorials
- Tutorials
- Tutorial 1: Your first task
- Tutorial 2: Delegating to subagents
- Tutorial 3: Automating a browser
- Tutorial 4: Long-term memory with Milvus
- Tutorial 5: Running malac unattended
- Tutorial 6: Customizing malac
- Tutorial 7: Running malac on a server
Using malac
- Workspaces, tabs and the daemon
- The terminal UI
- Plain mode and scripting
- Sessions
- Jobs
- Permissions and autopilot
- Subagents
- Memory
- Project context
- Plugins and marketplaces
- Computer and browser control
- Web UI
- VS Code
- Remote access
- Mobile (preview)
- MCP servers
- Configure malac by asking
- Updating
Reference
- CLI
- Slash commands
- Configuration
- Tools
- Control service tools
- JSON events
- Protocol
- Environment variables
Guides
- Using an LLM gateway
- Running models locally
- Vector memory with Milvus
- Controlling a remote machine
- Writing agent types, skills and commands
- Security model
- Things to know
Project