Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ All notable changes to Memori will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### **Added**

#### **Minimal CLI for Memori**
- `memori --version`: Display version
- `memori init [--force]`: Create starter config (`memori.json`)
- `memori health [--config <path>] [--check-db]`: Validate environment and configuration
- Console script automatically available after `pip install memorisdk`
- Pure Python implementation using only standard library (argparse, json, pathlib, importlib.metadata)
- 26 unit tests with comprehensive coverage

#### **Documentation**
- Added CLI reference guide with examples and troubleshooting
- Updated quick-start to mention CLI availability
- Integrated CLI reference into navigation

---

## [2.3.0] - 2025-09-29

### 🚀 **Major Performance Improvements**
Expand Down
114 changes: 114 additions & 0 deletions docs/getting-started/cli-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# CLI Reference

Memori CLI is automatically available after `pip install memorisdk`.

## Quick Reference

| Command | Purpose |
|---------|---------|
| `memori --version` | Show version |
| `memori init` | Create `memori.json` config |
| `memori init --force` | Overwrite config |
| `memori health` | Validate setup |
| `memori health --check-db` | Check database connection |
| `memori health --config <path>` | Validate custom config |

---

## Commands

### `memori --version`

Display installed version:
```bash
memori --version
# Output: memori version 2.3.0
```

### `memori init`

Create a starter configuration with sensible defaults:
```bash
memori init
memori init --force # Overwrite existing config
```

Creates `memori.json` with:
- SQLite database connection
- OpenAI API key placeholder
- Memory namespace and retention policy
- Logging configuration

See [Configuration Guide](../configuration/settings.md) for detailed structure.

### `memori health`

Validate environment, dependencies, and configuration:
```bash
memori health
memori health --config custom.json # Validate custom config
memori health --check-db # Include database test
```

**Checks performed:**
1. Package import
2. Core dependencies (Pydantic, SQLAlchemy, OpenAI, LiteLLM, Loguru, python-dotenv)
3. Configuration file validity and required sections
4. Database connectivity (with `--check-db`)

**Exit codes:**
- `0`: All checks passed
- Non-zero: At least one check failed

---

## Workflow

```bash
# 1. Create config
memori init

# 2. Edit memori.json
# Set your OpenAI API key and adjust settings as needed

# 3. Validate setup
memori health --check-db

# 4. Use in Python
python your_script.py
```

## CI/CD Integration

```yaml
# .github/workflows/test.yml
- name: Install dependencies
run: pip install memorisdk

- name: Verify memori setup
run: memori health --check-db
```

## Troubleshooting

| Issue | Solution |
|-------|----------|
| Command not found | `pip install memorisdk` |
| Config not found | `memori init` |
| Invalid JSON | `memori init --force` |
| Missing dependencies | `pip install memorisdk[all]` |
| Database connection error | Check `connection_string` in `memori.json` |

---

## Help

```bash
memori --help # Show all commands
memori init --help # Show init options
memori health --help # Show health options
```

---

**Next:** [Configuration Guide](../configuration/settings.md) • [Basic Usage](basic-usage.md) • [Examples](../examples/overview.md)
3 changes: 3 additions & 0 deletions docs/getting-started/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Get Memori running in less than a minute.
pip install memorisdk openai
```

!!! tip "CLI Available"
Memori now includes a CLI! Use `memori init` to create a config file and `memori health` to check your setup. See the [CLI Reference](cli-reference.md) for details.

## 2. Set API Key

```bash
Expand Down
Loading