Available Feynman CLI Commands: Complete Reference Guide
The Feynman CLI provides a modular command set spanning core operations, model management, AlphaXiv integration, and research workflows, all dispatched from 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)
The main entry point at 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– InvokesprintHelpto display formatted tables fromcliCommandSectionsfeynman(no arguments) – Starts the interactive REPL vialaunchPiChatfeynman doctor– Runs system diagnostics throughrunDoctorto verify installation health
Run one-shot prompts without entering the REPL:
feynman --prompt="- summarize the strongest evidence first"
Model Management
Control your default research models with sub-commands implemented in model/commands.js:
# 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:
# 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:
# 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:
# 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.tsusing Node'sparseArgsutility - Declarative definitions: Command metadata lives in
metadata/commands.mjs, consumed byprintHelpand documentation generators - Five major categories: Core, Model Management, AlphaXiv, Utilities, and Research Workflows
- Dynamic workflows: Research prompts in
prompts/*.mdsurface 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 (dispatch logic), 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. This ensures existing automation scripts remain functional even as the command structure evolves.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →