npm package: @paytmsupport/paytm-jarvis
Description: Persistent AI coding context for teams. Git tracks code history. DevContext tracks intent history.
Author: Naitik Sharma
Latest version: 1.0.2

# Jarvis

<div align="center">

**Persistent AI coding context for teams**

[![npm version](https://img.shields.io/npm/v/@paytmsupport/paytm-jarvis.svg)](https://www.npmjs.com/package/@paytmsupport/paytm-jarvis)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![TypeScript](https://img.shields.io/badge/TypeScript-5.6-blue.svg)](https://www.typescriptlang.org/)

*Git tracks code history. Jarvis tracks intent history.*

</div>

---

## 🎯 What is Jarvis?

Jarvis helps development teams maintain **context** across coding sessions. While Git tracks *what* changed, Jarvis tracks *why* it changed, what approaches were tried, and where you left off.

Perfect for:
- 🔄 **Resuming work** after breaks or context switches
- 👥 **Team handoffs** without losing context
- 🤖 **AI coding assistants** (Cursor, Claude, Copilot) with full project context
- 📝 **Documenting decisions** and approaches for future reference

## ✨ Features

- 📝 **Save Context**: Capture your coding intent, decisions, and progress
- 🔄 **Resume Sessions**: Generate context prompts for AI tools automatically
- 👥 **Team Collaboration**: Share context with teammates via Git
- 🤖 **AI-Powered**: Auto-summarize changes and suggest next steps
- 🔍 **Git Integration**: Automatic capture of commits and diffs
- ⚡ **Auto-Capture**: Watch mode for automatic context saving
- 🔌 **MCP Server**: Integrate with Claude Code and other MCP-compatible tools

## 📦 Installation

```bash
npm install -g @paytmsupport/paytm-jarvis
```

Or use with `npx` (no installation needed):

```bash
npx @paytmsupport/paytm-jarvis --version
```

## 🚀 Quick Start

### 1. Initialize Jarvis

Navigate to your project directory and initialize:

```bash
cd your-project
jarvis init
```

This creates a `.jarvis/` directory and configuration file.

### 2. Save Your Context

Save what you're working on:

```bash
jarvis save "Implementing user authentication"
```

Or use interactive mode for detailed context:

```bash
jarvis save
# Follow the prompts to add:
# - What you're working on
# - Approaches tried
# - Key decisions
# - Current state
# - Next steps
# - Blockers
```

### 3. Resume Context

Generate a context prompt for your AI assistant:

```bash
jarvis resume
```

The context is automatically copied to your clipboard and ready to paste into Cursor, Claude, or other AI coding assistants.

### 4. View History

See your context history:

```bash
jarvis log
jarvis log --all  # Show all branches
```

## 📚 Commands Reference

### Core Commands

#### `jarvis init`
Initialize Jarvis in the current repository.

```bash
jarvis init
```

Creates `.jarvis/` directory and sets up configuration.

---

#### `jarvis save [message]`
Save current coding context.

**Basic usage:**
```bash
jarvis save "Working on feature X"
```

**With options:**
```bash
jarvis save \
  --goal "JIRA-123" \
  --state "Implemented core logic, testing edge cases" \
  --approaches "Tried approach A;;Tried approach B" \
  --decisions "Using library X for performance" \
  --next-steps "Add error handling;;Write tests" \
  --blockers "Waiting for API response"
```

**Options:**
- `-g, --goal <goal>` - Goal or ticket reference
- `-a, --auto` - Auto-extract context from editor sessions (Claude Code, Antigravity, Cursor)
- `--approaches <approaches>` - Approaches tried (separated by `;;`)
- `--decisions <decisions>` - Key decisions made (separated by `;;`)
- `--state <state>` - Current state / where you left off
- `--next-steps <nextSteps>` - Next steps (separated by `;;`)
- `--blockers <blockers>` - Blockers (separated by `;;`)

---

#### `jarvis resume`
Generate context prompt for AI tools.

```bash
jarvis resume                    # Current branch, copy to clipboard
jarvis resume --branch feature/auth  # Specific branch
jarvis resume --stdout           # Output to stdout instead of clipboard
```

**Options:**
- `-b, --branch <branch>` - Resume context from a specific branch
- `--stdout` - Output to stdout instead of clipboard

---

#### `jarvis log`
View context history.

```bash
jarvis log                    # Current branch, last 10 entries
jarvis log --all              # All branches
jarvis log --count 20         # Show 20 entries
jarvis log --all --count 50   # All branches, 50 entries
```

**Options:**
- `-a, --all` - Show all branches
- `-n, --count <n>` - Number of entries to show (default: 10)

---

#### `jarvis diff`
Show what changed since the last context save.

```bash
jarvis diff
```

Displays git diff and recent commits since your last context save.

---

### Team Features

#### `jarvis handoff [assignee] [message]`
Hand off context to a teammate.

```bash
jarvis handoff @teammate "Ready for review"
jarvis handoff @alice "Main logic complete, needs testing"
```

Creates a handoff entry that your teammate can view with `jarvis log`.

---

#### `jarvis share`
Share `.jarvis/` via git for team collaboration.

```bash
jarvis share           # Start sharing (remove .jarvis/ from .gitignore)
jarvis share --stop    # Stop sharing (add .jarvis/ back to .gitignore)
```

**Options:**
- `--stop` - Stop sharing (add `.jarvis/` back to `.gitignore`)

---

### Auto-Capture

#### `jarvis watch`
Watch for file changes and auto-save context.

```bash
jarvis watch                    # Auto-save every 5 minutes
jarvis watch --interval 10     # Auto-save every 10 minutes
```

**Options:**
- `-i, --interval <minutes>` - Auto-save interval in minutes (default: 5)

---

#### `jarvis hook <action>`
Manage git hooks for automatic context capture.

```bash
jarvis hook install    # Install git hooks
jarvis hook remove     # Remove git hooks
```

Automatically captures context on commits and branch switches.

---

### AI-Powered Features

> **Note:** AI features require configuration. See [Configuration](#configuration) section.

#### `jarvis summarize`
Auto-generate context from git diff + commits using AI.

```bash
jarvis summarize
```

Analyzes recent changes and commits to automatically generate context.

---

#### `jarvis suggest`
AI-powered next step suggestions.

```bash
jarvis suggest
```

Provides actionable next steps based on your current context and code changes.

---

#### `jarvis compress`
Compress old context entries using AI.

```bash
jarvis compress
```

Uses AI to summarize and compress old context entries, keeping history manageable.

---

### Configuration

#### `jarvis config`
Manage configuration settings.

```bash
jarvis config list                    # List all settings
jarvis config get <key>               # Get a setting value
jarvis config set <key> <value>        # Set a setting value
```

**Available settings:**
- `defaultOutput` - Default output format
- `autoGitCapture` - Auto-capture git commits (true/false)
- `recentCommitCount` - Number of recent commits to capture (default: 5)
- `defaultLogCount` - Default number of log entries (default: 10)
- `watchInterval` - Watch mode interval in minutes (default: 5)
- `autoHook` - Auto-install git hooks (true/false)
- `aiProvider` - AI provider (openai, anthropic, etc.)
- `aiModel` - AI model name
- `aiApiKey` - AI API key (masked in output)

**Examples:**
```bash
jarvis config set autoGitCapture true
jarvis config set recentCommitCount 10
jarvis config set aiProvider openai
jarvis config set aiModel gpt-4
jarvis config set aiApiKey sk-...
```

---

## 🔌 MCP Server

Jarvis provides an MCP (Model Context Protocol) server for integration with AI tools like Claude Code.

### Usage

```bash
jarvis-mcp
```

### Configuration

Add to your MCP client configuration (e.g., Claude Code):

```json
{
  "mcpServers": {
    "jarvis": {
      "command": "jarvis-mcp"
    }
  }
}
```

The MCP server exposes Jarvis functionality as tools and resources that AI assistants can use directly.

---

## 💡 Use Cases

### Daily Development Workflow

```bash
# Morning: Resume where you left off
jarvis resume  # Get full context for AI assistant

# During work: Save progress
jarvis save --state "Implemented authentication, writing tests"

# End of day: Save final state
jarvis save --next-steps "Review PR;;Add error handling"
```

### Team Handoffs

```bash
# Before leaving
jarvis handoff @teammate "Feature complete, ready for review"

# Teammate picks up
jarvis resume --branch feature/auth
```

### AI Integration

```bash
# Auto-generate context from recent changes
jarvis summarize

# Get AI suggestions for next steps
jarvis suggest

# Compress old entries to keep history clean
jarvis compress
```

### Continuous Context Capture

```bash
# Start watch mode
jarvis watch --interval 10

# Install git hooks for automatic capture
jarvis hook install
```

---

## 📁 Project Structure

After running `jarvis init`, your project will have:

```
your-project/
├── .jarvis/
│   ├── config.json          # Configuration file
│   └── sessions/            # Context entries organized by branch
│       ├── main/
│       │   └── <timestamp>.json
│       └── feature/auth/
│           └── <timestamp>.json
└── ...
```

---

## ⚙️ Configuration

Configuration is stored in `.jarvis/config.json`. You can edit it directly or use the `jarvis config` command.

**Default configuration:**
```json
{
  "defaultOutput": "clipboard",
  "autoGitCapture": true,
  "recentCommitCount": 5,
  "defaultLogCount": 10,
  "watchInterval": 5,
  "autoHook": false,
  "aiProvider": null,
  "aiModel": null,
  "aiApiKey": null
}
```

---

## 🔒 Privacy & Security

- Context is stored locally in `.jarvis/` directory
- Git integration only reads commits and diffs (no write access)
- AI features require explicit API key configuration
- `.jarvis/` is added to `.gitignore` by default (use `jarvis share` to enable team sharing)

---

## 📋 Requirements

- **Node.js**: 18 or higher
- **Git**: Required for git integration features
- **npm**: For installation

---



---

---

## 🙏 Acknowledgments

- Built for development teams who value context and collaboration
- Inspired by the need for better context management in AI-assisted development


---

<div align="center">

**Made with 💙 for development teams**

[Install](#-installation) • [Quick Start](#-quick-start) • [Commands](#-commands-reference) • [Use Cases](#-use-cases)

</div>