# Available Feynman CLI Commands: Complete Reference Guide

> Explore available Feynman CLI commands for core operations, model management, AlphaXiv integration, and research workflows. Find a complete reference guide for efficient development.

- Repository: [Advait Paliwal/feynman](https://github.com/advaitpaliwal/feynman)
- Tags: api-reference
- Published: 2026-09-08

---

**The Feynman CLI provides a modular command set spanning core operations, model management, AlphaXiv integration, and research workflows, all dispatched from [`src/cli.ts`](https://github.com/advaitpaliwal/feynman/blob/main/src/cli.ts) and defined declaratively in `metadata/commands.mjs`.**

The Feynman CLI in the `advaitpaliwal/feynman` repository offers a single-binary interface for managing AI research workflows. Built on a metadata-driven architecture, the CLI discovers its available commands from structured data files rather than hardcoded logic. This design enables rapid extension while maintaining a consistent help system and backwards compatibility.

## Core Command Architecture

### Entry Point and Dispatch ([`src/cli.ts`](https://github.com/advaitpaliwal/feynman/blob/main/src/cli.ts))

The main entry point at [`src/cli.ts`](https://github.com/advaitpaliwal/feynman/blob/main/src/cli.ts) handles top-level argument parsing using Node's native `parseArgs` from the `util` module. It validates commands against the `TOP_LEVEL_COMMANDS` set—derived from `topLevelCommandNames`—before routing to specialized handlers like `launchPiChat`, `runDoctor`, or `serveWorkbench`.

### Metadata-Driven Discovery (`metadata/commands.mjs`)

Rather than embedding command definitions in the executable, Feynman uses `metadata/commands.mjs` to store the `cliCommandSections` array. This file groups commands into sections (Core, Model Management, AlphaXiv, Utilities, and Research Workflows) and supplies usage strings and descriptions consumed by the `printHelp` function.

## Available Feynman CLI Command Categories

### Core Operations

The foundation includes essential utilities for environment setup and debugging:

- **`feynman help`** – Invokes `printHelp` to display formatted tables from `cliCommandSections`
- **`feynman`** (no arguments) – Starts the interactive REPL via `launchPiChat`
- **`feynman doctor`** – Runs system diagnostics through `runDoctor` to verify installation health

Run one-shot prompts without entering the REPL:

```bash
feynman --prompt="- summarize the strongest evidence first"

```

### Model Management

Control your default research models with sub-commands implemented in [`model/commands.js`](https://github.com/advaitpaliwal/feynman/blob/main/model/commands.js):

```bash

# List all stored models

feynman model list

# Set the default inference model

feynman model set openrouter/gpt-4

```

### AlphaXiv Integration

Interface with the AlphaXiv academic search engine using dedicated auth and search commands:

```bash

# Search academic papers

feynman alpha search "deep learning for drug discovery"

# Check authentication status (mapped from legacy --alpha-login)

feynman alpha-auth-status

```

### Research Workflows

Workflow commands such as `feynman deepresearch` are loaded dynamically from `prompts/*.md` files. These commands function both as REPL slash commands and direct CLI invocations, bridging interactive and scripted usage.

### Package Management

Manage optional tool presets through the packages namespace:

```bash

# View available presets

feynman packages list

# Install domain-specific tools

feynman packages install bio-tools

```

### Utilities and Server

Launch the local web interface for the science workbench:

```bash

# Start workbench without authentication (trusted local-only)

feynman serve --no-auth

```

## Legacy Flags and Backwards Compatibility

The CLI maintains backwards-compatible shortcuts that map directly to modern commands. For example, the legacy `--alpha-login` flag routes to the current authentication handler, ensuring existing scripts continue functioning while the metadata system evolves.

## Summary

- **Single binary architecture**: All commands route through [`src/cli.ts`](https://github.com/advaitpaliwal/feynman/blob/main/src/cli.ts) using Node's `parseArgs` utility
- **Declarative definitions**: Command metadata lives in `metadata/commands.mjs`, consumed by `printHelp` and documentation generators
- **Five major categories**: Core, Model Management, AlphaXiv, Utilities, and Research Workflows
- **Dynamic workflows**: Research prompts in `prompts/*.md` surface as both CLI commands and REPL slash commands
- **Zero-downtime migration**: Legacy flags remain supported via internal mapping in the argument parser

## Frequently Asked Questions

### How do I see all available Feynman CLI commands?

Run **`feynman help`** to trigger the `printHelp` function, which reads the `cliCommandSections` array from `metadata/commands.mjs` and renders a formatted table of all commands organized by category.

### Where are Feynman CLI commands defined in the source code?

Command definitions are split between `metadata/commands.mjs` (declarative metadata including usage strings and sections) and implementation files like [`src/cli.ts`](https://github.com/advaitpaliwal/feynman/blob/main/src/cli.ts) (dispatch logic), [`model/commands.js`](https://github.com/advaitpaliwal/feynman/blob/main/model/commands.js) (model operations), and `prompts/*.md` (research workflow templates).

### Can I run research workflows directly from the command line?

Yes. Commands in the "Research Workflows" section—such as `feynman deepresearch`—can be invoked directly without entering the REPL. These commands load their behavior from corresponding Markdown files in the `prompts/` directory.

### How does the CLI handle backwards compatibility for renamed commands?

The CLI preserves legacy flags like `--alpha-login` by mapping them to current command handlers during the argument parsing phase in [`src/cli.ts`](https://github.com/advaitpaliwal/feynman/blob/main/src/cli.ts). This ensures existing automation scripts remain functional even as the command structure evolves.