Investigating with AI Agents:

the Command Line for Journalists

01
01 — Why the Terminal?

Why the Terminal?

What AI agents can do that chatbots can't

Why the Terminal?

AI agents in the terminal can do things ChatGPT can't

Long-Running Tasks
Run research overnight. No timeouts, no session limits.
Local File Access
Read, write, and transform files directly on your machine.
Chain Operations
Pipe tools together. Download, parse, analyze in one go.
Parallel Research
Run multiple agents simultaneously on different tasks.
Reproducible
Save commands as scripts. Re-run and share your methodology.
02
02 — Demo

Demo

What AI-powered investigation looks like in practice

Cleared: How Assam Demolished the Homes of 20,000 Families

33
eviction operations
100K+
people displaced
12
districts
View the evictions database →

Grounded Research, Not Hallucinations

The key instructions from our agent prompts — copy these into yours

Investigator Agent
## Evidence Grounding — MANDATORY Every finding MUST be grounded in evidence. Scrape before you cite. A finding without a scraped source file is not a finding — it is a claim. Quote verbatim. Do not paraphrase primary sources. 2+ independent sources per finding. Flag single-source findings explicitly. Never fabricate evidence. An honest gap is infinitely more valuable than a plausible fiction.
Fact-Checker Agent
## Assign Verdict verified 2+ independent sources, no contradicting evidence unverified Evidence absent — NOT "false" disputed Credible evidence for and against false Contradicted by strong evidence Never assume truth without evidence. Always present both sides. Distinguish "unverified" from "false" with precision.

The Toolkit

Web Scraping
Firecrawl: search, scrape, and map any website
OSINT Tools
OSINT skill + Navigator: 150+ curated investigation tools
Translation
Translate documents in any language
Data Extraction
XLSX, PDF, CSV — structured output
Narrative
From research to scrollytelling — story + visuals
03
03 — Setup

Setup

Tools and terminal basics

Prerequisites

Install these free tools before we start

Terminal Basics

Navigate your file system with these commands

pwd Print working directory — where am I?
ls List files and folders in current directory
cd folder Change directory — go into a folder
cd .. Go up one level
mkdir name Create a new folder
# Example workflow
$ cd Projects
$ mkdir new-project
$ cd new-project
$ pwd
/Users/you/Projects/new-project

Install Commands

Scan the QR code to get all setup commands

View commands →

Installing Agents

Three AI agents you can run from the terminal

Free · Google account required
# Install
$ npm i -g @google/gemini-cli
# Launch
$ gemini
04
04 — Vibe Coding

Vibe Coding

Four hands-on exercises

Exercise 1

15 min Web Scraping

Use your agent to search the web on any topic, save source files locally, and build a structured research database.

  • Ask the agent to install Firecrawl and authenticate
  • Run a search and save each source to a local file
  • Build a sources database with provenance and key claims
  • Ground every claim in a direct quote from the source
Install the Firecrawl CLI and authenticate with my API key.
Search for: [__________]. For each result, save the full page to a local file. Extract key claims with direct quotes. Build a sources.csv with columns: url, date_accessed, title, key_claims, local_file. Every claim must be grounded in the source text.

Exercise 2

15 min Data Extraction

Extract structured data from real investigation files — a Swiss BFS dataset, an Indian court filing, or a scanned government contract.

  • Pick one of 3 source files (XLSX, court PDF, scanned contract)
  • Ask your agent to extract structured data
  • Clean and format as CSV
  • Compare your output with the original — what did the agent miss?
Extract structured data from this file into a clean, flat CSV. Flatten any nested headers, handle suppressed or missing values, and ensure each row is one observation. The output should be ready for analysis.
Download Materials

Exercise 3

15 min Document Analysis

Analyze and translate foreign-language government documents — real notices from an active investigation.

  • Translate notices from Assamese script to English
  • Extract who issued them, to whom, under what authority
  • Compare across 4 notices — templates or unique?
  • Identify anything procedurally unusual
Translate each document to English, preserving structure. Extract: who issued it, who it’s addressed to, what action is required, by what date, and under what legal authority. Note anything procedurally unusual. Then compare all documents: identical templates or do they differ?
Download Materials

Exercise 4

15 min Visual Scrollytelling

Pick any topic and build a visual scrollytelling page from scratch — the agent finds images, writes HTML, and adds animations.

  • Choose a topic: a place, an event, a cause, anything
  • Ask the agent to find images and build a scrollytelling page
  • Iterate on layout, transitions, and visual effects
  • Open the result in your browser
Build a single standalone index.html that tells a visual story about [__________] as a scrollytelling page. Find images on the internet for each section. Use full-viewport backgrounds, IntersectionObserver for transitions, and CSS/JavaScript animations. No frameworks — just HTML that opens in a browser.
06
06 — GitHub & Deployment

GitHub & Deployment

Publish your work to the web

What is GitHub?

Where your code lives online — like Google Drive for code, with version history

Repository
A project folder stored online with full version history.
Commits
Snapshots of your work. Like save points you can always go back to.
GitHub Pages
Free web hosting. Push code → get a live website.

Authenticate with GitHub

Install the GitHub CLI and log in from your terminal

>
“Install the GitHub CLI and authenticate me”
What happens next
  1. Your browser will open a GitHub authorization page
  2. Review the permissions and click Authorize
  3. You’ll be asked for an access code — look in your terminal, the code is displayed there
  4. Enter the code in your browser to complete authentication

Enable GitHub Pages

Configure your repository to deploy via GitHub Actions

In your GitHub repository
  1. Go to Settings (top menu bar)
  2. Click Pages (left sidebar)
  3. Under Source, select GitHub Actions
Before you deploy: Make sure you are in the correct project directory in your terminal. Run pwd to check. Your agent will commit and push everything in this folder.

Deploy with Your Agent

One prompt to go from local files to a live website

Set up this project for deployment on GitHub Pages. Initialize a git repository, create a .gitignore, and add a GitHub Actions workflow to deploy to Pages. Before committing, show me the list of files and ask if there’s anything sensitive or unnecessary that should be excluded. Then commit, create a GitHub repository, and push.

You're a vibe coding journalist!

Terminal, AI agents, GitHub — you've got the tools