Skip to main content

Stage 1: Set up your machine

Install the tools you need to work on marisco with an AI agent, on macOS, Linux or Windows

At the end of this stage your computer has one workspace that holds marisco, its Python environment and the AI agent’s tools. You can run marisco’s command line tools and tests, and you can start Claude Code in the marisco folder.

Some steps need administrator rights on your computer. Ask your local IT support for help with those. When a command fails, copy the complete error message and send it to the marisco maintainer.

What you install

Tool What it does Why you need it
Terminal A window where you type commands Every tool below runs from it
VS Code A code editor that also opens Jupyter notebooks You edit settings files, and read and run marisco’s notebooks
Git Records each change to the files of a project marisco’s history and every contribution go through Git
GitHub, SSH key, gh GitHub hosts the marisco repository. The SSH key identifies you to GitHub. gh is GitHub’s command line tool You send changes as pull requests and follow work in issues
uv Installs Python and Python packages into isolated environments It builds the environment that marisco and the agent share
Rust A programming language and its compiler The workspace compiles two of the agent’s tools, exhash and rgapi, from their Rust source code
Claude Code The AI agent. It runs in the terminal You work on marisco with its help
aai-ws Answer.AI’s workspace. It holds the tool repositories, including the aai-coding harness for Claude Code, in one folder with one Python environment aai-coding gives the agent the team’s coding and writing conventions, rules for when to act and when to ask you first, and the tools it uses to read, search and edit notebooks

Before you start

You need three accounts or keys:

  • A GitHub account. Send your GitHub username to the marisco maintainer, who adds you as a collaborator on the repository. GitHub then sends you an invitation by email. Accept it, or GitHub refuses your pushes. You can also accept it at github.com/franckalbinet/marisco/invitations. Collaborators can push branches and open pull requests.
  • A Claude account on a paid plan (Pro, Max, Team or Enterprise). The free plan does not include Claude Code.
  • A Zotero API key for the MARIS Zotero library. Ask the MARIS administrators for it. Handlers that fetch bibliographic metadata need it.

Step 1: Open a terminal

Commands in this guide go in a terminal. Type or paste one command, press Enter, and wait for the prompt to come back before the next one.

If you have not used a terminal before, work through the first three episodes of Software Carpentry’s The Unix Shell after this step. They show how to move between folders, list and create files, and give a command options (such as -a in ls -a) and arguments (such as nbs in cd nbs). The cheatsheet lists the commands you use most often.

macOS. Open the Terminal app from Applications > Utilities. Install Apple’s command line tools, which include Git and a C compiler:

xcode-select --install

Linux (Ubuntu or Debian). Open the Terminal app. Install Git, curl and the build tools:

sudo apt update
sudo apt install build-essential git curl

Windows. Use WSL, the Windows Subsystem for Linux. WSL runs Ubuntu inside Windows. After this step you follow the Linux instructions everywhere in this guide. The aai-ws setup expects a macOS or Linux shell, so this guide does not cover native Windows.

  1. Install Windows Terminal and VS Code.

  2. Open Windows Terminal with a PowerShell tab, and install WSL with Ubuntu. This needs administrator rights:

    wsl --install
  3. Restart Windows when asked. Open Ubuntu from the Start menu, and choose a Linux username and password.

  4. In the Ubuntu terminal, run the two Linux commands above.

Keep your work in your Linux home folder (~, which is /home/<username>). Do not work under /mnt/c/. Tools run much more slowly on Windows folders opened from WSL.

Step 2: Install VS Code

VS Code is a code editor. In this guide you use it to edit settings files. In later stages you also use it to read and run marisco’s notebooks. Install VS Code, unless you installed it in step 1. Open its Extensions view (Ctrl+Shift+X, or Cmd+Shift+X on macOS), and install the Python and Jupyter extensions.

Windows. Install VS Code in Windows, not in Ubuntu, and also install the WSL extension. The first time you run code in the Ubuntu terminal, VS Code installs a small server in Ubuntu. The VS Code window then runs in Windows, and the server does the work in Ubuntu. It reads and saves your Ubuntu files, runs the terminal inside VS Code as an Ubuntu shell, and runs the Python and Jupyter extensions in Ubuntu, where they find the workspace environment. The bottom-left corner of the window shows WSL: Ubuntu when this works. If it does not, the window is working on Windows files. Microsoft’s guide Get started using VS Code with WSL gives the details.

macOS. Open VS Code, open the Command Palette (Cmd+Shift+P), and run Shell Command: Install ‘code’ command in PATH. Then open a new terminal.

Check that the code command works. It opens your shell startup file in VS Code. The shell reads this file each time you open a terminal.

On Linux and WSL:

code ~/.bashrc

On macOS:

code ~/.zshrc

A file whose name starts with a dot, such as .bashrc, is hidden. ls does not list it, but ls -a does. VS Code opens hidden files like any other file. When this guide asks you to add a line to your shell startup file, open the file with code, add the line at the end, and save with Ctrl+S (Cmd+S on macOS). The change applies only in terminals that you open after you save.

A VS Code window has several areas. The Explorer on the left lists the files of the open folder. The editor in the middle shows each file you open in its own tab. The panel at the bottom holds the terminal: open it with Ctrl+` (the backtick key), or from the Terminal menu. It works like the terminal you used in step 1. The status bar along the bottom edge shows information about the open folder, such as WSL: Ubuntu. VS Code’s User interface page describes each area, and its Get started tutorial gives a guided tour.

Step 3: Connect to GitHub

Git and GitHub are different things. Git is a program on your computer. It records the history of a project folder, which Git calls a repository. GitHub is a website that holds the shared copy of the marisco repository. Each person who works on marisco has a full copy of the repository, with all its history, on their own computer. git pull brings other people’s changes from GitHub into your copy. git push sends your changes to GitHub, on a branch of their own. You then open a pull request, which asks the maintainer to review your changes and add them to the main version of marisco. Stage 2 explains this in more detail.

To get a first picture before you continue, watch freeCodeCamp’s Git and GitHub for Beginners – Crash Course, or work through Software Carpentry’s Version Control with Git.

Tell Git your name and email. Use the email address of your GitHub account. Git writes them on each change you record:

git config --global user.name "Your Name"
git config --global user.email "you@example.org"

Git sometimes opens an editor, for example for the message of a merge commit. By default it opens an editor that runs inside the terminal, such as nano or Vim, which is hard to use if you have not seen it before. Make Git use VS Code instead. --wait makes Git wait until you close the VS Code tab:

git config --global core.editor "code --wait"

Check your settings. Git prints one name=value line for each setting, including your name, your email and the editor:

git config --list

Install gh by following the GitHub CLI instructions for your system. On WSL, follow the Linux instructions. Then sign in to GitHub:

gh auth login

Choose GitHub.com, then SSH as the protocol. When gh offers to create a new SSH key, accept. A passphrase is optional. Then choose to log in with a web browser, sign in to your GitHub account in the browser, and enter the code that gh shows you. This links gh on this computer to your account. On WSL, if no browser opens, open the address that gh prints in your Windows browser.

An SSH key is a pair of files in the hidden folder ~/.ssh. The private key stays on your computer and proves to GitHub that you are you. gh uploads the public key to your GitHub account. Never share the private key.

Check the connection. The first time, type yes to trust GitHub’s server. GitHub replies with a greeting that includes your username:

ssh -T git@github.com

If gh cannot create or upload the key, follow GitHub’s guide Connecting to GitHub with SSH.

Step 4: Install uv and Rust

Python is a programming language, and also a toolbox. Packages add tools to it, as plugins add features to a program. marisco is one such package. It builds on other packages, as you build with Lego bricks: pandas for tables and netCDF4 for NetCDF files, for example. The dependencies list in marisco’s pyproject.toml names them all.

You could install every package into one Python for the whole computer. But two projects can need different versions of the same package: an old project may work only with an old version of pandas. So each project, or each group of projects that work together, gets its own toolbox, called an environment. An environment is a folder that holds a Python and the packages that those projects need. uv creates environments and installs packages into them. In this guide, the aai-ws workspace and the projects that you add to it, such as marisco, share one environment: step 6 builds it, and step 7 adds marisco to it.

Install uv:

curl -LsSf https://astral.sh/uv/install.sh | sh

Rust is another programming language. Two of the agent’s key tools in aai-ws are written in Rust: exhash, which edits files, and rgapi, which searches them. Rust code must be compiled, which means translated into a program your computer can run, before you can use it. The workspace compiles these two tools on your computer in step 6, and it needs Rust’s compiler to do that.

Install Rust, and accept the default installation when asked:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Open a new terminal, then check that both work. Each command prints a version number:

uv --version
cargo --version

Step 5: Install Claude Code

On WSL, run this in the Ubuntu terminal, not in PowerShell:

curl -fsSL https://claude.ai/install.sh | bash

Open a new terminal and check the installation. It prints a version number:

claude --version

Run claude and follow the browser prompts to sign in. Type /exit to quit. If the installation fails, see Troubleshoot installation and login.

Step 6: Install the aai-ws workspace

Claude Code works as soon as you install it, but it does not know how this team works. Two parts of Answer.AI’s setup add that knowledge.

aai-ws is a workspace: one folder that holds a group of projects, each in its own Git repository, and one Python environment that they all share. Each project is installed so that a change you make in it is available to the other projects at once, with no reinstall. One command, ws-sync, updates every project and package in the workspace. Another, ws-add, adds a project: step 7 uses it to add marisco.

aai-coding is one of the projects in the workspace. It configures Claude Code and gives it the team’s tools:

  • Rules for writing code and documentation, and rules for when the agent acts and when it asks you first.
  • A Python session that stays open while the agent works, with tools to read, search and edit files and notebooks. For example, exhash refuses an edit if the file has changed since the agent last read it.
  • Permissions and hooks. Permissions list the safe commands that the agent can run without asking you. Hooks are checks that run before some of the agent’s actions.

The setup command creates the folder ~/aai-ws, clones the workspace’s repositories into it, and builds one Python environment in ~/aai-ws/.venv:

uvx --from 'fastws-cli>=0.0.14' ws-setup AnswerDotAI/aai-ws ~/aai-ws

Activate the environment and move into the workspace:

source ~/aai-ws/.venv/bin/activate
cd ~/aai-ws

The rest of the setup is a runbook that Claude Code follows. Start Claude Code in manual mode. In manual mode, Claude Code asks for your approval before each action, except for a list of everyday commands:

claude --permission-mode default

Ask the agent to follow aai-coding/SETUP.md. The agent registers its Python kernel, and installs hooks and permissions for Claude Code. This is the first time the agent changes files on your computer, so do this step with the maintainer or your IT support. SETUP.md is written for macOS. On Linux or WSL, tell the agent which system you use, so that it skips the macOS-only steps.

Then ask the agent to set permissions.defaultMode to "default" in ~/.claude/settings.json. Without that setting, Claude Code starts each session in auto mode, where most actions run without asking. You learn to judge the agent’s actions in manual mode, and you move to auto mode at the end of stage 3.

Restart Claude Code when the agent has finished. The status bar under the prompt shows manual mode on.

You must activate the environment in every new terminal. To do it automatically, add the source line to your shell startup file. That file is ~/.zshrc on macOS and ~/.bashrc on Linux and WSL:

On macOS:

echo 'source ~/aai-ws/.venv/bin/activate' >> ~/.zshrc

On Linux and WSL:

echo 'source ~/aai-ws/.venv/bin/activate' >> ~/.bashrc

Step 7: Add marisco to the workspace

ws-add clones marisco into ~/aai-ws/marisco and installs it into the shared environment. Claude Code’s Python kernel runs in that environment. The agent can therefore import marisco:

ws-add franckalbinet/marisco

Turn on nbdev’s merge driver for notebooks. When two branches change the same notebook, Git’s default merge can leave the notebook file unreadable. The nbdev driver keeps it readable, and marks any conflict inside the cells that conflict:

cd ~/aai-ws/marisco
git config --local include.path ../.gitconfig

Add your Zotero API key at the end of your shell startup file. Open the file with code ~/.bashrc on Linux and WSL, or code ~/.zshrc on macOS, add this line with your own key, save, and open a new terminal:

export ZOTERO_API_KEY=your_api_key_here

Never paste the key into a notebook or any other file in the repository. Anything committed to the repository becomes public.

Step 8: Open marisco in VS Code

Open marisco from the terminal:

code ~/aai-ws/marisco

Open nbs/index.ipynb. When VS Code asks for a kernel, choose the Python environment at ~/aai-ws/.venv/bin/python.

Check your setup

Open a new terminal and run:

cd ~/aai-ws/marisco
marisco-ingest not-a-handler
nbdev-test nbs/api/geo.ipynb

marisco-ingest reports that not-a-handler is invalid, and lists the handlers that exist. nbdev-test runs the notebook’s tests and prints Success.

Then start claude in ~/aai-ws/marisco and ask: “Which marisco handlers exist, and what is the status of each?” The agent answers by reading the code. Its answer shows that it can read marisco and run Python in the workspace environment.

Stage 1 is complete when all three checks work.

Day to day

Start each working session like this:

cd ~/aai-ws/marisco
ws-sync
claude

ws-sync pulls the latest version of every repository in the workspace, including marisco, and updates the Python packages. Run it at the start of each day.

When a command you just installed gives command not found, open a new terminal. Installers add their folder to the command search path, and only new terminals read it. When marisco-ingest, nbdev-test or ws-sync gives command not found, the workspace environment is not active. Run source ~/aai-ws/.venv/bin/activate.